Sunday, 30 November 2008

VirtualBox and USB Problems

I had some problem using a Windows guest in a Linux (Ubuntu) host about the use of USB. The virtualization software I use is VirtualBox, recently acquired by Sun Microsystems.
The first thing is to use the latest stable release available. Drop your distribution installation and download the right package from their web site (at the moment of writing the latest version is 2.0.6).
In Ubuntu, at least in 7.10, you need to remove comments from a part of this script: /etc/init.d/mountdevsubfs.sh. The comment part inside the do_start() routine:

#
# 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


Modify the script with root privileges and execute it as root passing the word start as first and unique argument.

Now open this other file: /etc/udev/rules.d/40-permissions.rules.
Locate this lines:

# USB devices (usbfs replacement)
SUBSYSTEM=="usb_device", MODE="0664"

Copy the SUBSYSTEM line, comment it and change the new one with MODE value set to 0666:

#SUBSYSTEM=="usb_device", MODE="0664"
SUBSYSTEM=="usb_device", MODE="0666"


Also this file must be modified as root (in Ubuntu you can use sudo nano -w filename).

Restart the system and test if USB works on your guest operating system.

Bye!

No comments:

Post a Comment