USB with VirtualBox on Fedora 9

Enabling USB support in VirtualBox on a Fedora host is rather easy, just follow these steps.

Create a group called usb

In F9 that is [System->Administration->Users and Groups] Click the groups tab and click the add group icon. Enter the group name usb and note the group id being assigned (usually something like 502).

Modify /etc/fstab (as root)

Modify /etc/fstab adding the line (this assumes the group id of 502, replace with the correct id):

none /sys/bus/usb/drivers usbfs devgid=502,devmode=664 0 0

Remount file systems

You can either reboot or run the following command to make the fstab changes take effect (as root):

mount -a

Start VirtualBox

Start VirtualBox and you should now be able to activate USB devices using the USB icon in the lower right of the VM window.

take this info into account

in terminal type:

"getent group vboxusers"

and put outcome number "ppp" from vboxusers:x:ppp: to "devgid=ppp"

enjoy!

correction

Your instructions do not quite work as written. I'm guessing that's because you would have to make yourself a member of the usb group after creating it. But you don't need to create a new group - VirtualBox creates a new group vboxusers. So the simplest solution is to add yourself to the vboxusers group, then use the gid of vboxusers (typically 501). So you would add the line

none /sys/bus/usb/drivers usbfs devgid=501,devmode=664 0 0

to /etc/fstab (assuming the gid of vboxusers is 501). I added the line at the end. The fstab man page says the order matters, I don't know if putting it anywhere else would be harmful.

Edit:

I found that when VirtualBox gets access to USB devices, Fedora doesn't get access back when the guest OS shuts down, unless the devices are unplugged and then plugged back in. This is true even if one takes the shortcut of just running VirtualBox as root.

I would expect that you could

I would expect that you could use Virtual Box to disconnect the USB device from the guest. I find doing this gives access back to the host.

Using Fedora 10 with

Using Fedora 10 with VirtualBox 2.0.6, I now find that the host is getting access to USB devices back when the guest exits.