Archive for January, 2011

Enable USB support in Virtualbox

January 14th, 2011

OK, I only tried a Windows XP client on the Ubuntu 10.10 host. here I’m not sure it will work on other hosts or clients. :-)

I was using Virtualbox OSE which I installed through Ubuntu repository. However, only Virtualbox PUEL supports USB.

So this is what I did:

First, uninstall virtualbox-ose:
sudo apt-get remove virtualbox-ose
. also run
sudo apt-get autoremove
to remove unnecessary dependencies.

Now install virtualbox PUEL version. There are 2 ways:

  • Download .deb package and install it directly. Here is the download page: http://www.virtualbox.org/wiki/Linux_Downloads
  • Add http://download.virtualbox.org/ to your repository source list, and install it via
    sudo apt-get install
    . The source url for ubuntu 10.10 isdeb http://download.virtualbox.org/virtualbox/debian maverick contrib, add the public key via
    wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
    , and install it by
    sudo apt-get update;
    sudo apt-get install virtualbox-4.0

    . The lastest info can be found here: http://www.virtualbox.org/wiki/Linux_Downloads

NOTE: uninstalling virtualbox-ose and reinstalling virtualbox PUEL won’t affect the installed guest machines.

Install VirtualBox Extension Pack to suport USB 2.0. The lastest version is still listed in the download page: http://www.virtualbox.org/wiki/Downloads. Here is the directly link for VirtualBox 4.0.0: http://download.virtualbox.org/virtualbox/4.0.0/Oracle_VM_VirtualBox_Extension_Pack-4.0.0-69151.vbox-extpack

Update guest additions. You can download the guest additions ISO file here: http://download.virtualbox.org/virtualbox/. Remember to choose the right version, here I chose 4.0.0.

Now, plugin your usb device, and add a usb filter in your guest machine’s settings. Remember, you have to all these before you turn on your guest machine machine. Maybe you think now everything is done, you boot your guest machine and it will tell you a new device is found. No way!

Refer to http://ubuntuforums.org/showthread.php?p=2202027#18 for the coming steps.

Create a group “usbfs”
sudo addgroup usbfs
, and add yourself to this group:
sudo usermod -aG usbfs <your accout>

Add this line
none /proc/bus/usb usbfs devgid=1001,devmode=664 0 0
(remember to change the “1001″ to your own group id for “usbfs”!) to the end of the file “/etc/fstab”.

Reboot the host machine (here is ubuntu).

In the reference, it says: *USB DEVICES HAVE TO BE UNMOUNTED BEFORE VIRTUAL MACHINE CAN RECOGNIZE THEM*. However, I didn’t do this and it also worked. So I think with version 4.0.0, it’s not necessary.

Now start the guest machine (here is Winsows XP), it should report new USB devices found.