I want to access with QEMU this USB stick:
$ lsusb | grep Kingston
Bus 001 Device 011: ID 0930:6545 Toshiba Corp. Kingston DataTraveler 102/2.0 / HEMA Flash Drive 2 GB / PNY Attache 4GB Stick
The problem is that I need to change the group from root to kvm:
$ LC_ALL=C ls -l /dev/bus/usb/001/011
crw-rw-r-- 1 root root 189, 10 Feb 3 22:25 /dev/bus/usb/001/011
$ sudo chgrp kvm /dev/bus/usb/001/011
$ LC_ALL=C ls -l /dev/bus/usb/001/011
crw-rw-r-- 1 root kvm 189, 10 Feb 3 22:25 /dev/bus/usb/001/011
How can I make the group change persistent? Alternatively, are there better ways to fix permissions?
This is the command I use:
qemu-system-x86_64 \
-enable-kvm \
-m 4G \
-smp 2 \
-hda myVirtualDisk.qcow2 \
-boot d \
-cdrom linuxmint-21.1-cinnamon-64bit.iso \
-netdev user,id=net0,net=192.168.0.0/24,dhcpstart=192.168.0.9 \
-device virtio-net-pci,netdev=net0 \
-vga qxl \
-device AC97 \
-device usb-ehci,id=ehci \
-usb \
-device usb-host,bus=ehci.0,vendorid=0x0930,productid=0x6545