Ubuntu 8.04 + USB + VB 1.6

Discussions related to using VirtualBox on Linux hosts.
Post Reply

Are you satisfied with virtualbox's USB support?

Yes
1
25%
No
1
25%
Could be better, but it works
2
50%
I don't use USB in my VMs
0
No votes
 
Total votes: 4

jharr
Posts: 2
Joined: 4. Jun 2008, 20:41

Ubuntu 8.04 + USB + VB 1.6

Post by jharr »

Has anyone figured out a definitive, persistent (as in works across reboots) workaround to get USB devices to work properly in guests under an Ubuntu host?

If so, please post. And if this works, moderators please sticky that post, others will save a great deal of time fixing it. I'm tired of reading/trying all these fixes that don't work consistently. Hopefully Sun will include some sort of fix in the next update of virtual box so it just works.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

This 'howto' is taken from neco, posted in USB not working in ubuntu hardy and slightly modified to my setup. I like this idea more, the use of a separate group for USB. This setup is for Ubuntu. It might work on other distributions. Also, as Ubuntu changes the location/names of files between releases, this might not work for versions prior and after 8.04, on which I tested this. If my memory serves me right, this can be used on 7.10 Gutsy without any problems too. The files should have the same name and location.

Code: Select all

$ sudo gedit /etc/init.d/mountdevsubfs.sh
Look for:

Code: Select all

#
# Magic to make /proc/bus/usb work
#
#mkdir -p /dev/bus/usb/.usbfs
#domount usbfs “” /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
#ln -s .usbfs/devices /dev/bus/usb/devices
#mount –rbind /dev/bus/usb /proc/bus/usb
uncomment and let as this:

Code: Select all

#
# Magic to make /proc/bus/usb work
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs “” /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount –rbind /dev/bus/usb /proc/bus/usb
To start the service do:

Code: Select all

sudo /etc/init.d/mountdevsubfs.sh start
Create a new group and add yourself to it*:

Code: Select all

addgroup --gid 505 usbfs
usermod -a -G usbfs
From here two options:


Option 1


Edit rules:

Code: Select all

$ sudo gedit /etc/udev/rules.d/40-permissions.rules
Look for:

Code: Select all

LABEL=”usb_serial_start”
ATTRS{idVendor}==”0403?, ATTRS{idProduct}==”6001?, \
, MODE=”0660?, GROUP=”dialout”
LABEL=”usb_serial_end”
Now add:
GROUP="usbfs"
to that (your VirtualBox user must be member of that group):

Code: Select all

LABEL="usb_serial_start"
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", \
,GROUP="usbfs", MODE="0660", GROUP="dialout"
LABEL="usb_serial_end"
If still no luck , also try Option 2.

Option 2

Code: Select all

sudo gedit /etc/fstab
Add to the botton of the file, where devgid is your vboxusers group id:

Code: Select all

none /proc/bus/usb usbfs [u]devgid=505[/u],devmode=664 0 0
To mount it:

Code: Select all

sudo mount -a
This howto is taken from neco, posted in USB not working in ubuntu hardy and slightly modified to my setup. I like this idea more, the use of a separate group for USB. This works as it says, after reboot of either Host or Guest, you can use USB devices without any hassle.

* You are free to change the group number. I picked it, because I like users to have IDs above 1000 and groups under 1000. Just make sure that it does not overlap with anything listed in /etc/group and /etc/passwd.


Note:
I followed both options. I am not certain if Option 1 is needed. I would suggest to run Option 2 first, you can always change the rules if needed.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply