Tag/tag.png

Content Cleanup Required
This article should be cleaned-up to follow the content standards in the Wiki Guide. More info...

Set up USB for Virtualbox

Note: There is no longer a "pay" version for individual copies/licenses of VirtualBox. For more information please see: http://www.virtualbox.org/wiki/Licensing_FAQ

For Saucy 13.10

Tested on Vbox 4.3

Terminal command:

sudo adduser yourusername vboxusers

You HAVE to logout/login from your session, NOT just restart Virtual Box, after the group change.

For Precise Pangolin 12.04

This was tested with VBox 4.1.12-Ubuntu_r77245 (Ubuntu Reps) with Matching Extensions, and Guest Additions.

Add yourself to the user group vboxusers.

However the Manage Groups Applet is no longer installed in 12.04 by default.

Open Software Centre, Search "Gnome-System-Tools" and install.

Tap Super Key to get the Dash, Type "user" and click the Users and Groups icon to start up the Groups Manager. Click "Manage Groups", find vboxusers, click properties, add your own and any other desired users to the vboxusers group.

Click OK.

Now log out and back in, to make use of available USB devices. Connect USB Devce(s)

FOR PERSISTENT CONNECTION TO VM

Open VBox, go to Settings for the VM, Go to USB.

Click USB+ Icon and select device from List (Be careful not to select your mouse device)

This will add a Filter Spec to the List, repeat as necessary for more devices

Start VM - Devices should appear in Guest OS, and mount or request drivers etc as normal for the OS.

Devices Mounted in Guest OS will likely be unavailable in Host OS

FOR TEMPORARY CONNECTION TO VM

Insert USB Device & Wait for it to activate in Host OS

Start or go to VM

Right Click USB Icon in the VM Status Bar at bottom of screen, OR from Menu go Devices > USB Devices, and select desired device.

Devices should appear in Guest OS, and mount or request drivers etc as normal for the OS.

Devices Mounted in Guest OS will likely be unavailable in Host OS

For Oneiric Ocelot 11.10

Add yourself to the user group vboxusers, then log out and back in, to make use of available USB devices. To do this via the graphical interface, click System Settings/Users and Groups/Manage Groups.

For Natty Narwhal 11.04

Add yourself to the user group vboxusers, then log out and back in, to make use of available USB devices. To do this via the graphical interface, click System Settings/Users and Groups/Manage Groups.

For Maverick Meerkat 10.10

Add yourself to the user group vboxusers, then log out and back in, to make use of available USB devices. To do this via the graphical interface, click in the menu System/Administration/ Users and Groups.

For Lucid Lynx 10.04

Add yourself to the user group vboxusers, then log out and back in, to make use of available USB devices. To do this via the graphical interface, click in the menu System/Administration/ Users and Groups.

For Karmic Koala 9.10

From a terminal run the following command:

  1. Add yourself to the vboxusers group if not already there: -
     if [ "`grep vboxusers /etc/group|grep $USER`" == "" ] ; then sudo usermod -G vboxusers -a $USER ; fi

This works for Karmic 9.10 Host and Windows XP Guest

From a terminal run the following command:

  1. This will check for your vbox group id which you'll need for the next steps. This will display a line that looks a bit like this: vboxusers:x:123:myself 123 is the group id of your machine you're looking for
     grep vbox /etc/group
  2. This will edit your FSTAB File
     sudo gedit /etc/fstab
  3. Add the following line to the bottom of the fstab file: Replace group id with the number displayed in step 1.
     none /proc/bus/usb usbfs devgid=groupid,devmode=664 0 0
    • Example: none /proc/bus/usb usbfs devgid=123,devmod=664 0 0

  4. Reboot Ubuntu 9.10
  5. Once logged into Ubuntu 9.10 start VirtualBox (Don't power on a guest OS yet)

  6. Click Settings from the VirtualBox main page for the Windows XP Guest OS

  7. Click the System tab on the left side of screen
    1. Enable IO APIC is needs to be selected
  8. Click the USB tab on the left side of screen
    1. Enable USB Controller and Enable USB 2.0 (EHCI) Controller need to be selected
    2. Your USB device should be recognized and ticked in the lower screen. If not, press the 'add' button (to the far right, 2nd one with the green cross) and add it.
  9. Power on your Guest OS and USB Should work

For Jaunty Jackalope 9.04

From a terminal run these commands:

  1. Add yourself to the vboxusers group if not already there: -
     if [ "`grep vboxusers /etc/group|grep $USER`" == "" ] ; then sudo usermod -G vboxusers -a $USER ; fi
  2. Enter a root shell, eg
     sudo -i
  3. In that shell, set up /etc/fstab
     vGid="`grep vboxusers /etc/group|cut -d\: -f3`" # Determine the devgid for the vboxusers group
     if [ "$vGid" ] && [ "`grep usbfs /etc/fstab`" == "" ] ; then
            echo "none /proc/bus/usb usbfs devgid=${vGid},devmode=664 0 0" >>/etc/fstab
            mount -a
     fi

Pre-Jaunty

To get USB support, you need the PUEL (non-free) version. Via the GUI, there is an option to enable USB.

Since Gutsy, /proc/bus/usb is not mounted by default. For Gutsy and Hardy you just need to edit /etc/init.d/mountdevsubfs.sh and uncomment the following lines:

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

In Intrepid the lines required to mount usbfs have been removed entirely, so you need to add the following lines to /etc/init.d/mountdevsubfs.sh at the end of the do_start() function. Note that this is subtly different than the lines required for Gutsy/Hardy. the arguments for the domount function are slightly different from previous versions.

        #
        # Magic to make /proc/bus/usb work
        #
        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

Then run the script that you just edited:

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

In order to give users in the vboxusers group write permissions to the devices in /proc/bus/usb, you'll need to edit some rules in /etc/udev/rules.d.

Under Gutsy, edit /etc/udev/rules.d/40-permissions.rules to say the following:

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

Under Hardy and Intrepid, edit /etc/udev/rules.d/40-basic-permissions.rules to say the following:

# USB devices (usbfs replacement)
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664", GROUP="vboxusers"
SUBSYSTEM=="usb_device",                MODE="0664", GROUP="vboxusers"

Then, restart the udev service:

sudo /etc/init.d/udev restart

Now, if you haven't done it already, make sure your user is part of the group vboxusers using the following command:

sudo usermod -G vboxusers -a `whoami`

Finally, log out and login again to apply these changes.

See also: http://www.virtualbox.org/ticket/747

VirtualBox/USB (last edited 2014-01-26 00:29:10 by mike-vorburger)