VirtualBox 2: How To Pass Through USB Devices To Guests On An Ubuntu 8.10 Host

Version 1.0
Author: Falko Timme

This short guide shows how you can pass through USB devices (such as a USB flash drive) to VirtualBox guests on an Ubuntu 8.10 VirtualBox 2 host. USB support is available only in the VirtualBox PUEL (closed-source) edition, not in the OSE edition, so make sure you have the PUEL edition installed.

I do not issue any guarantee that this will work for you!

 

1 Preliminary Note

As I mentioned in the introduction, USB support is available only in the closed-source edition of VirtualBox 2, so please make sure you have that version installed, for example as shown in this tutorial: Installing VirtualBox 2.0 On An Ubuntu 8.10 Desktop. USB support won't work if you're using the OSE version that is available in the Ubuntu repositories!

I'm using a USB flash drive in this tutorial to show how USB support works, and I have an Ubuntu 8.10 guest where I want to use that USB flash drive.

Other tutorials on the net (like this one) might tell you that you have to edit /etc/init.d/mountdevsubfs.sh and /etc/udev/rules.d/40-basic-permissions.rules to make USB support work; I found that USB support works without these changes (maybe because I'm using a newer VirtualBox version?).

 

2 Enabling USB Support For A Guest

Before you power on the guest, go to the Details tab of that guest in VirtualBox and click on USB:

Select Enable USB Controller and Enable USB 2.0 (EHCI) Controller and click on OK:

 

3 Using USB Devices In The Guest

Now plug in your USB device (e.g. your USB flash drive). Its icon should appear on the host desktop. Then power on the guest:

After the guest has started, right-click on the USB icon in the VirtualBox "task bar" and select the USB device that you want to use in the guest:

After a few seconds, the icon of the device should disappear from the host desktop and reappear on the desktop of the guest:

You can now work with the USB device in the guest.

One important thing to note is that if you write to the USB device, please unmount it properly before you deattach it from the guest and reattach it to the host because otherwise your changes will be lost. (Instead of unmounting the device manually, you can also shut down the guest - this will also unmount the USB device.)

If you want to reattach the USB device to the host, right-click on the USB icon again in the VirtualBox "task bar" and select the USB device (please make sure you've unmounted it - see my previous note!). (Another way to reattach the USB device to the host is to simply shut down the guest.)

After a few seconds, the icon of the USB device disappears from the guest desktop and reappears on the host desktop:

 

Share this page:

8 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: altair4

Actually, if all you need is access to a usb mass storage device ( sorry no usb webcam ) you can easily do that with the OSE version. If linux is the host simply add another shared folder to the host's /media directory. When you insert a usb device it is automatically  mounted to  /media on the host and visible  to the guest through the shared folder.

The advantage is that the host is always in control of the device and the system and the user never gets confused over when or if and by whom the device was unmounted. I haven't figured out yet how to do that on a Windows host.

By: diverbelow

This I've known with the latest version of VB.  I also found great success of adding a line in fstab for VB:

none /proc/bus/usb usbfs devgid=500,devmode=664 0 0

You might be asking why I had great success by adding that line, well I bought my parent TomTom 130 for a present and they are running Hardy (at that time), and when I updated the device I was using Ubuntu 8.10 and Windows XP was able to see the GPS. So when I gave them their present, their VB Windows XP did not see their GPS, so I did a fresh install of Ubuntu 8.10 and when I attached their GPS to VB Windows XP, XP did not see the device. So I remembered what I added that entry into fstab, so I ssh into my machine and copied that line to my parent machine and their VB saw their GPS device.

Hope this helps people.

By: Frank

The key to this issue, not just for webcam but other devices too, is this line in your /etc/fstab:

 

none /proc/bus/usb usbfs devgid=500,devmode=664 0 0 

 

The devgid has to match your gid of your vboxusers group. For some reason the gid changed on my system, I don't know how or why but I suspect it was part of the numerous updates that vbox urges you to do. If you need to change this value a reboot of your host will likely be required due to proc/bus/usb being busy.

 

BTW, the fstab entry was done by the installation script so there is no longer a need to insert it manually.

By: Scormen

Nice howto, thanks.

But, it is still not possible to use the webcam, is there a method to slove that problem?

Greetz,
Kris

By: Anonymous

I am running a Windows XP virtual machine on a Ubuntu Karmic host.  Your solution does not work.  You say, "After the guest has started, right-click on the USB icon in the VirtualBox "task bar" and select the USB device that you want to use in the guest," but the mass storage USB device is grayed out (its listed, but grayed out), and cannot be selected.  And, yes, I am part of the vboxusers group.

By: Anonymous

If the devices are greyed out, be sure to add your user in the group vboxuser.  After your next logon everything will be working.

By: Lou Manuso

I'm having a problem accessing a usb stick in Windows 10 using VB  with Linux.  I have noted my hardware and software below and a description of the problem.Acer E1-572-6829 laptop i5 processor, 1.6gHz processor, 6GB ram, 1TB SS HD. Running Linux Mint Tessa 19.1 with all updates, VB 6.0.6, with Guest additions and Extension pack of the same version with Windows 10 professional. As distros for VB have been noted as not supporting usb, I downloaded the above VB, Guest additions and the Extension pack for the VB website.I have clicked added myself in Users and Groups>VBoxusersI can register the usb stick, I can see it in the Guest OS and select it on the devices>usb.  When I select it caja (linux filemanager) stops displaying it as available and I hear a tone that the management of the stick has changed to VB.  However I can not see it in Windows file manager. The reverse is also true, I can de-select it and caja will display the stick, which I can access.In the past (earlier version of VB and windows - not sure of either or if they were even on this laptop) when I clicked on the usb stick I would hear the tone, linux file manager would give up control and I would see the stick in windows filemanager.Any help would be appreciated.Thanks,Lou

By: Lou Manuso

Update to usb issue I wrote about earlier today.

I changed from usb 1 to usb 2 and it is working like I would have expected. Note: this has to occur prior to executing VB guest system.

So the issue is resolved, hopefully this resolution may help some others.

Thanks for having a site to help out and the abiltiy to comment.

Best,

Lou