Showing posts with label virtualbox. Show all posts
Showing posts with label virtualbox. Show all posts

Tuesday, December 4, 2007

Installing VirtualBox with USB Support

VirtualBox
VirtualBox by InnoTek is a commercial and proprietary (with a limited GPL version) x86 virtualizer for Linux. It works fast and I like it more than VMware. For more info, check out it's wiki page. This guide will show you how to install both versions, the Open Source (OSE) and the Personal Use & Evaluation License (PUEL).

The Open Source Edition
This version of Virtualbox is released under the GPL. It does not have USB support and Virtual Remote Desktop support. It is the free as in freedom version and the easier of the two to setup. If you don't need USB or remote desktop support this method may be the one for you.

Download Virtualbox & Dependencies
In a terminal type:
sudo apt-get install virtualbox-ose virtualbox-ose-source

Prepare the source for kernel
In at terminal type:
sudo m-a prepare

Then install
In a terminal type:
sudo m-a auto-install virtualbox-ose

Add yourself as a virtual box user
In a terminal type:
sudo adduser username vboxusers
You must replace userame with your user name!


Personal Use & Evaluation License Version
The PUEL version has both USB support and Virtual Remote Desktop support. It is proprietary, but is available as a free download. It's my preferred version of VirtualBox.

Step 1: Download and Install VirtualBox

You can download the PUEL version of Virtualbox from Innotek website here.
Once your download is complete double click the .deb file and install VirtualBox.


Step 2: Setup User groups & USB support
Add yourself as a virtual box user
In a terminal type:
sudo adduser username vboxusers
You must replace userame with your user name!

Add USB support to you fstab file
In a terminal type:
sudo gedit /etc/fstab

And paste this line to the end of your fstab
none /proc/bus/usb usbfs devgid=1001,devmode=664 0 0

Enable USB
In a terminal type:
sudo gedit /etc/init.d/mountdevsubfs.sh

You need to look for this section:
#
# Magic to make /proc/bus/usb work
#
#mkdir -p /dev/bus/usb/.usbfs
#domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
#ln -s .usbfs/devices /dev/bus/usb/devices
#mount --rbind /dev/bus/usb /proc/bus/usb

And delete all the # shown, it should look exactly like this.

#Magic to make /proc/bus/usb work

mkdir -p /dev/bus/usb/.usbfs
domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb /proc/bus/usb

Find your vboxusers number
In a terminal type:
sudo gedit /etc/group

Look for this, the number following it is your vboxusers number
vboxusers:x:NUMBER

Next you have to add a line to your /etc/fstab to allow usb mounting
In a terminal type:
sudo gedit /etc/fstab

Add this line:
none /proc/bus/usb usbfs devgid= enter
vboxusers number HERE,devmode=664 0 0

Allow access to /proc/bus/usb/
in a teminal type:
sudo chown -R root:vboxusers /proc/bus/usb

Once you Log out or reboot, you can start VirtualBox (Applications>System Tools>Innotek VirtualBox)


Step 3 - Configuring VirtualBox
When you first run VirtualBox there is a wizard that automates setting up your virtual machine. Follow the steps, it's incredibility easy.

Once you have setup up your VM you should configure a couple of things in Settings.

First enable IO APIC
enable_io

Then enable USB, and add the USB devices to your VirtualBox with the green USB icon. Deivces must be plugged in for this to work. Use the green and red USB icons to add and remove USB devices.
enable_usb