PhobosK’s Blog

My personal weblog

Howto fix a VirtualBox “Failed to access the USB subsystem” error.


The system configuration is:

  • Gentoo 10.0 (3.6.6-gentoo, SMP, PREEMPT, x86_64)
  • VirtualBox 4.2.4 (app-emulation/virtualbox-bin-4.2.4)
  • KDE v4.9.3

The error is not distro or platform specific though.

Now if you encounter the VirtualBox error:

Failed to access the USB subsystem.
Could not load the Host USB Proxy service: VERR_DISK_FULL.


there could be a couple of reasons. But most often they could be:

  • Permissions problems for accessing the USB filesystem.
    • To check if this is the case try this command as user, and then as root:

VBoxManage list usbhost

If you get the USB devices listed as root but not as user, try to see if the /dev/vboxusb permissions are something like this:

ls -lR /dev/vboxusb/

/dev/vboxusb/:
total 0
drwxr-x— 2 root vboxusers 60 Nov 11 18:07 001
drwxr-x— 2 root vboxusers 40 Nov 11 19:34 003
drwxr-x— 2 root vboxusers 80 Nov 11 18:07 004
drwxr-x— 2 root vboxusers 80 Nov 11 18:07 005

/dev/vboxusb/001:
total 0
crw-rw—- 1 root vboxusers 189, 2 Nov 11 18:07 003

/dev/vboxusb/003:
total 0

/dev/vboxusb/004:
total 0
crw-rw—- 1 root vboxusers 189, 385 Nov 11 18:07 002
crw-rw—- 1 root vboxusers 189, 386 Nov 11 18:07 003

/dev/vboxusb/005:
total 0
crw-rw—- 1 root vboxusers 189, 514 Nov 11 18:07 003
crw-rw—- 1 root vboxusers 189, 515 Nov 11 18:07 004

    • Then make sure that you are in the vboxusers group.
  • Another reason for such an error is almost not commented on any Google resource for the error. And this reason is the limits of inotify that the system implies.
    • Check your limits by:

cat /proc/sys/fs/inotify/max_user_instances /proc/sys/fs/inotify/max_user_watches /proc/sys/fs/inotify/max_queued_events

If you are running at the same time a lot of applications that use inotify (like Amarok, Clementine, Krusader etc.) and meanwhile you start VirtualBox, the probability that the inotify watches per your user to be exhausted is great. And that makes VBox complain and turn off USB support.

    • Another way to check the problem, is as user in one terminal to start:

strace -o /tmp/VBoxSVC.out -f /opt/VirtualBox/VBoxSVC

and then again as user in another terminal to start:

VBoxManage list usbhost

Then go back to the first terminal and Ctrl+C the process. Then open the /tmp/VBoxSVC.out and look for permissions problems or “out of space” problems.

 

So now the fix if the problem is caused by limited inotify handles:

  • Create (as root) an /etc/sysctl.d/inotify.conf file with the following contents:

# VirtualBox tweak for USB to work (defaults are 1/2)

fs.inotify.max_user_instances = 256
fs.inotify.max_user_watches = 16384
fs.inotify.max_queued_events = 32768

  • Do (as root) a:

/etc/init.d/sysctl restart

and you are ready.

  • If for some reason the values above are not enough for you, you may higher them as needed. Look for more info here and here.

 

 

Please feel free to comment 🙂

Advertisements

11/11/2012 Posted by | Linux, Tech, Troubleshooting | , , , , , , | 8 Comments