How To Automatically Connect USB Drives to VMware Workstation On Power On

by Danny
0 comment

After spending a few hours migrating Home Assistant from a raspberry pi to VMware Workstation, and passing the my Nortek GoControl USB dongle successfully from my Windows 10 PC to the VM, I quickly realized that if I close the VM Player window or my Windows PC reboots – it doesn’t automatically reconnect the USB device.

This means I still have to manually go to the VMWare Workstation menu > Removeable Devices > and select the Silicon Hubz Smart Home Controller manually after every VM restart.

In this guide, I will show you how to automatically connect your attached USB dongle to the virtual machine when the virtual machine starts.


Obtain Device Vendor ID and Product ID

Since my host machine is Windows 10, I will need to go into the registry to get this information.

  1. Open Regedit by searching windows for regedit. Select Registry Editor.
  2. Expand the folder tree by going to this path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB or copying and pasting the path into the top bar.

You will see a lot of folders here. Manually expand each one, one at a time, until you find something that references HubZ in the DeviceDescription. In my case, since I am using a zigbee and zwave dongle, there are two entries (I only needed one of them though):

The two pieces of info you need are: Vender ID (VID) and Product ID (PID). In my example, my vendor ID is 10C4 and the product ID is 8a2a. You are looking for the numbers after the VID_ and PID_ and will stop at the & sign.


Open your Home Assistant .VMX file

Ensure your VM is off before editing this file.

The virtual machine configuration (.vmx) file is located in the same folder that your VM was created. My Home Assistant VM was created in C:\HomeAssistant:

Tip: Just to be safe, you should make a copy of this file and save it. If for some reason this doesn’t work, you can place the file back or simply remove the lines you just added.

Right-click that file > Open With > Notepad.

Scroll to the bottom of the file and add this line. You will need to prepend a 0x to the beginning of the vendor ID and product ID.

usb.autoConnect.device0 = "0x10C4:0x8A2A"

Then File > Save to save the changes.

If you need to add multiple USB’s, then it would look like this:

usb.autoConnect.device0 = "0x10C4:0x8A2A"

usb.autoConnect.device1 = "0x10C4:0x8A2A"


Start your VM

That’s it! The next time you start your VM, you USB device should successfully connect to your Vmware Workstation 16 VM automatically! Which means you can safely reboot your PC or VM and know that Home Assistant will come back up automatically without you needing to make any additional changes.

To confirm, just go to VMWare Workstation menu > Removeable Devices and see if it is connected.

It worked correctly for me the very first time after adding that line, but if it doesn’t work for you right away, you could try using the VID and PID of 2nd Hubz device. Obviously if you are using something like an Aeotec Zwave dongle, it will probably only have 1 USB port in the registry so you only need to add that.

In my case, even though I am using the Nortek’s zigbee and zwave, I still only needed to add just the one entry to .vmx file, which was found from the HubZ Zigbee Com Port.

0 comment

You may also like

Leave a Comment