Nov 10 2008

HOWTO: Get USB working with Virtualbox 2.0 in Ubuntu 8.10

1. Install VirtualBox-2.0

Add repository to /etc/apt/sources.list and install Virtualbox-2.0

echo "deb http://download.virtualbox.org/virtualbox/debian intrepid 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-2.0

2. Configure Ubuntu for VirtualBox-2.0

Add yourself to the vboxusers group

sudo gpasswd -a `whoami` vboxusers

Startup vboxdrv module on boot by appending it to /etc/modules

echo "vboxdrv" | sudo tee -a /etc/modules

3. Usb Filesystem fix

Get the vboxusers group id

cat /etc/group | grep vboxusers

vboxusers:x:128:spirit

Edit /etc/fstab to add these two lines and replace the devgid with the vboxusers group id

#usbfs for virtualbox
none /proc/bus/usb usbfs devgid=128,devmode=664 0 0

4. Kernel usbcore fix

check your current kernel version

uname -r

2.6.27-7-generic

Get the sources for your kernel and fix usb/core/devio.c

sudo apt-get build-dep linux-source-2.6.27
sudo apt-get install linux-source-2.6.27 build-essential
tar -jxvf /usr/src/linux-source-2.6.27.tar.bz2
cd linux-source-2.6.27/drivers/usb/core
perl -pi.bak -e 's/16384/131072/' devio.c
make -C /lib/modules/`uname -r`/build/ M=`pwd` modules
strip --strip-debug usbcore.ko
sudo install -m644 -b usbcore.ko /lib/modules/`uname -r`/kernel/drivers/usb/core
sudo depmod -ae
sudo update-initramfs -u

Reboot your system and check if vboxdrv is running

lsmod | grep vbox

vboxdrv 72472 0

The VirtualBox manager can be found under Applications/System Tools. You should see the USB options in the settings. You can add the devices you want.