[SOLVED] Slackware 13.37, VirtualBox, and USB devices.
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I installed VirtualBox using SlackBuilds.org and I am having a little trouble getting VirtualBox to work with my USB devices. (I have also installed the Extension Pack.)
This link explains how to get it working with Slackware 13.1, but when I took a look at my rc.S the relevant portion is a bit different than the one in 13.1. And I am not sure how to incorporate the modifications. I also don't have usbfs in my fstab.
This is the rc.S snippet from the link.
Code:
--- ./rc.S.orig 2010-03-20 00:14:51.000000000 +0000
+++ ./rc.S 2010-06-14 11:31:16.067169967 +0100
@@ -297,7 +297,7 @@
if grep -wq usbfs /proc/filesystems; then
if ! grep -wq usbfs /proc/mounts ; then
if ! grep -wq usbfs /etc/fstab; then
- /sbin/mount -v usbfs /proc/bus/usb -t usbfs
+ /sbin/mount -v usbfs /proc/bus/usb -t usbfs -o devgid=83,devmode=0664
else
/sbin/mount -v /proc/bus/usb
fi
And this is the snippet from my 13.37 rc.S
Code:
# Mount usbfs only if it is found in /etc/fstab:
if grep -wq usbfs /proc/filesystems; then
if ! grep -wq usbfs /proc/mounts ; then
if grep -wq usbfs /etc/fstab; then
/sbin/mount -v /proc/bus/usb
fi
fi
fi
I thought I read somewhere here that usb devices only work with the commercial version of VirtualBox. So I have never really tried to make it work under Slack 13.1. For file storage it does not matter really because you can easily create a shared virtual drive between the host system and the virtual system and then the use the host system to access USB devices as usual. But USB access to printers, cameras, phones etc is something I assumed I would never have from my virtual PC.
As of VirtualBox 4 there are no longer two editions, there is only one edition and it is open source. If you wish to use the USB2 root hub and other minor features, then you need to install the Extension Pack which is closed source and released under a different licence.
2. Making USB work.
I have yet to try VirtualBox on 13.37 - so I am not 100% what is required, but the following is worth trying.
a. Make sure your user is in the vboxusers group and then reboot. Logging out and then in will probably be insufficient as the group information is basically unchanged from the parent process (KDM). I know there are ways to get the permissions change to take effect, but if you can reboot - just do it it's simpler and guaranteed.
b. The modification to rc.S *looks* from what you've pasted to still be relevant. IFF the group membership above does not solve the problem, simply add "-o devgid=83,devmode=0664" to the end of the "/sbin/mount" command and reboot. That ought to do it.
c. Don't forget to add the USB hub as a device to any existing virtual machine configurations. IIRC it won't be added by default.
My user has been in the vboxusers group for quite some time now. And I have also rebooted a few times. So that's not the problem.
I added "-o devgid=83,devmode=0664" to my rc.S. Here's what I have:
Code:
# Mount usbfs only if it is found in /etc/fstab:
if grep -wq usbfs /proc/filesystems; then
if ! grep -wq usbfs /proc/mounts ; then
if grep -wq usbfs /etc/fstab; then
#/sbin/mount -v /proc/bus/usb
/sbin/mount -v usbfs /proc/bus/usb -t usbfs -o devgid=83,devmode=0664
fi
fi
fi
And yes, I rebooted after the change.
The USB hub device is enabled in VirtualBox.
Now, after all of this it still doesn't work. I went ahead and tried running VirtualBox as root and was finally able to access USB devices. This means that it is certainly a permissions related error, right?
I don't feel very good about running VB as root. Is that a big problem?
What happens if I change the file permissions for the USB device under /sys/bus/usb/devices? Would that work?
I was able to get it all working by adding usbfs to my fstab. Everything works as it should now.
But, on booting up I noticed that I got a warning about my fstab. Apparently I did not add usbfs using the correct format. All I did was add "usbfs" and nothing else, but it does allow the rc.S script to run properly.
Now my question is, can I skip the changes to rc.S in future installations and just modify fstab correctly? Meaning, can I put all the needed information in fstab and leave rc.S alone? I would prefer that.
EDIT: I have a bad habit of posting before I've tried everything.
I simply added "/sbin/mount -v usbfs /proc/bus/usb -t usbfs -o devgid=83,devmode=0664" to my rc.local. Seems to work just fine.
Other differences I noted between OSE and the binary is the "Enable USB 2.0 (EHCI) Controller" option is missing in the OSE version.
Another, in the OSE version my printer was visible and selectable, my UPS and USB stick was shown but not available. Adding user to vboxusers does not change this. In the binary version, USB devices are not available at all unless you are a member of the vboxusers group.
I will stick with the binary version, which is now at version 4.0.8. It take minutes to install and the only thing you need to do is add users to vboxusers when the installer finishes.
1. PUEL vs. Commercial
As of VirtualBox 4 there are no longer two editions, there is only one edition and it is open source. If you wish to use the USB2 root hub and other minor features, then you need to install the Extension Pack which is closed source and released under a different licence.
I have also heard a lot of conflicting information. As zordrak posted above, according to Oracle they are supposed to be the same. Editions - VirtualBox
I downloaded the VirtualBox "OSE" 4.0.8 source code last night and compiled it this morning. I now have it successfully running. With this "OSE" version USB fails unless I add an usbfs line to fstab. Without the usbfs mounted I get an warning pop-up when opening settings "Failed to access the USB subsystem".
As noted previously, the "OSE" version does not have an "Enable USB 2.0 (EHCI0 Controller" USB option.
The binary version requires you to be a member of vboxusers for USB to function.
The "OSE" version in addition to the vboxusers requirement also requires a hack to rc.S or a line for usbfs added to fstab for USB to function.
Interestingly enough, USB works in both the "OSE" and binary version without the Extension Pack. At least I've had no problems moving files on and off my USB stick.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.