Now that you have Windows XP virtualizing on Ubuntu using VirtualBox, it’s reasonable that you will at some point want to use a USB device under Windows. I personally would really like to be able to sync my iPod with iTunes. It takes a bit of tweaking to Ubuntu – Intrepid Ibex to get it running properly. I did a bit of research and after a lot of trial and error I found something that works for me. We’ll cover that here.
First step, adding a user to the VirtualBox group:
This was mentioned in a dialog box during the initial install of VirtualBox, if you remember. To do this goto the System menu, Administration, then Users and Groups at the bottom of the menu.
wordpress is repeating a passage code

The User Settings box will load. Click the Unlock button so we can make changes.
It will prompt for your password. Enter it and click Authenticate.
Now select the user that will be using VirtualBox and click Properties.
Under Account Properties, select the User Privileges tab.
Check the “Use VirtualBox” box and select OK.
Now we need to make a few tweaks to some start-up scripts. Load a terminal window. Type:
sudo gedit /etc/init.d/mountdevsubfs.sh

The text editor will load and display the mountdevsubfs.sh script. At the end of the do_start () function, put in the following lines:
mkdir -p /dev/bus/usb/.usbfs--
domount usbfs "" /dev/bus/usb/.usbfs usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount rbind /dev/bus/usb /proc/bus/usb
If you can’t find where to put it just make it look like the picture below.
Save it and exit out of the text editor. Go back to the terminal windows and type:
cat vbox /etc/group

Make note of the line that contains “vboxusers”. Remember the number that is contained within the line. In this case its 126. This is our group ID
Now type:
sudo gedit /etc/fstab

The text editor should come back up. Go to the very end of the text and press Enter to create a new line.
Add the text:
none /proc/bus/usb usbfs devgid=126,devmode=664 0 0

Take notice of the segment “devgid=126”. 126 is the group ID from the previous step. When setting this up for yourself, change this to reflect your situation. If your group ID is 150 when you type cat vbox /etc/group, then devgid=150 in the following step.
Save and then exit the text editor. Back at the terminal type:
sudo gedit /etc/init.d/mountkernfs.sh

This is the third and final file we need to edit. Enter in the following text:
## Mount the usbfs for use with Virtual Box
domount usbfs usbdevfs /proc/bus/usb -onoexec,nosuid,nodev,devgid=126,devmode=664
It must be entered right above the section labled # Mount spufs, if Cell Broadband Processor is detected

Again save and exit the text editor. Reboot Ubuntu.
Now we should be ready to connect a USB device to the virtual machine. Pick a usb drive and plug it in. If Ubuntu automatically mounts it, dismount it, but leave it plugged in.
Load up VirtualBox, and go to the Settings for the virtual machine as in the last tutorial.
Go to the USB tab in the settings, of to the right is several icons. The second one has a green plus. Click on it and it should show any USB devices you have plugged, mounted or not. Select the one you want to use under the VM and it will add it to the large box in the middle. Make sure all the check boxes are checked. It should end up looking like below.
Now, next time when the virtual machine is loaded, it should load the connected USB device to the virtualized operating system.
If you are still having problems, double check the files that were edited to match what’s shown here. I had to do a lot of researching to find out what was consistent among the various tutorials out there. These instructions will probably only work properly with the Intrepid Ibex version of Ubuntu. If you are using VirtualBox on Windows XP, I had no trouble getting USB to work right off the bat. Haven’t had the opportunity to run it on a Mac so I can’t say what issue there might be. Regarding other flavors of Linux, check with the VirtualBox support pages to see what kind of configuration changes you may need to make.
References:
Ubuntu Unleashed: Howto – Install VirtualBox in Ubuntu Hardy Heron with USB Support in 5 easy Steps!















