ZWave usb stick and VM

Hello all I hope this is the best place to ask this. A couple of months ago I migrated over from a raspberry to a virtual machine via VirtualBox. Part of my setup includes a GoControl husbzb zwave/zigbee stick for control over various devices. After a bit of work I got everything migrated and working including the stick, however, I have noticed a problem. When my host machine shuts down and restarts my vm software can no longer find the usb stick. I have to physically un-plug and plug it back in to get it to show up. Whats more is the vm needs to be running before I do this to find the stick, then I have to re-start hassio for the software to access it. I installed devcon on my windows host machine which allows me to search for the device, stop, and start it to which I set up bat files to try this process but still no luck. After a bunch of testing I am pretty sure the problem lies in virtual box but I don’t fully know and I don’t know what to do. It kind of sucks having to be right by my box to get things back up and running. Any advice from anyone out there? I suspect trying a different usb stick would not matter considering I don’t think it’s the hardware. Any thoughts?

I have the same issue here - would appreciate any help/suggestions.

Additionally - any way to use VirtualHere to forward a usb microphone for snips?

For anyone that may be interested I just solved this issue. Its a bit hacky but it works and that’s all that really matters. So the problem was that I have batch files that run on my host machine to start my vm but the vm would not see the usb zwave stick so hassio would not see it or my zwave devices. Here was the solve. After some research I found out that virtualbox, the software vm I am using, will not take control of usb devices that are already plugged into your host machine when the vm starts up. Rather you have to plug the usb device in after that vm starts and loads. Once this happens the usb will be accessible to the vm whether you start or stop it. So in my windows host machine I wrote a batch for opening virtual box and starting my vm. I then have the machine wait a bit and then run another batch to unload all usb devices and reload them (I use devcon for this). At this point the vm sees the usb device as part of it, but, hassio is already started so it doesn’t pick up the device. I then run another batch to restart the vm and woohoo it finally works! All of these batch files are timed and part of the windows task system at startup and set to run as highest privileges. My only issue really is that it takes a bit to start up since I have to start up and then restart but I can deal with that.

See my post there for how I got it up and working. Its not the cleanest but it works and I may refine it a bit at a later date but its way better then it was. As for the microphone that I have not tried so can’t give any information there.

I was looking for a different solution than this… but I couldn’t find one. I do think I can improve on this though.

There’s no need to wait for Hassio to load, restart USB, and then restart Hassio. To expand on @josephkiser04 technique, you can run the “devcon.exe restart USB*” command immediately after you start your VM.

Sucks that it’s necessary, but alot less painful than I had though it was going to be.

  1. Why batch files? Just add everything you want to have start to your host machine’s startup folder in the startmenu. Its still exists.
    2, VBox will do just fine taking control of devices already plugged in. You have to add it to the filters list in VBox.

Solution to #1 go here… “%Appdata%\Roaming\Microsoft\Windows\Start Menu\Programs\Startup” Paste that into a Windows Explorer address bar. Add shortcuts to anything you want to automatically start. I have the HassOS VM shortcut there, my Unifi Controller, Media and Book servers are there… add a number at the front of the shortcut name to control the order… 01 Home Assistant VM, 02 Unifi Controller, 03 Media Server… etc. Want to Automatically lock the terminal after login, startup of apps? create a shortcut with this command. “C:\Windows\System32\rundll32.exe user32.dll, LockWorkStation” Number that one 99, 999, so its the last item. Windows will execute items in the Startup Folder by Numerical then Alphabetic order. By numbering everything we force an order. This way when windows reboots from an update the autologin logs the system in, executes all the programs, then locks the terminal. Everything keeps starting up in the background behind the terminal lock.

Solution to #2.
Start the VM. Go to Devices, USB, Settings. Add a filter for each USB device you want automatically snagged, bagged, and tagged. That will cause Vbox to grab them when it fires up. Just selecting them from the Device menu causes what you are seeing. Have to add those filters to autosnag.

I run Hassos in Vbox on Win10.

I’m having the same issue as @josephkiser04 and I think I’ve tried your Solution #2. I have the USB filter added and checked.


After restarting the VM if you hover over the USB icon at the bottom it says “No USB Devices Attached”.

If I unplug the Zwave stick then plug it back in it says "Silicon Labs HubZ Smart Home Controller [0100]

You’ll notice from the screenshot it says “converter now attached to ttyUSB1” (and ttyUSB2)

Am I misunderstanding your solution?

That should work, thats the normal method to bring usb devices into the virtualized OS automatically. However I have had to terminate the virtualization software and restart it on on occasion when dealing with adding in a new USB device.

I found a solution to this issue and it doesn’t require any scripting. You must have the VirtualBox Extension Pack installed.

  1. Power down the VM.
  2. Unplug and re-plug the Nortek HSUBZB-1 stick.
  3. In VirtualBox > VM > Settings > USB, the green plus sign brings up a list of the devices Windows can see. Select the Silicon Lans HubZ device.
  4. Edit the new Silicon Labs device to look like this (delete all of the field contents that were auto-populated except the ones in the following screenshot. I would leave your ProductID and other values if they’re different from mine.):

  1. Power on the VM.

Here’s how the devices look to Home Assistant in my setup.

Cheers

This worked for me with a CC2531 Dongle.

Treb