USB on Fedora 8

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Mikkel
Posts: 1
Joined: 30. Sep 2008, 00:09

USB on Fedora 8

Post by Mikkel »

While I was trying to figure it out, I read a bunch of posts about how to enable USB for normal users on Fedora. The method described in the manual does not work.

Because I didn't want to give wholesale access to USB devices, I did not change the mount options for the USB file system. I think it is mounted in the initrd, but I didn't really check it. I know it is not in /etc/fstab.

Anyway, what I did was create a udev rule to manage the devices I wanted to be able to access. In my case, there were not Linux drivers for the devices I wanted to access. So here is a sample of what I used. You can add it to the 60-vboxdrv.rules file, or create your own file for it.

ACTION!="add",SUBSYSTEM!="usb", GOTO="vbox_rules_end"

# eBookwise eBook reader.
ATTR{idVendor}=="0993", ATTR{idProduct}=="0002", run="/lib/udev/set-usb-group %s{uevent}"

LABEL="vbox_rules_end"

The set-usb-group script looks like this:

#! /bin/sh
ret=false
if [ "$DEVICE" != "" ]; then
if [ -e $DEVICE ]; then
chgrp vboxusers $DEVICE && \
chmod g+rw $DEVICE && \
logger udev/set-usb-group: $(ls -l $DEVICE)
ret=true
fi
fi

The $DEVICE comes from the uevent file from the sys file system entry for the new device. I have the group set to the vboxusers because anyone using VirtualBox should already be a member of that group.

I believe the script could be expanded to include unloading the driver for the device if there is already a driver loaded for it, but I have not tried that. When I need it, I'll work on that. Otherwise, feel free to expand on it.

(I based this on something I found on the web for an older version of Fedora - I lost the URL.)

Mike
Post Reply