Hi, I bought the VirtualHere 4-Port USB 3 Hub and would like to check a setup before it arrives.
Setup
- Host: Windows 11 PC running VirtualHere USB Server for Windows, with the hub plugged into it.
- Guest: a Windows 10 virtual machine running in VirtualBox 6.1.38 on that same Windows 11 host (USB 3.0/xHCI controller, NAT networking).
- Device on a hub port: a USB device that is powered only from its USB port, so switching the port power off/on fully reboots it. A VirtualBox USB filter is set up for it, so whenever it connects it is passed to the guest.
Use case
My use is a bit different from the usual remote-server setup (e.g. a Raspberry Pi server reached over the internet). I want to use per-port power switching as a software “unplug and plug back in” to recover a USB device that has hung. A person would normally do this by pulling and reconnecting the cable. Because the device is already registered in the VM’s USB filter, after the port is power-cycled the device should start up again and be re-attached to the guest automatically.
Goal
From a script inside the guest, power-cycle the hub port the device is on, e.g.vhui64.exe -t "MANUAL HUB ADD,<host-ip>:7575" then vhui64.exe -t "CUSTOM EVENT,<address>,power_cycle_port".
Automation (no person at the PC)
This will run as unattended automation. An AI agent running inside the VM watches the device. When the device has not responded for a certain time and the agent decides it needs a restart, it sends the power-cycle command from the VirtualHere Client in the VM to the server on the host. Nobody is there to click a Windows UAC (administrator) prompt, so I need to know whether any step of this requires administrator rights. That covers sending the command from the client, the server carrying it out, and the device reconnecting afterwards.
Questions
- Does the Windows server take over (install its driver for) every USB device on the host, or only a device when a client uses it? Is there a config.ini key to exclude a device (by VID/PID) from sharing, and does an excluded device’s port still accept power control?
- Can
CUSTOM EVENT … power_cycle_portbe sent for a port whose device is currently captured by VirtualBox (VBoxUSB), i.e. not shared by VirtualHere? If not, is there an address for the hub port itself rather than the device? - Is a client inside a VirtualBox guest on the same host (NAT, connecting to the host’s server over TCP 7575) supported for this? Does
CUSTOM EVENT(or anything else in this flow) need admin rights / a UAC prompt on the client side or on the server side? If the server runs as a Windows service, is that enough? - Forum comments mention Windows re-enabling a port right after it is switched off. Is unticking “Allow the computer to turn off this device to save power” for both the USB 3 and USB 2 parts of the hub the recommended fix?
- After a reboot, the device reconnects about 1.5 s into its boot. Through VirtualBox USB passthrough, that early connection never carries data until the device is re-attached later. Would sharing the device to the guest through VirtualHere (instead of VirtualBox passthrough) handle such a device, e.g. with auto-use?
Thanks!
David Hyun Gil Kim
.
The virtualhere server can power cycle the usb port even with virtualbox in control of the device. And you dont need administrator. You can install the virtualhere filter driver beforehand see this page https://www.virtualhere.com/node/4352 (vhfilter.exe) and the virtualhere server will use that filter and wont need to install one beforehand. Windows requries a filter driver to be installed on a USB device beforehand to control it. If you dont install any virtualhere filter driver before the server will autoinstall one and attempt to powercycle when required. Sometimes windows is a bit flakey and wants a reboot in this case you will be notified in the client (and in the server log) saying it needs a reboot after the filter was installed. The filter is installed for all USB devices.
Note that in the USB Specification documents there is no "device disconnected" event generated when port is powered off. What this means is that the port will lose power but will still appear in windows. When you turn it back on then it will be reenumerated and appear connected and working again.
Some USB devices have firmware that boots when the device is powered on and hence takes a second or two to respond. Virtualhere server can handle this because it will know to retry when the device disappears and reappears again within a few seconds. So give auto-use a try and it should be ok inside the vm.
The powersaving settings is usually only applicable to laptops running virtualhere server so if you dont have a laptop running the server you probably dont need to use that setting but it might be useful to uncheck powersaving anyway in the Device Manager options for the hub for both the usb2 and 3 parts