Page 1 of 1

Ubuntu 8.04 + USB + VB 1.6

Posted: 4. Jun 2008, 20:51
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.

Posted: 5. Jun 2008, 00:04
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.