Quote:
Originally Posted by SpacePlod
I'm trying to write a udev rule that will allow access to USB storage devices for members of 'plugdev'.
|
This is my udev rule on a Slackware 14.2 machine to let normal users access a USB device:
/etc/udev/rules.d/92-garmin.rules
Code:
# Garmin DriveAssist 50 LMT-D
ATTRS{idVendor}=="091e", ATTRS{idProduct}=="28de", MODE="666"
I did not use a group, but that would probably also be possible with something like:
Code:
GROUP="plugdev", MODE="066"
instead of
Quote:
Originally Posted by SpacePlod
The goal is to allow using 'device_add' in qemu. I've done it successfully before and kept notes, but for some reason it's not working right now (This is on 15.0).
|
Once you get the permissions right the next step might be tricky. To give qemu access to a USB device requires that no kernel driver on the host machine is used to access the device. You can give qemu access to the device with device_add in the monitor, or from the command line, like in my example:
Code:
-usb -device usb-ehci,id=ehci -device usb-host,bus=ehci.0,vendorid=0x091e,productid=0x28de
However, in your case a kernel driver is most likely loaded on the host machine for the USB storage device. Then it will not be a good idea to give the device also to qemu. You will end up with two different kernels messing with the same hardware. Instead, it will probably be better to mount the USB storage device on the host machine and then share it to the guest with something like smb.
regards Henrik