Contents
Recently I was asked to look into an issue with passing USB devices from an ESXi host to a Guest Virtual Machine running Windows.
When the USB device was plugged into a USB port on a vSphere 6.5 host, the device was available in the vSphere client to add to the Guest VM (Edit Settings > Add Device > USB Device)
However, when the VM was powered on, the USB device was removed from the VM automatically.
In this case, the USB device was a USB Smart Card Reader, the ones you use for banking authentication.
Solution
Allow CCID
First, the Virtual Machine configuration needs the following advanced setting applied:
usb.generic.allowCCID = TRUE
You might need to use the below instead, depending on the type of device you are trying to passthrough:
usb.generic.allowHID = "TRUE"
USB Quirks
Second, I discussed this issue with William Lam on Slack and he suggested adding the following additional configuration to the VM:
usb.quirks.device0 = "0xPID:0xDID allow"
PID is the PID of the USB device
lsusb
This will return something like this:
Bus 001 Device: 006: ID 0123:4567 DeviceDescription
usb.quirks.device0 = "0x0123:0x4567 allow"
USB Controller
Attaching the USB device
- Ensure the USB device is connected to the ESXi host’s USB port
- Validate that the VM is located on that same host
- Power off the VM
- Edit the settings of the VM & add a USB device to the hardware. You will see the USB device which you connected to the ESXi host available
- Power on the VM and you should see it listed in device manager