USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Discussions related to using VirtualBox on Linux hosts.
DrMartinus
Posts: 23
Joined: 25. Feb 2008, 08:08

USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Post by DrMartinus »

Hi,

I'm running 64-bit OpenSuse 11.1 and tried with the 2.2.4 and 3.00 version of VBox, but both don't want to allow me access to more than the printer which is connected to the USB. And while the printer is hooked to the VBox, it's not available in the host system.
I can see all the USB-devices when I do a right click on the USB-icon on the lower left edge of the VB window, but only the first one, i.e. the printer, can be connected, the other three (which I actually need) are greyed and I can't connect or enable them (in that case, a tickmark would appear to the left).
So VBox can see all my USB-devices, but only connect to one of them. I formerly used Mandriva PowerPack 64 bit, but had too many problems. Under Mandriva, all devices were seen just fine. OpenSuse is a clean install, no upgrade. I used the VBox 64-bit rpm for OpenSuse 11.1.

I have no clue. What could be wrong? :?:
hank_se
Posts: 101
Joined: 16. Apr 2009, 11:36
Primary OS: openSUSE
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: windows xp

Re: USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Post by hank_se »

Try adding /etc/udev/rules.d/11-vboxdrv.rules with the following content:
KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0600"
SUBSYSTEM=="usb_device", GROUP="vboxusers", MODE="0664"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="VirtualBox/$env{BUSNUM}/$env{DEVNUM}", GROUP="vboxusers", MODE="0664"
Reboot and be sure to not mount usbfs under /proc/bus/usb, no need to do that!
DrMartinus
Posts: 23
Joined: 25. Feb 2008, 08:08

Re: USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Post by DrMartinus »

Ok, ....
now I can't connect to my printer (and other USB-devices) under OpenSuse, but I can connect to all USB devices under VBox.
Interesting these dynamics, but I don't understand it. I re-enabled the usbfs entry in fstab, but that didn't bring the printer back. The problem exists irrespective of VBox running or not.
hank_se
Posts: 101
Joined: 16. Apr 2009, 11:36
Primary OS: openSUSE
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: windows xp

Re: USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Post by hank_se »

Looks as if you don't have a default rule for USB. Do you have the file /lib/udev/rules.d/50-udev-default.rules and does it have an entry like this:
# libusb device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"
DrMartinus
Posts: 23
Joined: 25. Feb 2008, 08:08

Re: USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Post by DrMartinus »

Yes, exactly the same line. And I found out that an USB-stick e.g. is being read, but the printer is not useable to OpenSuSe. However, when I check in Yast the hardware information, all details about the printer are in the USB section...
edit:
one more note: I feared that something could be wrong with the printer, but I tried printing from within VBox, and that worked. The situation that OpenSuSe can't access the printer (and scanner) prevails however, even when VBox is not running.
hank_se
Posts: 101
Joined: 16. Apr 2009, 11:36
Primary OS: openSUSE
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: windows xp

Re: USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Post by hank_se »

So it's probably a permission issue under /dev/bus/usb, in the upcoming 11.2 they have changed that entry to this:
# libusb device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0664"
Note the MODE change to 0664, you might try that.
DrMartinus
Posts: 23
Joined: 25. Feb 2008, 08:08

Re: USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Post by DrMartinus »

Tried that, no success. It's so strange. I tried to access the printer as root, also no go (because of suspected rights issues).
I guess it must be related to this line in /etc/udev/rules.d/11-vboxdrv.rules

Code: Select all

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="VirtualBox/$env{BUSNUM}/$env{DEVNUM}", GROUP="vboxusers", MODE="0664"
because that's the only thing that really changed (before, the line looked like this:

Code: Select all

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="vboxusers", MODE="0664"
Does that give any clue?
DrMartinus
Posts: 23
Joined: 25. Feb 2008, 08:08

Re: USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Post by DrMartinus »

Now I set the line back, and it works again. I rather have the printer and scanner working under Linux than the one device that I need to run under Windows in the VBox. But, strange enough: now it seems to work also under VBox. I'm a bit surprised, and amused as well... ;-) Hope it stays that way.
And thanks for all help, i wouldn't have figured that out on my own.
rzaks
Posts: 1
Joined: 16. Oct 2009, 05:39
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, SP2, 32bit

Re: USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Post by rzaks »

This is what worked for me after I upgraded to 3.0.8:

1. I disabled usbfs in /etc/fstab and stopped it from loading in /etc/init.d/boot.local
2. Edited /etc/udev/rules.d/10-vboxdrv.rules
Changed

Code: Select all

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

