Is there a way to attach a particular USB device (by Vendor ID/Product ID) to a Qube automatically on connect? I have a sys-usb to manage USB devices.
I don’t know of an easy solution to this.
Using the qvm-usb tool you can attach a connected device to another VM persistently, but the device id is unreliable and may change if you reconnect devices in a different order.
Since sys-usb cannot escape virtualization and connect a device to another VM, what you could do is write udev rules in sys-usb to trigger an RPC call to dom0 which would attach the device to another VM (after a confirmation popup, if you want).
The USB device I am using frequently becomes disconnected (and reconnected) during use and it only needs to be connected to one particular Qube.
You might try enabling no-strict-reset on your USB controller attached to sys-usb
This weekend was a long weekend and I had some time to try out the idea that I had mentioned in in a comment above. The whole process was relatively straightforward and there were very few surprises
I recently did the same sort of thing as padhi, except my goal was for a prompt to open up in dom0 asking which qube a USB device should be attached to upon being plugged in. Unfortunately, when Qubes wakes up from standby, the sys-usb qube acts as if all USB devices were re-plugged in. I couldn’t figure out a way to differentiate that event versus the device actually being plugged in, so I ended up getting rid of it.
Here’s some details, if it helps anyone.
I was using the stdin/stdout way of communicating, with the following udev rule for not just block devices :