[qubes-users] Attaching USB devices by name instead of devid (from the command line)

Hi,

I use an USB scanner which is sometimes unplugged and might be plugged
to another USB port. I would like it to be permanently attached to the
"scanner" vm (I don't want to reattach it after reboot).

However the documented way uses the devid, ex. sys-usb:2.5. If I
attach it permanently to a vm (qvm-usb attach -p scanner sys-usb:2.5),
then unplug the scanner and plug an USB flash drive to same port, the
flash drive gets attached automatically to my "scanner" vm (which I
don't want).

Is there a way to attach a specific device to a vm, and not an USB port?

I tried with qvm-block, but couldn't find my scanner label in /dev/

Currently, my best solution is to have a launcher running this:
qvm-usb attach scanner "$(qvm-usb|grep Canon|cut -f 1 -d ' ')"

Hi,

I use an USB scanner which is sometimes unplugged and might be
plugged
to another USB port. I would like it to be permanently attached to
the
"scanner" vm (I don't want to reattach it after reboot).

However the documented way uses the devid, ex. sys-usb:2.5. If I
attach it permanently to a vm (qvm-usb attach -p scanner sys-
usb:2.5),
then unplug the scanner and plug an USB flash drive to same port, the
flash drive gets attached automatically to my "scanner" vm (which I
don't want).

Is there a way to attach a specific device to a vm, and not an USB
port?

I tried with qvm-block, but couldn't find my scanner label in /dev/

Currently, my best solution is to have a launcher running this:
qvm-usb attach scanner "$(qvm-usb|grep Canon|cut -f 1 -d ' ')"

Currently I have a similar script:
qvm-usb attach --verbose sys-net ${qvm-usb l | awk
'/.*Realtek_USB_10_100_1000_LAN.*/ {print $1}')

1 Like