Page 2 of 2

Re: VirtualBox guest USB inoperative on RHEL 5.5 64-bit host

Posted: 31. Jul 2010, 11:47
by snapshot
Yes, it's a permission problem on /dev/bus/usb

Here is what I did to have my USB devices working :

Code: Select all

cd /dev/bus/usb
sudo chgrp vboxusers -R *
sudo chmod g+rwX -R *
Meaning : giving the full permission to members of vboxusers to /dev/bus/usb. I didn't use "usbusers" because it doesn't exist on my system and I'm lazy to create it.

I think it's more a distro bug than a VirtualBox bug... However, VirtualBox should perform some sanity checks and warn that something may be wrong

Re: VirtualBox guest USB inoperative on RHEL 5.5 64-bit host

Posted: 3. Aug 2010, 02:22
by P2O2
Host: ScientificLinux 5.5
Guest: WinXP SP2

Check this thread:
http://forums.virtualbox.org/viewtopic.php?f=7&t=19955

I have changed the code

Code: Select all

if [ ! -d /proc/bus/usb ]; then
modprobe usbcore >/dev/null 2>&1 && mount -n -t usbfs /proc/bus/usb /proc/bus/usb
else
mount -n -t usbfs /proc/bus/usb /proc/bus/usb
fi
from the thread to the following one:

Code: Select all

if [ ! -d /proc/bus/usb ]; then
modprobe usbcore >/dev/null 2>&1 && mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=502,devmode=664 
else
mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=502,devmode=664
fi
(my VBox GID is 502).

But there is something yet to correct. Not all the time the new USB (pen)drive's icon shows in Total Commander's disk-bar. The "Safety removal" icon is present is system tray and I can remove the USB device but I am not able to use it without rebooting - either VBox or SciLinux - I don't know yet. I have to check it more thoroughly. But USB "half" works. :-(

***********************************************
The next day....

PROBLEM SOLVED! :-)

I'm not casual Windows user so I made an error. I mapped shared folder to E, thinking that Windows automa{t|g}ically would select next letters for its new devices. No way! ;-) USB1 was given E, USB2 F, etc. So, I changed the shared folder letter from E to Z, and all USB devices - I tested pendrive, MP3, and cheap camera - were assigned E, F.. letters and were visible to Total Commander and my Windows system in VBox.

Regards

Re: VirtualBox guest USB inoperative on RHEL 5.5 64-bit host

Posted: 6. Aug 2010, 15:16
by wolfeb
Maybe I missed something, but the suggested solution did not work for me. I'm running VB version 3.2.6 r63112, OSE on a host OS of CentOS 5.5. Initially, the proper USB devices appeared in the Devices menu of the guest OS window, but they were grayed out. However, after making the suggested changes, no devices appear in the menu at all.

Here are the changes:
In /etc/fstab, added the line

Code: Select all

none			/proc/bus/usb		usbfs	devgid=500,devmode=666 0 0
In /etc/rc.d/rc.sysinit, I replaced

Code: Select all

    if [ ! -d /proc/bus/usb ]; then
    modprobe usbcore >/dev/null 2>&1 && mount -n -t usbfs /proc/bus/usb /proc/bus/usb
    else
    mount -n -t usbfs /proc/bus/usb /proc/bus/usb
    fi
with

Code: Select all

vboxusersGID=`awk -F: '/^vboxusers:/{print $3}' /etc/group`
if [ ! -d /proc/bus/usb ]; then
	# modprobe usbcore >/dev/null 2>&1 && mount -n -t usbfs /proc/bus/usb /proc/bus/usb
	modprobe usbcore >/dev/null 2>&1 && mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=${vboxusersGID},devmode=664
else
#	mount -n -t usbfs /proc/bus/usb /proc/bus/usb
        mount -n -t usbfs -o remount,devgid=${vboxusersGID},devmode=664 /proc/bus/usb /proc/bus/usb
fi 
These seem to be the two prevalent results when I search for fixes, so I'm not sure what to try next.

Re: VirtualBox guest USB inoperative on RHEL 5.5 64-bit host

Posted: 8. Aug 2010, 01:36
by P2O2
Hi,

I didn't make any changes to /etc/fstab file. Only those ones I described.

Regards

Re: VirtualBox guest USB inoperative on RHEL 5.5 64-bit host

Posted: 13. Sep 2010, 20:57
by wolfeb
Thanks for the reply.

I've tried both with and without the /etc/fstab changes, with the same results either way, so I'm still lost as to what to try next. Any suggestions would be greatly appreciated...

Re: VirtualBox guest USB inoperative on RHEL 5.5 64-bit host

Posted: 7. Oct 2010, 00:03
by zzz
This comment relates mostly to CENTOS/REDHAT distributions. As mentioned in many previous posts the problem is usually with the permissions on usbfs. Centos mounts the usbfs first thing during boot. Once /proc/bus/ubs is mounted, its permissions cannot (so I have heard) really be changed. Thus, changing fstab or several other suggestions do not seem to work with this operating system. It turns out the the original mount is in /etc/rc.d/rc.sysinit. All you have to do is edit this file and add the group and its permissions to the mount instruction. Here is an example, of the changes where the group id is devgid=501 which is the group id of vboxusers.

In /etc/rc.d, edit rc.sysinit
Replace the two lines
mount -n -t usbfs /proc/bus/usb /proc/bus/usb and
modprobe usbcore >/dev/null 2>&1 && mount -n -t usbfs /proc/bus/usb /proc/bus/usb
With
modprobe usbcore >/dev/null 2>&1 && mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=501,devmode=664
mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=501,devmode=664

Note that you can get the gid of vboxusers by doing "grep vboxusers /etc/group". If it is not 501, then replace 501 with the correct gid. Also, make sure that you are a member of the group: "gpasswd -a youruserid vboxusers"