Both VirtualBox and Ubuntu have drastically changed since I wrote HOWTO: Ubuntu VirtualBox Server. In fact, they’ve change to such a degree that the previous article isn’t even relevant. Fret not, as I’ve rebuilt the guide from scratch based on Ubuntu 9.10 Karmic Koala and VirtualBox 3.1.2, which has since been upgraded to 3.1.4.
The only assumptions I’m making is that a fresh, recent version of Ubuntu is installed on some relatively recent hardware and you have an ISO of the OS installation. Ideally, you’re using an Intel Core 2 Duo or better. I installed it with a normal Desktop Edition, but this guide is targeted at command-line management. You’re welcome to install Server Edition in which you’re getting a command-line only version of Ubuntu to reduce system requirements and operate with utmost efficiency.
printf "\n# VirtualBox\ndeb http://download.virtualbox.org/virtualbox/debian karmic non-free\n" | sudo tee -a /etc/apt/sources.list
wget -q -O - http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc | sudo apt-key add -
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install virtualbox-3.1
That’s all there is to getting VirtualBox installed. Unfortunately, it’s not too useful without any virtual machines or operating systems, so that will be our next step.
VBoxManage createvm --name "LAMP1" --register
VBoxManage modifyvm "LAMP1" \ --memory 256 \ --acpi on \ --hwvirtex on \ --vrdp on \ --vrdpport 3391 \ --nic1 bridged \ --bridgeadapter1 eth0
VBoxManage createhd --filename LAMP1.vdi --size 10000 --remember
VBoxManage storagectl "LAMP1" --name "SATAController" --add sata
VBoxManage storageattach "LAMP1" --storagectl "SATAController" --port 0 --device 0 --type hdd --medium "LAMP1.vdi"
VBoxManage storagectl "LAMP1" --name "IDEController" --add ide
VBoxManage storageattach "LAMP1" --storagectl "IDEController" --port 0 --device 0 --type dvddrive --medium ~/ubuntu-9.10-server-i386.iso
That’s it, you’re done! Well, mostly. Depending on your exact circumstances, you may have to tweak a few things.
VBoxManage showvminfo "LAMP1"VBoxHeadless --startvm "LAMP1"
The major component to managing virtual machines on the command-line is simply knowing the correct commands and parameters to configure everything. I plan to write an addendum which addresses some advanced features such as USB, remote management, and automated startup/shutdown.
Update: The addendum for extra features is up.

2 Responses to Ubuntu VirtualBox Server Redux
HOWTO: Ubuntu VirtualBox Server | Idea Excursion
March 16th, 2010 at 11:15 am
[...] UPDATE 2: I having (finally) posted a new guide, utilizing Ubuntu 9.10 Karmic Koala and VirtualBox 3.1.2. As this HOWTO is sorely out-of-date, please follow Ubuntu VirtualBox Server Redux [...]
Ubuntu VirtualBox Server Redux Addendum | Idea Excursion
May 25th, 2010 at 5:25 am
[...] the last article on running a VirtualBox server gets you up and running with a minimum installation, there are several things that can be [...]