home index sites engineering software hardware email
 

How-To: VirtualBox



Documentation & resources




Installation


Under Ubuntu (tested with 10.04) run the following:

echo "deb http://download.virtualbox.org/virtualbox/debian lucid contrib" | \
   sudo tee /etc/apt/sources.list.d/virtualbox.list
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | \
   sudo apt-key add - && sudo aptitude update
sudo aptitude install virtualbox-4.0

Download the extension pack from http://www.virtualbox.org/wiki/Downloads and install it:

sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.*.vbox-extpack

Add yourself to the vboxusers group:

sudo gpasswd -a $USERNAME vboxusers

Finally, logout then back in (so your account has access to the new group) and run the following:

VirtualBox &


Creating a VM


Use the GUI to create the VM however you might want to change the "Remote Display" (if you use the feature) to only listen on localhost (127.0.01) by running the following via the command line (it's only possible to set the port with the current version of the GUI), make sure to change "some vm" to the name of your VM:

VBoxManage modifyvm "some vm" --vrdeaddress 127.0.0.1

You can verify the remote display settings with:

VBoxManage showvminfo "some vm" | grep VRDE


Guest additions


Select "Install Guest Additions" from the VirtualBox "Devices" menu to get seamless window, keyboard and mouse integration (under Linux you will need to manually run the .run file off the mounted CDROM, choose the file appropriate for your architecture).


Mounting host directories/folders


Select "Shared Folders" from the VirtualBox "Devices" menu, click "Machine Folders" then click on the "plus" symbol to the right and select a host directory to export, set the "Folder Name" to "vbox" (for example).

To mount the shared folder under a Linux guest run the following to create a directory (you can use any directory you want):

sudo mkdir /host

Then run the following to mount the shared folder under the newly created directory:

sudo mount -t vboxsf vbox /host

To make the mount permanent add the following to /etc/fstab:

vbox /host vboxsf defaults 0 0

To mount the shared folder under a Windows guest run Windows Explorer, select "Tools/Map Network" Drive and select an unused drive letter then enter the following as the "Folder":

\\vboxsvr\vbox


Tips & Tricks


Fix for "BADSIG 54422A4B98AB5139 Oracle Corporation"


If you are getting "BADSIG" problems such as the following:

GPG error: http://download.virtualbox.org lucid Release: The following signatures were invalid: BADSIG 54422A4B98AB5139 Oracle Corporation (VirtualBox archive signing key) <info@virtualbox.org>

Then you need to perform a cleaning of your apt meta data (ref: http://www.virtualbox.org/wiki/Linux_Downloads).

First disable any apt proxies you are using (the following is specific to my setup):

sudo mv -f /etc/apt/apt.conf.d/01proxy /tmp

Then clean your apt meta data:

sudo apt-get clean
sudo rm /var/lib/apt/lists/*
sudo rm /var/lib/apt/lists/partial/*
sudo apt-get clean
sudo apt-get update

Finally restore any proxy you disabled (once again the following is specific to my setup):

sudo mv /tmp/01proxy /etc/apt/apt.conf.d   


Updating the extension pack


First remove the current extension pack:

sudo VBoxManage extpack uninstall 'Oracle VM VirtualBox Extension Pack'


Then install the new extension pack (get it from http://www.virtualbox.org/wiki/Downloads ):

sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.*.vbox-extpack