LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 05-15-2011, 11:56 PM   #1
kgs
Member
 
Registered: Apr 2011
Posts: 30

Rep: Reputation: 2
Slackware 13.37, VirtualBox, and USB devices.


Hello everyone.

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
Can anyone give me a hand with this?
 
Old 05-16-2011, 01:48 AM   #2
chrisretusn
Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware
Posts: 254

Rep: Reputation: Disabled
One can assume since you have the extension pack installed you are at least running VirtualBox 4.0. I am running VirtualBox 4.0.6.

None of that stuff is needed.

For USB to work you must be a member of the 'vboxusers' group.

After you add your self to vboxusers

Code:
~# usermod -aG vboxusers username
you will need to restart the virtualbox drivers
Code:
~# /etc/rc.d/rc.vboxdrv restart
And most likely log out and then back in as username, unless you accomplish the above logged in as root.

Last edited by chrisretusn; 05-16-2011 at 01:49 AM.
 
Old 05-16-2011, 01:59 AM   #3
kgs
Member
 
Registered: Apr 2011
Posts: 30

Original Poster
Rep: Reputation: 2
Hehehehe.

I already did that. I think the problem has to do with the permissions used with the USB device filesystem gets mounted.
 
Old 05-16-2011, 02:08 AM   #4
chrisretusn
Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware
Posts: 254

Rep: Reputation: Disabled
I have no entry in fstab for usbfs, I also have no additional line in rc.S. I used an fstab entry, but have since removed it as no longer needed.

How are you installing VirtualBox?

I used the installer provided by Oracle. I see you are using the SBo install.

Check to see if you have this file:
/etc/udev/rules.d/10-vboxdrv.rules

Last edited by chrisretusn; 05-16-2011 at 05:33 AM.
 
Old 05-16-2011, 02:23 AM   #5
chrisretusn
Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware
Posts: 254

Rep: Reputation: Disabled
Another thought when you right click on the VM USB icon in the lower right, does it show any available devices?

To get a device recognized by the guest OS you must first select it.
 
Old 05-16-2011, 02:31 AM   #6
bogzab
Member
 
Registered: Mar 2006
Location: Dyserth, Wales
Distribution: Slackware 13.37
Posts: 215

Rep: Reputation: 29
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.
 
Old 05-16-2011, 03:28 AM   #7
zordrak
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 550

Rep: Reputation: 109Reputation: 109
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.


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.
 
Old 05-16-2011, 06:50 PM   #8
kgs
Member
 
Registered: Apr 2011
Posts: 30

Original Poster
Rep: Reputation: 2
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?
 
Old 05-16-2011, 10:01 PM   #9
kgs
Member
 
Registered: Apr 2011
Posts: 30

Original Poster
Rep: Reputation: 2
Okay.

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.

Last edited by kgs; 05-16-2011 at 10:58 PM.
 
Old 05-17-2011, 04:07 AM   #10
hotchili
LQ Newbie
 
Registered: Sep 2009
Distribution: Slackware64
Posts: 28

Rep: Reputation: 3
Hey,

I have this in my fstab, so rc.S can be left untouched.
Not sure if I did this, or some installer?
Code:
none            /proc/bus/usb    usbfs       devgid=210,devmode=664     0   0
groupid 210 is vboxusers on my system and I am a member of it
 
Old 05-17-2011, 09:55 AM   #11
chrisretusn
Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware
Posts: 254

Rep: Reputation: Disabled
I compiled and installed the VirtualBox 4.0.4 from Slackbuilds.org last night.

There is definitely a difference between the binary I normally run and the slackbuilds.org version.

With the binary version the only thing that needs to be done is be a member of the vboxusers group.

With the OSE version from SlackBuilds,org you have to do a bit more. My preferred method would be to add a line to fstab, vice modifying rc.S.
Code:
usbfs            /proc/bus/usb    usbfs  devgid=215,devmode=664 0 0
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.
 
Old 05-17-2011, 10:04 AM   #12
zordrak
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 550

Rep: Reputation: 109Reputation: 109
...

Quote:
Originally Posted by zordrak View Post
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.
 
Old 05-17-2011, 08:16 PM   #13
chrisretusn
Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware
Posts: 254

Rep: Reputation: Disabled
I read that. Experience dictates otherwise. They are not the same. I pointed out two major differences.

1) There is no "Enable USB 2.0 (EHCI) Controller" option the OSE version in USB settings.

2) Adding a line to rc.S or a line to /etc/fstab to get USB to work is NOT required with the binary version.

Here is another, albeit minor difference.

1) Oracle VM VirtualBox Manager about screen.
http://img853.imageshack.us/img853/6092/snapshot18v.png

2) OSE VirtualBox Manager about screen.
http://img24.imageshack.us/img24/1087/snapshot1fc.png

Last edited by chrisretusn; 05-17-2011 at 08:18 PM.
 
Old 05-18-2011, 01:10 AM   #14
kgs
Member
 
Registered: Apr 2011
Posts: 30

Original Poster
Rep: Reputation: 2
This is interesting. I've conflicting information about VirtualBox everywhere I've gone.

Perhaps the binary version has the Extension Pack integrated into it?
 
Old 05-18-2011, 03:36 AM   #15
chrisretusn
Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware
Posts: 254

Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Using USB devices in VirtualBox as regular user damgar Slackware 11 11-22-2010 04:34 PM
Cannot use any USB devices in VirtualBox davidguygc Linux - Hardware 7 06-14-2010 08:36 AM
[SOLVED] Virtualbox 2.2.4 + Slackware 12.2 = no usb devices Slackovado Slackware 6 03-14-2010 03:38 PM
how do i give virtualbox access to my usb devices baronobeefdip Linux - Software 16 10-13-2009 03:44 AM


All times are GMT -5. The time now is 10:09 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration