Virtualbox Headless



You’ve installed your Ubuntu Server and configured it exactly the way you want it. Now, you must get to work creating some awesomeness but you’re weary that you’ll end up making some mistake and you’ll foo bar your server. Of course you can delete config files and run apt-get remove [package-name], but there’s nothing like a clean and pristine installation. Fortunately, there are other options. The option I really like is to install Virtualbox and run headless VMs. The goal of this note is to document how I was able to go about installing and configuring Virtualbox headless on my Ubuntu Server 13.04 computer.


  • Install Ubuntu Server 13.04 x64 on your machine. 
  • Update packages:
    • sudo apt-get -y update && sudo apt-get -y upgrade 
  • Assign your computer a static IP address:
    • sudo vi /etc/network/interfaces
      • Comment the line that says # iface [interface name, i.e. eth0] inet dhcp
      • Append the line iface [interface name, i.e. eth0] inet static
      • Append the line address xxx.xxx.xxx.xxx
      • Append the line netmask xxx.xxx.xxx.xxx
      • Append the line gateway xxx.xxx.xxx.xxx
    • Write changes and exit.
  • Add the Virtualbox source link to the Ubuntu sources list:
    • sudo vi /etc/apt/sources.list
      • Append the line: deb http://download.virtualbox.org/virtualbox/debian raring contrib
    • Write changes and exit.
  • Download Virtualbox public key:
    • wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
  • Update packages:
    • sudo apt-get -y update && sudo apt-get -y upgrade
  • Install latest version of Virtualbox [4.2]:
    • sudo apt-get install linux-headers-$(uname -r) build-essential virtualbox-4.2 dkms
  • Download Virtualbox Extension Pack:
    • wget http://download.virtualbox.org/virtualbox/4.2.16/Oracle_VM_VirtualBox_Extension_Pack-4.2.16-86992.vbox-extpack
  • Install Virtualbox Extension Pack:
    • sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.2.16-86992.vbox-extpack
  • Give user(s) ability to run/manage VMs by adding them to the vboxusers group:
    • sudo adduser [username] vboxusers
Awesome! Virtualbox is now installed on our Ubuntu Server 13.04 installation. Next, we’ll take a look at how to create VMs and manage them.