Saturday, 24 May 2008

Installing and enabling USB devices for Windows XP in Virtualbox on Ubuntu

After countless experiments in Ubuntu to enable USB devices to work with my Windows XP virtual machine inside of virtualbox, I finally discovered the right steps and would like to share them with you. I'll assume that Virtualbox is working for you and that you already have added the vboxusers group. For the steps in this tutorial to work, I would recommend that you use the latest version of Virtualbox which was 1.6 at the time of writing this blog post.

Go to the Preferences > Users and Groups option to find the vboxusers id for your username. Write down the number (you'll need it later on). In my case, the number was 124, in your case it might be different.

Use gedit to edit the following file in order to remove comments and enable a piece of code. Enter the following command in the terminal,

sudo gedit /etc/init.d/mountdevsubfs.sh

After entering the file, uncomment the lines which follow the line Magic to make /proc/bus/usb work. You uncomment by removing the # from the line's beginning but keep the line # Magic ….commented

After saving and closing the file, enter the following command in the terminal,

usbfs /proc/bus/usb usbfs devgid=124, devmode=0666 0 0

The devgid is the number you noted earlier from your vboxusers group id. In my case, it was 124, so that's why I have devgid=124, in your case it might be some other number instead.

Reboot your system.

Open up virtualbox and go to the settings and enable the usb filters for your attached usb devices. (Note that you need to have the usb devices attached in order for them to be visible to the virtualbox usb filter). Also tick the usb controller and the usb 2.0 controller checkboxes and apply the settings.

Start up your virtualbox windows XP installation and you'll notice that it picks up your USB devices. Also note that if Windows XP is using the usb device, then ubuntu will no longer be able to access it until you shutdown virtualbox and exit the virtual machine.

Tags: , , , , ,

No comments: