USB hotplug not working in VM

imrazor

Distinguished
This is a bit complicated, so bear with me. I'm running VMWare ESXi 6.0.0 and am having an issue with a piece of USB hardware. It's a cheap knockoff USB 2.0 controller Windows 8.1 identifies as a "Via Rev 5 or later USB controller". With PCI passthrough, the VM is able to detect USB devices connected to the controller as long as they are plugged in at boot. If a device is unplugged after boot up, and plugged back in Windows refuses to see the device. However, if I remote into the VM, fire up Device Manager, and manually select "Scan for hardware changes" the delinquent device is detected and becomes fully functional. This is very frustrating and inconvenient when using a USB KVM switch.

I'm not sure if this behavior is caused by Windows is being virtualized, some quirk of the hardware, a flaw in Windows 8.1, or some confluence of all three. Does anyone know of a way to force Windows to detect USB hardware without requiring direct intervention?
 
Solution
I figured out a horrible kluge for this. There's a utility you can download from Microsoft called "devcon.exe". If you issue the command "devcon.exe rescan" as admin, it does the same thing as "scan for new hardware" in Device Manager. So I created a task in Task Scheduler that runs that command every minute. So now I can flip back and forth with my KVM, but I may have to wait up to 60 seconds for the keyboard and mouse to get recognized. I may try to increase the frequency of the command to every 15 or 30 seconds.

imrazor

Distinguished
I figured out a horrible kluge for this. There's a utility you can download from Microsoft called "devcon.exe". If you issue the command "devcon.exe rescan" as admin, it does the same thing as "scan for new hardware" in Device Manager. So I created a task in Task Scheduler that runs that command every minute. So now I can flip back and forth with my KVM, but I may have to wait up to 60 seconds for the keyboard and mouse to get recognized. I may try to increase the frequency of the command to every 15 or 30 seconds.
 
Solution