Libvirt allows you to expose any USB device attached to your physical machine to the guest VMs. To do it, first, you have to get the vendor id and product id.
Run lsusb
on terminal:
Create a hostdev xml with vendor and product nano usb.xml
<hostdev mode='subsystem' type='usb'>
<source>
<vendor id='0x0781'/>
<product id='0x5567'/>
</source>
</hostdev>
Note: You have to add 0x
prefix before vendor and product id.
Then, run following command to attach usb to guest vm.
virsh attach-device vmname/vmid usb.xml
This only works if the device is attached and enabled when the VM is started. The connection will be lost whenever the device is disabled or removed.