USB not working in Virtualbox Guest environment

Trying to use Virtualbox for the first time, and I’m having trouble getting USB to work in the guest environment. The host is Virtualbox 5.1.6 installed from the SuSE repository, and the guest is Windows 10 64-bit. I can’t get any usb devices to show up in the guest environment. I believe I followed the correct steps of installing the extension pack and guest additions. I also added myself to the vboxusers group. I got to the part in the existing forum help where everyone talks about copying a file from /usr/lib/udev/rules.d/ to /etc/udev/rules.d but my installation didn’t come with the source file so I have nothing to copy. I tried to search around to find out what the contents of that file is and I ended up putting this in /etc/udev/rules.d/60-vboxdrv.rules :


KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0600"
SUBSYSTEM=="usb_device", ATTR{devnum}=="?*", ATTR{busnum}=="?*",NAME="vboxusb/$attr{busnum}/$attr{devnum}", GROUP="vboxusers"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{devnum}=="?*", ATTR{busnum}=="?*",NAME="vboxusb/$attr{busnum}/$attr{devnum}", GROUP="vboxusers"

Still no luck with that entry and rebooting. Am I missing something?

Thanks.

dyno222

I didn’t have any of these problems, probably because I installed VirtualBox from their website, not from a repo.
Check out this guide, it explains the security issues with USB support:
https://en.opensuse.org/VirtualBox

It mentions the copying around is only necessary if you use a version from a repo.

Uwe

Thanks for the tip on using not using the repo, but then I run into the issue of a broken dependency that I need to manually resolve, which I feel isn’t ideal.

I had previously followed the website you linked, but it doesn’t provide much guidance other than doing the “cp -v /usr/lib/udev/rules.d/60-vboxdrv.rules /etc/udev/rules.d” which doesn’t work for me since I can’t find the source file.

dyno222,

I don’t mind fulfilling a dependency or two manually.
What was it, exactly?

Here’s what my udev rule file says:

Code:

KERNEL==“vboxdrv”, NAME=“vboxdrv”, OWNER=“root”, GROUP=“vboxusers”, MODE=“0660”

#these lines below give access permission to vboxusers to properly work with usb nodes, but enabling them could be security risk (bnc#664520) !!
#if you can live with this security problem put these lines below in to the new file /etc/udev/rules.d/60-vboxdrv.rules so they will stay enabled also after package update
#SUBSYSTEM==“usb_device”, ACTION==“add”, RUN+="/usr/lib/udev/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass} vboxusers"
#SUBSYSTEM==“usb”, ACTION==“add”, ENV{DEVTYPE}==“usb_device”, RUN+="/usr/lib/udev/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass} vboxusers"
#SUBSYSTEM==“usb_device”, ACTION==“remove”, RUN+="/usr/lib/udev/VBoxCreateUSBNode.sh --remove $major $minor"
#SUBSYSTEM==“usb”, ACTION==“remove”, ENV{DEVTYPE}==“usb_device”, RUN+="/usr/lib/udev/VBoxCreateUSBNode.sh --remove $major $minor"


Thanks for the output of the file. I was able to take that make things work. I had to modify the paths to the VBoxCreateUSBNode.sh to point to the correct location. For reference, here is what I ended up with.


KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"
#
##these lines below give access permission to vboxusers to properly work with usb nodes, but enabling them could be security risk (bnc#664520) !!
##if you can live with this security problem put these lines below in to the new file /etc/udev/rules.d/60-vboxdrv.rules so they will stay enabled also after package update
SUBSYSTEM=="usb_device", ACTION=="add", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass} vboxusers"
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass} vboxusers"
SUBSYSTEM=="usb_device", ACTION=="remove", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"
SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN+="/usr/lib/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"


I don’t know if this would be considered a bug? The fact that the file that I needed to modify didn’t exist, and then the files that existed in previous/other versions had the wrong paths in them for latest tumbleweed? I would consider my specific problem closed. I would appreciate advice though if I should do anything to report this to SuSE or Virtualbox teams.

thanks!

+1 for raising missing file /usr/lib/udev/rules.d/60-vboxdrv.rules with devs

On general principles,
I agree.
Especially because Virtualbox is packaged, more should be expected of what is packaged than what might be the default result if installed from some other source, in this case typically the Oracle VBox website downloads.
On the other hand, one of the things I’ve never followed up on is why Virtualbox distributes its Extensions separately than the main package. AFAIK there are no licensing issues but anything is possible.
In particular, I would think that installing this missing udev file should not be harmful even if Virtualbox wasn’t installed… It would simply have no effect.

If you’d like to at least suggest and pose the issue whether the Extensions should be distributed with the main Virtualbox package and not separately, go ahead and submit a feature request to https://bugzilla.opensuse.org.

TSU

It’s because the extensions are binary only and fall under the Oracle PUEL license which is not open source.

I don’t see why one should expect more to be included in the openSUSE packages than what is packaged in the creator’s (Oracle) packages. Especially if they contain the same thing, the open source version of VirtualBox.

Regarding the udev rule file, I have no idea why it is not packaged any more.
A bug report (at openSUSE’s bugzilla) should at least help to clarify this (at least whether it was a conscious decision, or is a mistake).

But IIANM, running “sudo /etc/init.d/vboxdrv setup” should create the udev rule file in the recent openSUSE packages, without having to modify it afterwards (as was necessary for security reasons in earlier versions when the udev rule file was still shipped as part of openSUSE’s packages).

On the other hand, one of the things I’ve never followed up on is why Virtualbox distributes its Extensions separately than the main package. AFAIK there are no licensing issues but anything is possible.

The extensions are closed-source.
That alone implies that there are licensing issues.

In particular, I would think that installing this missing udev file should not be harmful even if Virtualbox wasn’t installed… It would simply have no effect.

Yes, but what’s the point in installing it without installing Virtualbox?
I’m not sure what you are referring to here.

If you’d like to at least suggest and pose the issue whether the Extensions should be distributed with the main Virtualbox package and not separately, go ahead and submit a feature request to https://bugzilla.opensuse.org.

This is not at all about the extensions.
The udev rules file is necessary in general for being able to access USB devices.

The extensions are only needed if you want to use USB 2.0 or higher (and they have other additional features like RDP access), USB 1.1 support is included in the open source version.

And filing a bug report to include the extensions is pointless, they won’t be included in openSUSE’s open source packages, as they are closed-source. (And when I last looked, which admittedly was years ago, the license explicitly disallowed anybody to distribute them, IIRC)

PS: I think this might have been done to be more in line with Oracle’s package where “vboxdrv setup” does create the udev rule as well in addition to compiling the kernel module (which is not necessary with the openSUSE packages).
Except that Oracle’s package ships a systemd unit instead of a sysvinit script since some time of course.

And one could argue that it’s easier to run “vboxdrv setup” than having to copy the file manually and modify it, I suppose… :wink: