home index sites engineering software hardware email
 

How-To: VirtualBox



Documentation & resources




Installation


Under Ubuntu (tested with 9.04) run the following:

echo "http://download.virtualbox.org/virtualbox/debian jaunty non-free" | sudo tee -a /etc/apt/sources.list
wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install virtualbox-3.0

Add yourself to the vboxusers group:

sudo gpasswd -a $USERNAME vboxusers

To enable USB run the following (this modifies /etc/fstab to make a mount point for usbfs):

Gid="`grep vboxusers /etc/group|cut -d\: -f3`"
if [ "$vGid" ] && [ "`grep usbfs /etc/fstab`" == "" ] ; then
  echo "none /proc/bus/usb usbfs devgid=${vGid},devmode=664 0 0" | sudo tee -a /etc/fstab
  sudo mount -a
fi   

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

VirtualBox &


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