Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 364719 - app-emulation/virtualbox-4.0.6: errormessage when /proc/bus/usb/* doesn't exist
Summary: app-emulation/virtualbox-4.0.6: errormessage when /proc/bus/usb/* doesn't exist
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-24 21:29 UTC by Sven
Modified: 2011-07-18 07:48 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven 2011-04-24 21:29:14 UTC
I had to enable CONFIG_USB_DEVICEFS in my kernel (I'm using 2.6.38.4). Otherwise, virtualbox would show an error message "Cannot access USB subsystem" whenever I started a vitual machine.

IMHO, the ebuild should check that is is enabled in kernel config and display a warning if it isn't.

Reproducible: Always
Comment 1 Sven 2011-04-25 10:15:09 UTC
Found others who had this problem. They suggest using udev rules:
http://forums.virtualbox.org/viewtopic.php?f=1&t=40922&start=15#p184306

However, Gentoo doesn't install any udev rules.
Comment 2 Silvio 2011-04-26 16:04:25 UTC
Same problem here:
emerge --info
Portage 2.1.9.46 (default/linux/amd64/10.0/desktop/kde, gcc-4.5.2, libc-0-r0, 2.6.38-gentoo-r3 x86_64)
=================================================================
System uname: Linux-2.6.38-gentoo-r3-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T7700_@_2.40GHz-with-gentoo-2.0.2
Timestamp of tree: Mon, 25 Apr 2011 18:15:01 +0000
ccache version 3.1.4 [enabled]
app-shells/bash:     4.2_p8
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.7.1-r1, 3.1.3-r1
dev-util/ccache:     3.1.4
dev-util/cmake:      2.8.4-r1::maggu2810-overlay
sys-apps/baselayout: 2.0.2
sys-apps/openrc:     0.8.2::pentoo
sys-apps/sandbox:    2.5
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1-r1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.2.4-r1, 4.5.2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4-r1
sys-devel/make:      3.82
sys-kernel/linux-headers: 2.6.38
virtual/os-headers:  0
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs ccache distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS=" http://mirror.ovh.net/gentoo-distfiles/ http://ftp.heanet.ie/pub/gentoo/ http://mirror.ovh.net/gentoo-distfiles/ http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/ rsync://rsync3.it.gentoo.org/gentoo-sources/ ftp://ftp.unina.it/pub/linux/distributions/gentoo/"
LANG="it_IT"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="it en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/sunrise /var/lib/layman/bangert /var/lib/layman/maggu2810-overlay /var/lib/layman/voyageur /var/lib/layman/belak /var/lib/layman/pentoo /usr/portage/local/manual"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3ds 64bit X a52 aac aalib acl acpi aiglx akode alias alsa amd64 amr ao apache apm audiofile autoreplace autotrace avahi avi bash-completion berkdb bitmap-fonts bluetooth bmp branding browserplugin bzip bzip2 cairo cdaudio cdr cli clucene connectionstatus consolekit contactnotes cracklib crypt cups cvd cvs cxx dbus dia dialup djvu dri dts dv dvd dvdr dvdread dynamicplugin ebook emboss encode ethereal exif fam fat ffmpeg firefox flac fluidsynth fontconfig foomaticdb fortran freetds gdbm gdu geolocation gif gimp git glib glitz gnutls gphoto2 gpm gps gpu groupwise gtk highlight history hvm i8x0 iconv icu ieee1394 imagemagick innodb iphone ipod ipv6 irc ithreads jack java javascript jingle jpeg jpeg2k kde kerberos kontact kqemu lame laptop lcms ldap libnotify lm_sensors lucene m4a mad mbrola mdb mdnsresponder-compat mercurial midi mikmod mime mmx mmxext mng modules moonlight mozilla mp3 mp4 mpeg mpeg2 mplayer mssql mudflap multilib musepack musicbrainz mysql ncurses netmeeting nls nowlistening npt1 nptl nptlonly nsplugin ntfs nvidia odbc ogg openal openexr opengl openipmi openmp oss pam pango pcmcia pcre pda pdf perl phonon plasma pmu png policykit portaudio postgres ppds pppd prelude python python3 qt qt3support qt4 quicktime rar raw rdesktop rdp readline reiserfs reports samba sametime sane scanner sdl semantic-desktop session sip smp sms soundtouch speex spell sse sse2 ssh ssl startup-notification subtitles subversion svg sysfs tcpd texteffect texteffects theora tidy tiff timidity tordns translator truetype truetype-fonts twolame type1-fonts udev unicode usb utempter v4l v4l2 vcd video virtualbox vnc vorbis wav wavpack webkit webpresence wicd wifi win64 winetriks winpopup wlm wmf wxwindows x264 xcb xen xine xml xorg xulrunner xv xvid xvmc yahoo zeroconf zlib" ALSA_CARDS="snd_hda_intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CAMERAS="canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev joystick synaptics wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="it en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia nv vesa nouveau v4l v4l2" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Silvio 2011-04-26 20:19:11 UTC
I tried removing comments in:
/etc/udev/rules.d/10-virtualbox.rules
as emerge of virtualbox-modules says:

SUBSYSTEM=="usb_device", GROUP="vboxusers", MODE="0644"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="vboxusers", MODE="0644"

but it doesn't resolve problem.

I resolved putting deprecated option in kernel:

device drivers -> usb -> deficefs
Comment 4 Sven 2011-04-26 21:29:48 UTC
I should probably mention, that my user is in the usb group (rules in virtualbox-modules udev file are commented out. Note that the udev rules posted in the virtualbox forums do a lot more than those two commented rules installed by virtualbox-modules.) I also tried running virtualbox as root. Still the same error.
Comment 5 Mao PU 2011-05-04 05:19:42 UTC
The problem has been addressed for virtualbox-bin-4.0.4 at http://bugs.gentoo.org/show_bug.cgi?id=356215. The upstream solution is described at http://www.virtualbox.org/ticket/7759#comment:5, Polynomial-C is working on a solution for gentoo.

At the moment you could try to change the permissions of /opt/VirtualBox/VBoxCreateUSBNode.sh to exectuable and try to use the following rules in /etc/udev/rules.d/10-virtualbox.rules :

SUBSYSTEM=="usb_device", ACTION=="add", RUN="/opt/VirtualBox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN="/opt/VirtualBox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
SUBSYSTEM=="usb_device", ACTION=="remove", RUN="/opt/VirtualBox/VBoxCreateUSBNode.sh --remove $major $minor"
SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN="/opt/VirtualBox/VBoxCreateUSBNode.sh --remove $major $minor"
Comment 6 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2011-05-08 16:05:20 UTC
Alright, there are now three new ebuilds in the tree:

  app-emulation/virtualbox-modules-4.0.6-r1
  app-emulation/virtualbox-4.0.6-r1
  app-emulation/virtualbox-bin-4.0.6-r1

They should make new USB handling working out of the box without the need of /proc/bus/usb/* (which is deprecated anyway). Please give this a thorough testing and report back here if it works (I don't use USB in my VMs so I cannot test it).
Comment 7 Silvio 2011-05-09 08:19:07 UTC
(In reply to comment #6)
> Alright, there are now three new ebuilds in the tree:
> 
>   app-emulation/virtualbox-modules-4.0.6-r1
>   app-emulation/virtualbox-4.0.6-r1
>   app-emulation/virtualbox-bin-4.0.6-r1
> 
> They should make new USB handling working out of the box without the need of
> /proc/bus/usb/* (which is deprecated anyway). Please give this a thorough
> testing and report back here if it works (I don't use USB in my VMs so I cannot
> test it).

Nothing. Same problem.

I tried compiling kernel without:

device drivers -> usb support -> USB device filesystem (DEPRECATED)

and it has the same problem. No USB found even with the new ebuild.
Comment 8 Justin Lecher (RETIRED) gentoo-dev 2011-05-09 08:26:44 UTC
Same here
Comment 9 nE0sIghT 2011-05-09 10:32:43 UTC
From /var/log/messages:
udevd[2052]: exec of program '/opt/VirtualBox/VBoxCreateUSBNode.sh --remove 189 141' failed

/opt/VirtualBox/VBoxCreateUSBNode.sh has 644 permissions but it need to be 744
Comment 10 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2011-05-09 15:20:31 UTC
Alright, this can be caused by two different errors.

If you're using virtualbox-bin please make sure that the file

  /opt/VirtualBox/VBoxCreateUSBNode.sh 

has permissions root:vboxusers 0750 either by setting it manually or by re-syncing your portag-tree and re-emerging app-emulation/virtualbox-bin


If you're using virtualbox (the source package) please make sure that the file

  /lib/udev/VBoxCreateUSBNode.sh 

has permissions root:vboxusers 0750 either by setting it manually or by re-syncing your portag-tree and re-emerging app-emulation/virtualbox



IF THAT DOESN'T HELP, please make sure that your kernel has

  CONFIG_USB_DEVICEFS 

being _unset_! This is necessary or else virtualbox still tries to access USB the old way which I don't want to support for security reasons.
Comment 11 Justin Lecher (RETIRED) gentoo-dev 2011-05-09 15:23:40 UTC
 ll /lib/udev/VBoxCreateUSBNode.sh 
-rwxr-xr-x 1 root root 1.4K May  8 18:35 /lib/udev/VBoxCreateUSBNode.sh*
Comment 12 Justin Lecher (RETIRED) gentoo-dev 2011-05-09 15:23:45 UTC
 ll /lib/udev/VBoxCreateUSBNode.sh 
-rwxr-xr-x 1 root root 1.4K May  8 18:35 /lib/udev/VBoxCreateUSBNode.sh*
Comment 13 Justin Lecher (RETIRED) gentoo-dev 2011-05-09 15:23:50 UTC
 ll /lib/udev/VBoxCreateUSBNode.sh 
-rwxr-xr-x 1 root root 1.4K May  8 18:35 /lib/udev/VBoxCreateUSBNode.sh*
Comment 14 Reid 2011-05-10 14:11:49 UTC
The only guest that I have that will not recognize USB devices are Windows 7 and Windows Vista.  All XP and Linux guest recognize any USB device I insert.  I no longer get the "Cannot access USB subsystem" message.  Both Windows 7 and Vista fail when installing the drivers for USB Mass storage devices.


ottembomb@fragtastic ~ $ cat /usr/src/linux/.config | grep CONFIG_USB_DEVICEFS
# CONFIG_USB_DEVICEFS is not set

ottembomb@fragtastic ~ $ ls -lh /lib/udev/VBoxCreateUSBNode.sh 
-rwxr-x--- 1 root vboxusers 1.4K May  9 18:45 /lib/udev/VBoxCreateUSBNode.sh
Comment 15 Silvio 2011-05-10 14:18:21 UTC
(In reply to comment #10)

I have 64 bit system. All files are set as you said: 0750

#ll /lib/udev/VBoxCreateUSBNode.sh 
-rwxr-x--- 1 root vboxusers 1372  9 mag 23.11 /lib/udev/VBoxCreateUSBNode.sh

# ll /lib64/udev/VBoxCreateUSBNode.sh 
-rwxr-x--- 1 root vboxusers 1372  9 mag 23.11 /lib64/udev/VBoxCreateUSBNode.sh

But still with the Kernel option CONFIG_USB_DEVICEFS (DEPRECATED) on "no" I cannot see USB in Virtual Machine (XP).

I have to put in Kernel:

CONFIG_USB_DEVICEFS (DEPRECATED) on yes

device drivers -> usb support -> USB device filesystem (DEPRECATED) (*)

and USB reappers in Virtual Machine.





> Alright, this can be caused by two different errors.
> 
> If you're using virtualbox-bin please make sure that the file
> 
>   /opt/VirtualBox/VBoxCreateUSBNode.sh 
> 
> has permissions root:vboxusers 0750 either by setting it manually or by
> re-syncing your portag-tree and re-emerging app-emulation/virtualbox-bin
> 
> 
> If you're using virtualbox (the source package) please make sure that the file
> 
>   /lib/udev/VBoxCreateUSBNode.sh 
> 
> has permissions root:vboxusers 0750 either by setting it manually or by
> re-syncing your portag-tree and re-emerging app-emulation/virtualbox
> 
> 
> 
> IF THAT DOESN'T HELP, please make sure that your kernel has
> 
>   CONFIG_USB_DEVICEFS 
> 
> being _unset_! This is necessary or else virtualbox still tries to access USB
> the old way which I don't want to support for security reasons.
Comment 16 giovanni.bobbio 2011-05-10 14:31:47 UTC
(In reply to comment #10)

xxxxx ~ # equery list virtualbox
 * Searching for virtualbox ...
[IP-] [  ] app-emulation/virtualbox-4.0.6-r1:0

xxxxx ~ # ls -la /lib/udev/VBoxCreateUSBNode.sh
-rwxr-x--- 1 root vboxusers 1372 May 10 11:34 /lib/udev/VBoxCreateUSBNode.sh

xxxxx ~ # zgrep USB_DEVICEFS /proc/config.gz 
# CONFIG_USB_DEVICEFS is not set

xxxxx ~ # uname -a
Linux xxxxx 2.6.38-gentoo-r4 #1 SMP Mon May 9 09:52:43 CEST 2011 i686 Intel(R) Core(TM) i7 CPU M 620 @ 2.67GHz GenuineIntel GNU/Linux

VirtualBox "Cannot access USB subsystem"
Comment 17 Justin Lecher (RETIRED) gentoo-dev 2011-05-10 14:33:53 UTC
Please check whether you still have

/etc/udev/rules.d/10-virtualbox.rules.

If so, please remove and run

udevadm control --reload-rules && udevadm trigger --subsystem-match=usb

This help me to gain a /dev/vboxusb directory.
Comment 18 giovanni.bobbio 2011-05-10 14:41:34 UTC
(In reply to comment #17)
> Please check whether you still have
> 
> /etc/udev/rules.d/10-virtualbox.rules.
> 
> If so, please remove and run
> 
> udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
> 
> This help me to gain a /dev/vboxusb directory.

I have no such rules file and I have a /dev/vboxusb directory like this:

xxxxx ~ # ls -laR /dev/vboxusb/
/dev/vboxusb/:
total 0
drwxr-x---  4 root vboxusers   80 May 10 14:00 .
drwxr-xr-x 18 root root      4380 May 10 14:01 ..
drwxr-x---  2 root vboxusers  100 May 10 14:00 001
drwxr-x---  2 root vboxusers   80 May 10 14:00 002

/dev/vboxusb/001:
total 0
drwxr-x--- 2 root vboxusers    100 May 10 14:00 .
drwxr-x--- 4 root vboxusers     80 May 10 14:00 ..
crw-rw---- 1 root vboxusers 189, 2 May 10 14:00 003
crw-rw---- 1 root vboxusers 189, 3 May 10 14:00 004
crw-rw---- 1 root vboxusers 189, 4 May 10 14:00 005

/dev/vboxusb/002:
total 0
drwxr-x--- 2 root vboxusers       80 May 10 14:00 .
drwxr-x--- 4 root vboxusers       80 May 10 14:00 ..
crw-rw---- 1 root vboxusers 189, 130 May 10 14:00 003
crw-rw---- 1 root vboxusers 189, 132 May 10 14:00 005

Still, the USB subsystem is invisible to my XP guest.
Comment 19 Silvio 2011-05-10 14:45:24 UTC
(In reply to comment #17)
> Please check whether you still have
> 
> /etc/udev/rules.d/10-virtualbox.rules.
> 
> If so, please remove and run
> 
> udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
> 
> This help me to gain a /dev/vboxusb directory.

It worked for me! :)
Thanks
Comment 20 Carlos Silva 2011-05-12 01:09:07 UTC
The -r1 version works here.
Comment 21 Sven 2011-05-18 14:53:36 UTC
Since I'm the reporter, I should probably comment:
bug is gone, works for me with recent ebuilds.
Comment 22 zjttyl 2011-05-19 06:19:37 UTC
works under guest XP, but does not work under guest Win7
Comment 23 Sven 2011-05-19 09:16:32 UTC
(In reply to comment #22)
> works under guest XP, but does not work under guest Win7

This bug is about, whether the list of USB devices is available at all in virtualbox or not. It is not about, whether USB actually works inside the guest.
Comment 24 Collin Day 2011-05-25 04:42:54 UTC
Hi all,

Just a quick question - running:

udevadm control --reload-rules && udevadm trigger --subsystem-match=usb

works, but I have to do it every time I reboot - the VBoxCreateUSBNode.sh does not run, even though it has approprite permissions:

-rwxr-x---  1 root vboxusers     1408 May 19 22:11 VBoxCreateUSBNode.sh

Could someone tell me how to make this all work at boot or point me in the right direction?  Thanks!
Comment 25 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2011-07-18 07:48:42 UTC
Marking this bug as fixed. 

@ Collin: I suppose you're having problems with udev not executing the script when necessary, This is no problem of the virtualbox package.