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

by Danny
4 comments

READING TIME: 4 MINUTES

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.


Smart Home Product Finder

What hub do you currently use?


SmartThings

Home Assistant

Hubitat

Step 1 of 3

What product are you looking to add?


Lights

Locks

Thermostats

Cameras

Garage Door Opener

Switches

Sensors

Motion, Door & Window, Leak

Smart Plugs

Buttons

Step 2 of 3

What protocol?


Z-Wave

Zigbee

Wifi

Step 3 of 3

Retake quiz? Click here!

My Favorite Home Assistant Devices

Below are some of the Home Assistant-compatible devices I personally use in my home. I highly recommend each of them.

The full list of all Home Assistant compatible & recommended devices I use can be found on my Equipment List page.

4 comments

You may also like

4 comments

Ofir October 18, 2021 - 8:53 am

Thank you! works great!

Reply
Danny October 18, 2021 - 9:11 am

You’re welcome Ofir!

Reply
jaap meijer October 19, 2021 - 2:39 pm

works perfect!

Reply
Danny October 19, 2021 - 2:44 pm

+1, awesome! Glad it worked for you!

Reply

Leave a Comment