Connecting RTL-SDR to Home Assistant in Virtual Box?

I have a copy of Home Assistant OS running in a VirtualBox VM. VirtualBox is running on Windows 10.

I would like to connect an RTL-SDR to use with rtl_433. Currently, I’m using a cc2531 for my Zigbee network. It was as easy as plugging it into the windows machine and then having VirtualBox attach it to the VM. Is it that simple with the RTL-SDR?

When typically using an RTL-SDR in windows with sdr# (sdr sharp) software you have to replace the autodetected windows driver with a custom one. Is something similar necessary to do before attaching it to the VM?

It seems like all the guides I seem to find are attaching the sdr to a PI.

Thanks

I’m thinking if HAOS has the drivers for the device then yes it should detect it.

Would you change the driver out to the custom one?

I could be wrong, but I don’t think that will be necessary as you won’t be using the Windows driver anyway.

It was not that easy.

After attaching the RTL-SDR to the VM rtl-433 is not finding any usable devices.

Any idea on how to add drivers to HAOS?

I don’t know; HAOS is very limited in that regards.

Do you see the device in the hardware list?

I got it going but it was a bit of a mess.

I’m using a VirtualBox VM. I’m running it as a windows service. It starts and shuts down with windows. Unfortunately, I can’t monitor the status of the VM while it’s running as a service, or at least I don’t know how yet. To modify any setting I have to shut down the service and start the VM from VirtualBox the normal way.

Initially, when I would plug in the dongle I would get a new Realtek device. This was the device I attached to the VM. It anything but worked. It further even stopped my CC2531 zigbee dongle from working. Today I fired it up and payed with it. What I found was when I attached the Realtek device a new Realtek device would appear. If I attached the second Realtek device rtl_433 would start working.

This brought me to my second problem. The setup was unstable, the second Realtek device would sometimes work, sometimes wouldn’t. It often would interfear with the zigbee dongle. I could only run HA from VirtualBox and not as a service.

As a last ditch effort I installed the custom driver. The Realtek dongle seems to have two endpoints, 0 and 1. The driver is installed to endpoint 0. This seems to have stabalized the syste. I attached the zigbee dongle and the second Realtek device in the VM. Then I rebooted the full windows machine. Both dongles started working.

Nice work, I’m running the same exact setup and you’re correct, you cannot monitor the running state through the VB GUI when using the service. If you try to load the VB GUI while the service is running, it will take forever to load, and it shows a non-running VM, It’s an all-or-nothing solution.

I really like using the service though, as it’s easier for me to handle VM backup functions through Acronis each night.

The windows driver thing does makes sense now, as even though VB captures the device for use by the VM client, I think it would still need to communicate with the host os.

I discovered with my Sonoff 3.0 Zigbee and Zooz z-wave sticks, each would get captured by VB sometimes while other times neither (I watch device manager) It was very strange issue and took me hours and hours to figure out what was happening.

The solution for me was going into the device management properties (windows device manager) and un-ticking the Allow windows to put this device to sleep setting, even though under power management I have it set globally to NOT put USB devices to sleep)

Thanks for the followup.

I am running into the same problem and have tried the solutions listed here. The RTL-SDR shows up in VM and I select it for passthrough but the hardware will not show in HA at all. I’ve tried removing the Zwave and Zigbee Sticks so it is the only stick and still won’t show under HA hardware. I also have the problem with the RTL and Zigbee plugged in at the same time where the Zigbee won’t work. Any further suggestions would be appreciated, thanks.

Have you installed the custom driver?

Yes, that was the first thing I did was get it working in Windows 11. I installed it to interface (0) as has been suggested in many forums. It works fine in Spektrum in Windows. Now when I put into VM passthrough it changes its name from “Bulk-In, Interface” to “VirtualBox USB” like my Zigbee and Zwave sticks, as highlighted in the lower screenshot. For whatever reason it will not not show up in HA hardware.

image

For four days now I’ve got this up and running, so I wanted to post what I did for others who may be having difficulties.

As mentioned in the previous post you have to get the Windows Driver up and running by using Zadig.

Virtual Box seems kind of flakey in the way it passes USB devices through. What I did was erase all of the USB devices I was passing through. I then selected the last Controller Option which is circled below. From there I added the USB devices back in, ensuring the RTL-SDR device was at the top. Once this was done HA recognized the RTL and the Zigbee stick was also working together with the RTL.

1 Like