41

I cannot see any USB devices within my VirtualBox guest VMs from my host. How do I enable access for my guest VMs?

                               ss of missing USB devices

slm
  • 369,824

5 Answers5

56

In order to enable access to these devices you'll need to add your username to the group vboxusers.

$ sudo usermod -a -G vboxusers <username>

Example

$ sudo usermod -a -G vboxusers saml

You can confirm the change afterwards:

$ groups saml
saml : saml wheel vboxusers wireshark

After doing the above you'll want to logout and log back in, so that for the newly added group to get picked up by your user account. Then from the VirtualBox GUI you'll be able to right click on the USB icon in the lower right group of icons, and select whatever USB devices you want to give control over to your running guest VM.

                              ss of VB

Detecting USB devices

You can use VirtualBox's little known command line tool VBoxManage to list out the USB devices that are accessible. This is a good way to also confirm that the group addition made above to your username are being picked up correctly.

Example

without group

$ VBoxManage list usbhost
Host USB Devices:

<none>

with group

$ VBoxManage list usbhost | head -19
Host USB Devices:

UUID:               abcd1234-123a-2345-b1e0-8a0b1c1f2511
VendorId:           0x046d (046D)
ProductId:          0x0809 (0809)
Revision:           0.9 (0009)
SerialNumber:       ABC34567
Address:            sysfs:/sys/devices/pci0000:00/0000:00:12.2/usb1/1-4//device:/dev/vboxusb/001/004
Current State:      Busy

UUID:               d2abc46d-123-1234-b8c3-691a7ca551ce
VendorId:           0x046d (046D)
ProductId:          0xc504 (C504)
Revision:           19.16 (1916)
Manufacturer:       Logitech
Product:            USB Receiver
Address:            sysfs:/sys/devices/pci0000:00/0000:00:12.0/usb3/3-3//device:/dev/vboxusb/003/003
Current State:      Busy
...

References

tshepang
  • 65,642
