When attaching USB devices I currently have to manually assign them to AppVMs via the top right "Qubes Devices" dropdown menu. Which is also working well.
But: I want to automate that.
Using a trigger in /usr/lib/udev/rules.d/ in sys-usb I can detect when the USB device gets plugged in (tested, works). Now ideally I'd like to call qvm-usb inside sys-usb to attach this device to a specific AppVM. Two ways come to mind:
- call "qvm-usb attach" from sys-usb -> I assumed there must be a package that I can dnf install and then configure some qrexec policy in com0 to allow the call but I could not figure out how to install qvm-usb in sys-usb (ist this possible?)
- send an event from sys-usb to dom0 to trigger a script that calls "qvm-usb attach" -> I looked into the Qubes eventing mechanism but failed to find a quick solution
Can somebody give me some hints on how I could automate "qvm-usb'ing" from sys-usb to auto-attach my USB device?