You are not logged in.

#1 2016-02-21 07:42:50

spacecowboy
Member
Registered: 2016-02-21
Posts: 10

Run qemu without root for usb passthrough?

Hello I am attempting to set up a home lab running on arch.

I was able to use this topic to find out how to run qemu without root and allow PCI passthrough to a windows vm.
https://bbs.archlinux.org/viewtopic.php?id=206358

However I am not able to pass through A USB mouse or keyboard unless running as root.

can anyone advise me on how to set the permissions on my system to allow this?

Thank you for much for the help smile

Last edited by spacecowboy (2016-02-21 07:43:28)

Offline

#2 2016-02-21 17:12:50

JaqFrost
Member
Registered: 2016-01-07
Posts: 1

Re: Run qemu without root for usb passthrough?

Much like that post you linked to use udev rules to permit the vfio devices to passthrough you can do the same with your usb devices.
If you created a /etc/udev/rules.d/10-qemu-hw-users.rules such as that post just add another line per usb device you want passed in such a manner:

SUBSYSTEM=="usb", ATTRS{idVendor}=="1e7d", TAG+="uaccess"

That example gives me access to my Roccat devices, idVendor 1e7d, to which I only have the mouse.  If you have more devices from a vendor and want just the one passed add in a ATTRS{idProduct}==

SUBSYSTEM=="usb", ATTRS{idVendor}=="1e7d", ATTRS{idProduct}=="2e23", TAG+="uaccess"

To activate the udev rule you can reload and trigger via udevadm, replug the device in or reboot the system.
sudo udevadm control -R
sudo udevadm trigger

edit: pasting dropped the S in SUBSYSTEM, oops!

Last edited by JaqFrost (2016-02-21 17:14:44)

Offline

#3 2016-02-21 18:45:32

spacecowboy
Member
Registered: 2016-02-21
Posts: 10

Re: Run qemu without root for usb passthrough?

Thanks JaqFrost smile
I'm a noob to this whole Arch Linux thing but it seems awsome!
You gave me excatly what I needed an explnation of how to understand what I found in the other post.
Thanks so much.

JaqFrost wrote:

Much like that post you linked to use udev rules to permit the vfio devices to passthrough you can do the same with your usb devices.
If you created a /etc/udev/rules.d/10-qemu-hw-users.rules such as that post just add another line per usb device you want passed in such a manner:

SUBSYSTEM=="usb", ATTRS{idVendor}=="1e7d", TAG+="uaccess"

That example gives me access to my Roccat devices, idVendor 1e7d, to which I only have the mouse.  If you have more devices from a vendor and want just the one passed add in a ATTRS{idProduct}==

SUBSYSTEM=="usb", ATTRS{idVendor}=="1e7d", ATTRS{idProduct}=="2e23", TAG+="uaccess"

To activate the udev rule you can reload and trigger via udevadm, replug the device in or reboot the system.
sudo udevadm control -R
sudo udevadm trigger

edit: pasting dropped the S in SUBSYSTEM, oops!

Offline

Board footer

Powered by FluxBB