slm
  • 369,824
  • And before that you need to make sure that you have the host and guest support for USB. Do all distributions use a vboxusers group? – Gilles 'SO- stop being evil' May 14 '14 at 22:58
  • @Gilles - yes the group is specific to virtualbox. Ubuntu shows the same method here: https://help.ubuntu.com/community/VirtualBox/USB – slm May 15 '14 at 00:44
  • @Gilles - FYI, I just confirmed this on Ubuntu as well. When you say host/guest support for USB do you mean within the guest's settings, enabling the USB controller? – slm May 15 '14 at 00:54
  • @CodeMed - sorry I have no access to Windows 8.1. – slm Jun 22 '15 at 22:35
  • @CodeMed - VBoxManage isn't its own RPM that you install like that, it's part of another RPM. Do a repoquery -qf */VBoxManage to find out what package it's included in and do a yum install X of that package instead. – slm Jun 23 '15 at 04:18
  • @CodeMed - that means that none of the repos you have access to have VirtualBox (as an RPM) available. I typically do something like this on CentOS/Fedora: http://www.if-not-true-then-false.com/2010/install-virtualbox-with-yum-on-fedora-centos-red-hat-rhel/. – slm Jun 23 '15 at 18:31
  • @CodeMed - Sorry you confused me when you were attempting to install it w/ yum install VboxManage. If your issue is w/ Windows 8.1 + VirtualBox that isn't really on-topic on this site, it should be asked on Super User. – slm Jun 24 '15 at 01:18
  • Thank you for letting me know. I deleted my comments above to keep this clean. – CodeMed Jun 24 '15 at 01:31
  • 1
    Still perfectly working with Ubuntu LTS 14.04 and VirtualBox 4.3.36. Under Ubuntu (and not only I suppose) it is possible to do even sudo adduser USERNAME vboxusers to add USERNAME to the vboxusers group as suggested by the same second link slm provided. (Syntax adduser [options] user group), – Hastur May 20 '16 at 16:29
  • Are these commands to be run on the guest or the host? – Brent Bradburn May 13 '17 at 04:55
  • @nobar - which commands specifically are you referring to? – slm May 13 '17 at 04:57
  • I was assuming that they were all to be executed from the same place, it just wasn't clear which place. I'm particularly interested in sudo usermod. – Brent Bradburn May 13 '17 at 05:03
  • @nobar - yes the commands in my answer were all run on the physical host, not inside the VM. – slm May 13 '17 at 05:05
  • 2
    Just want to add this still works perfectly with Ubuntu LTS 16.04 (as host) and VirtualBox 5.1.22 – EricC Jul 16 '17 at 21:42
  • your "without group" example is how my googling brought me to this perfect answer. Way to make it both directly to the point /and/ thorough! – TheGrimmScientist Aug 23 '17 at 00:11
  • I see my USB in dmesg --follow when attached but not in VBocManage list usbhost :( – Vitaly Zdanevich Apr 07 '18 at 07:28
  • I found that VBoxManage list usbhost shows my USB only with sudo. – Vitaly Zdanevich Apr 07 '18 at 07:41
  • dont forget restart the user logout and enter again later for make this command – jonathan Sep 12 '21 at 04:32
0

I changed the following and that worked for me

Make sure that the extension pack is installed In VirtualBox in the settings of the VM Go to Ports and then to USB (based on a Macbook) Enable USB controller Enable USB 2.0 controller And this did the trick: add an empty filter (on the right there's a button for it)

Without the empty filter USB was not recognized in the VM But once I added an empty filter USB works fine now.

Alex
  • 1
0

This may be useful sometimes. Though not related directly to the question above, this may be a follow up issue once USB is detected in VirtualBox but not shown in guest os.

I followed many blogs to make my USB enabled on Virtual Box (~5.0.28?) on Mac for Windows 7 Pro.

Things that I did but USB not detected

1.I did install the same compatible extension pack for USB for virtualbox 2. Enabled USB 3.0 in Virtual Box Manager (Tried 2.0 though I was sure I had 3.0 port/usb) 3. Ejected USB from native OS (Mac OSX) 4. Tried with enabling filter from Virtual Box Manager (also tried to manually select the USB from the usb listed at the bottom of virtual box) 5. From Device Manager I tried to detect it but the driver search failed. (Network was working and no firewall)

What worked

  1. Downloaded a lot of intel USB 3.0 drivers. Some failed saying system requirement not met. but 1 of the drivers worked. Installed the driver successfully.

Now my usb was detected (given you did the first part above as well)

NOTE: I also installed VirtualBox Guest Additions for share between mac/windows but don't think its related.

slm
  • 369,824
Dexters
  • 101
0

Try this..I'm using Fedora 25 as virtual guest in VirtualBox v 5.1.16.

At guest OS terminal ..

[root@localhost]# dnf install fedora-upgrade
[root@localhost]# dnf upgrade
[root@localhost]# dnf update kernel*
[root@localhost]# dnf install gcc kernel-devel kernel-headers dkms make bzip2 perl
[root@localhost]# reboot

Then install VirualBox Guest additions, log off and log in back.

USB is able to detect for me after executing below command at admin prompt:

[root@localhost]# usermod -a -G vboxsf <User Name>
[root@localhost]# dnf clean all

Then log off and log in back, And navigate to menu bar Devices -> USB -> add USB by selecting

Sometimes a Reboot of guest OS may require..

0

The suggestion in the comment by Vitaly Zdanevich (Apr 7 '18 at 7:41) below the accepted answer works for me:

I found that VBoxManage list usbhost shows my USB only with sudo.

After installing the extension pack sudo apt install virtualbox-ext-pack for USB2/USB3 support and launching VirtualBox with sudo and user environment shows the available USB devices in preferences and VM window menu.

sudo -i -u $user virtualbox

Replace $user with your user name.

For detailed information about detected host USB devices type sudo vboxmanage list usbhost.

mac
  • 1