Code: Select all

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="VirtualBox/$env{BUSNUM}/$env{DEVNUM}", GROUP="vboxusers", MODE="0664"
3. Reboot
kcbehler
Posts: 7
Joined: 18. Oct 2009, 17:22
Primary OS: Solaris
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, openSUSE

Re: USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Post by kcbehler »

After upgrade from 3.0.6 to 3.0.8 USB did not work any more.
I uninstalled Virtual Box completely and reinstalled 3.0.6 again.
USB worked again immediately!

/etc/udev/rules.d/10-vboxdrv.rules from 3.0.6 is:
KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0600"
SUBSYSTEM=="usb_device", GROUP="vboxusers", MODE="0664"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="vboxusers", MODE="0664"

Please let me know what rzaks modification means and why it helps for 3.0.8.
I'm a bit tired to always waste hours to get updates running. :?
hank_se
Posts: 101
Joined: 16. Apr 2009, 11:36
Primary OS: openSUSE
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: windows xp

Re: USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Post by hank_se »

I'll give it a try.

It's quite a mess you see. First, in 3.08 VirtualBox default method for accessing usb has changed from the old usbfs method to the hal-udev method.
Well not exactly, up to 3.06 VirtualBox used usbfs if it was mounted, if not mounted it used the hal-udev method and there was no way for the user to change that inner behavior of VirtualBox, if usbfs was mounted you had to use that method, edit fstab and add a mount command. 3.08 on the other hand uses udev-hal by default, but you as a user can change that by starting VirtualBox with this command:

Code: Select all

VBOX_USB=USBFS VirtualBox
I believe this to be better and more flexible, but surely not all will agree on that.
Actually rzaks step 1:
1. I disabled usbfs in /etc/fstab and stopped it from loading in /etc/init.d/boot.local
isn't needed in 3.08, it will still use the hal-udev method by default.
But step 2:
2. Edited /etc/udev/rules.d/10-vboxdrv.rules
is needed beacause of a conflicting rule in OpenSUSE, that conflict is gone in the upcoming 11.2 realease.

You can also get it working by simply renaming 10-vboxdrv.rules to 60-vboxdrv.rules, but then again there's always the risk that som other program or driver adds another rules file that conflicts with VirtualBoxs rules file, that's basically why I prefer a rule that sets up the device nodes under a separat directory under /dev.

So we have had problems with VirtualBox and OpenSUSE, but we may still have problems with udev, as there's no built in protection in it for conflicting rules.

I hope it became a little clearer!
schlomo
Posts: 1
Joined: 18. Oct 2009, 21:59
Primary OS: openSUSE
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows

Re: USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Post by schlomo »

I solved the problem by patching the udev rule that VirtualBox installed:

Code: Select all

# cat /etc/udev/rules.d/10-vboxdrv.rules 
KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0600"
SUBSYSTEM=="usb_device", GROUP="vboxusers", MODE="0664"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="vboxusers", MODE:="0664"
Note the final assignment := in the last line!

See also http://www.virtualbox.org/ticket/5249
kcbehler
Posts: 7
Joined: 18. Oct 2009, 17:22
Primary OS: Solaris
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, openSUSE

Re: USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Post by kcbehler »

hank_se wrote: I hope it became a little clearer!
schlomo wrote:
I solved the problem by ...
Thanks. Sounds like the real solution.
You are right, it's not easy to understand, but we'll do our very best.
But what about the average Linux user?

(Should have been warned about new USB issues by the line
"Linux hosts: change the default USB access mode on certain distributions (bugs #3394 and #4291)."
in change log.)
vberic
Posts: 22
Joined: 27. Nov 2009, 18:00
Primary OS: openSUSE
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP SP3

Re: USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Post by vberic »

So what's the bottom line after all this trial and error? As kcbehler said, what about an ordinary Linux user like me? Can someone just list what I need to do to get USB working on openSUSE 11.1 with VBox 3.0.12? I've seen several different ideas as to what should be in fstab and several different ideas about the rules. They seem to be mutually inconsistent. What's the bottom line re fstab? re rules? re anything else? Do I have to do a manual "mount -a"?

What's the process whereby the host is supposed to know not to grab the USB thumb drive but let the guest OS have it? I haven't seen that process explained anywhere, just a bunch of "do this" and "try that".

One more related query: My USB mouse does work--without having to set a filter for it. Why does that USB work but not others? Is there maybe an issue that only one USB can work at a time?

Thanks.
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Re: USB propblems under OpenSuse 11.1 64 bit VBox 3.0

Post by stefan.becker »

Update to 11.2 and it works without any manual changes.
Post Reply