• Home

Build virtualbox VM headless

Here is some simple commands to build and run a headless virtualbox image

VBoxManage createvm --name trusty14041 --ostype Ubuntu_64
VBoxManage createhd --filename trusty14041 --size 8092
VBoxManage registervm /home/lenny/VirtualBox\ VMs/trusty14041/trusty14041.vbox
VBoxManage modifyvm trusty14041 --memory 512
VBoxManage storagectl trusty14041 --name IDE --add ide --controller PIIX4 --bootable on
VBoxManage storagectl trusty14041 --name SATA --add sata --controller IntelAhci --bootable on
VBoxManage storageattach trusty14041 --storagectl SATA --port 0 --device 0 --type hdd --medium trusty14041.vdi
VBoxManage modifyvm trusty14041 --vram 128
VBoxManage modifyvm trusty14041 --nic1 nat --nictype1 82540EM --cableconnected1 on
VBoxManage storageattach trusty14041 --storagectl IDE --port 0 --device 0 --type dvddrive --medium ../tmp/ubuntu-14.04.1-server-amd64.iso
VBoxManage modifyvm trusty14041 --vrde on --vrdeport 5012 --vrdeaddress 192.168.1.2
VBoxHeadless --startvm trusty14041 rdesktop -a 16 -N 192.168.1.2:4000

Then fire up a RDP client such as Cord (http://cord.sourceforge.net) and do a quick connect on 192.168.1.2:4000

vboxheadless-cord

Notes :

I am almost sure you will need to add a little bit of hard drive space. Use "VBoxManage modifyvm" to do it.

Print Email