Skip to main content

Deploy OVA on VirtualBox via CLI

virtualbox

I have run this example on OVH Server ADVANCE-LE - Intel Xeon W-2145 - 128GB DDR4 ECC 2666MHz - 2x SSD NVMe 960GB Datacenter Class Soft RAID, running Ubuntu Server 18.04 "Bionic Beaver" LTS

Located at Limburg (LIM1) - Germany in Rack L105A01 labelled ServerId 1144915

Main network configuration is: 51.89.96.40 2001:41d0:0700:3528::/64

I have added an extra subnet to allocate multiple public IPs:

  • 54.37.57.45
  • 54.37.57.32/28

VirtualBox Properties

Get a list of current properties with:

vboxmanage list systemproperties

I want to always deploy my VirtualBox Machines (a.k.a. VM) in a dedicated directory on a specific mount; Command to configure the default target directory to /srv/VMs

vboxmanage setproperty machinefolder /srv/VMs

Import OVA as "virtapp01" with 1GB of memory and 2 CPUs

VBoxManage import virt-app-vm-190724-47.ova --vsys 0 --vmname "virtapp01"
VBoxManage modifyvm virtapp01 --memory 1024 --cpus 2

--vsys 0 is use to overwrite vmname from OVA/OVF

Activate Virtual Remote Desktop on port 6011:

VBoxManage modifyvm virtapp01 --vrde on --vrdeport 6011

VBoxManage modifyvm "virtapp01" --acpi on --nic1 bridged --bridgeadapter1 enp179s0f1

VBoxManage modifyvm node$n --nic1 hostonly --hostonlyadapter1 vboxnet0 --macaddress1 000027226F1$n

VBoxManage startvm virtapp01 --type headless

install dhcpd https://wiki.archlinux.org/index.php/Dhcpcd dnsmasq https://wiki.archlinux.org/index.php/Talk:Dnsmasq