USB passthrough to a KVM guest instance - Main server running: CentOS 7.7 x64 latest version. KVM guest machine running RHEL-7.4 (Maipo) but it can be any linux flavor.
USB flash drive attached to the main server USB port.
I tried all the guides that I could find on internet and even contacted RedHat regarding this. I was not able to expose the USB flash drive to the KVM guest instance.
In the end, in order to do that, the steps bellow are to be performed:
Connect via SSH to the compute node where the USB stick is attached:
Issue a lsscsi command (the output will be something like the one bellow):
In this case, the USB drive is: [24:0:0:0] disk SMI USB DISK 1100 /dev/sdc
Create a xml file to define some USB parameters that will be used to attach the USB device to the running vm (with the following content):
Check the ID of the running kvm guest:
You will get a list with all the running instances on that node. In my case the output is something like this:
Attach the USB device to the kvm guest instance
At the end you should see a message like: Device attached successfully
Now if you go to that kvm guest instance you should be able to see the USB drive and use it.