So, you’re running Home Assistant on Hyper-V, and you’d like to enable USB passthrough. Maybe you’ve got a Zigbee or Z-Wave USB stick to control some smart home gadgets, or perhaps there’s another peripheral you need to connect. Unfortunately, Hyper-V doesn’t natively support USB passthrough the way other hypervisors like VirtualBox or VMware do. But don’t worry—where there’s a will, there’s a way! This guide will walk you through some creative workarounds to get USB passthrough up and running on Hyper-V for Home Assistant.
Why USB Passthrough for Home Assistant on Hyper-V?
Home Assistant, as a home automation platform, often relies on USB devices—especially for protocols like Zigbee, Z-Wave, and other smart home hubs. Without USB passthrough, these devices remain inaccessible, limiting the functionality of your setup. For Hyper-V users, enabling USB passthrough lets you integrate these critical USB components, bridging the gap between virtualized Home Assistant and the physical devices it controls.
Feature | Why It Matters |
---|---|
Access to USB Hubs | Essential for adding Zigbee/Z-Wave functionality and other local integrations. |
Peripheral Compatibility | Extends Home Assistant’s functionality by supporting hardware directly. |
Complete Automation | Unlocks full smart home capabilities without needing additional hubs. |
In Short: USB passthrough allows Home Assistant to reach its full potential, letting you interact with a wide range of smart home devices directly through Hyper-V.
Prerequisites for Setting Up USB Passthrough on Hyper-V
Before diving into the setup, make sure you have the following:
- Windows 10 Pro, Enterprise, or Server (Hyper-V is only available on these versions).
- A USB Device compatible with Home Assistant (e.g., Zigbee/Z-Wave stick).
- Home Assistant running on Hyper-V (either as a Virtual Machine or in a Docker container).
- Remote Desktop Connection or USB-over-IP software (we’ll go over these options below).
Option 1: USB-over-IP Software Solution
Since Hyper-V lacks built-in USB passthrough, one popular workaround is to use USB-over-IP software. This software allows your Windows host machine to share a USB device over the network, so the virtual machine can access it as if it were a local device.
Recommended Software: There are several tools you can use for this. VirtualHere and USB Network Gate are reliable, though both come with a price tag. Some users also have success with FlexiHub or USB/IP (an open-source solution).
Steps to Set Up USB-over-IP with VirtualHere
- Install the USB-over-IP Software on your Windows Host:
- Download and install VirtualHere (or your chosen software) on the Windows host where Hyper-V is running.
- Connect the USB Device:
- Plug your USB device (e.g., a Zigbee dongle) into the Windows host machine.
- Share the USB Device Over the Network:
- Open the VirtualHere server application on your host and select your USB device.
- Enable sharing for the device.
- Access the USB Device on the Hyper-V VM:
- Install the VirtualHere client on your Home Assistant VM.
- Use the client to connect to the shared USB device, which should now appear as an attached device.
Option 2: Using Remote Desktop Connection with Enhanced Session Mode
If you’re using Hyper-V on Windows 10 Pro or Enterprise, you may have access to Enhanced Session Mode. This option allows certain devices on the host machine (like USB) to be redirected to the VM via Remote Desktop. It’s less flexible than using USB-over-IP software, but it can work for specific devices.
Steps to Enable USB Redirection with Enhanced Session Mode
- Enable Enhanced Session Mode on Hyper-V:
- Open Hyper-V Manager.
- Select your host machine, then click on Hyper-V Settings in the right-hand menu.
- Under Enhanced Session Mode Policy, check Allow Enhanced Session Mode.
- Start the VM with Enhanced Session Mode:
- Start your Home Assistant VM, then connect to it with Enhanced Session Mode via Remote Desktop.
- During the connection, you’ll have options to enable local resources, including USB devices.
- Select your USB device (if available) and connect.
- Verify USB Device Access in Home Assistant:
- Open the Home Assistant interface.
- Verify that your USB device appears as an available device in the Home Assistant Supervisor > System > Hardware section.
Note: Enhanced Session Mode is hit-or-miss with specific USB devices, and it may not support all Zigbee or Z-Wave sticks. If this method doesn’t work, try USB-over-IP instead.
Option 3: USB Passthrough with USB-to-Serial Adapters
If your USB device can function as a serial device (e.g., Zigbee and Z-Wave sticks), you might be able to set it up through a USB-to-serial adapter. Many Zigbee and Z-Wave USB sticks register as serial ports, which Hyper-V can sometimes pass through directly.
Steps to Use a USB-to-Serial Adapter for Passthrough
- Plug in the USB Device:
- Connect your USB device to a USB-to-serial adapter and plug it into the host machine.
- Enable COM Port Mapping:
- In Hyper-V Manager, go to Settings > COM Ports on your VM and set the COM port that corresponds to your USB device.
- Configure the VM to pass through the serial COM port.
- Check Device Accessibility in Home Assistant:
- Boot up your Home Assistant VM.
- In Home Assistant, go to Supervisor > System > Hardware and look for the serial device (usually something like
/dev/ttyS1
or/dev/ttyS2
).
Limitations: Not all USB devices are compatible with this method, but it can work well for specific Zigbee and Z-Wave sticks.
Comparing the USB Passthrough Solutions for Hyper-V
To help you decide which method to use, here’s a quick comparison of the options:
Method | Best For | Ease of Setup | Cost | Compatibility |
---|---|---|---|---|
USB-over-IP Software | Broad device compatibility | Moderate | Varies (some paid, some free) | High |
Enhanced Session Mode | Basic USB devices | Simple | Free | Limited, not all USB devices |
USB-to-Serial Adapter | Serial devices (e.g., Zigbee, Z-Wave) | Moderate | Low | Limited to serial-compatible USB |
In Short: For the most reliable setup, USB-over-IP software provides high compatibility with a wide range of devices, but Enhanced Session Mode and USB-to-Serial adapters offer budget-friendly alternatives.
Verifying and Testing USB Devices in Home Assistant
Once you’ve chosen and configured your USB passthrough method, it’s essential to verify that Home Assistant can actually see and use the device.
- Check Device Detection in Home Assistant:
- Go to Supervisor > System > Hardware in Home Assistant.
- Look for your USB device (often listed as
/dev/ttyUSB0
or/dev/ttyACM0
for Zigbee/Z-Wave sticks).
- Add the Integration:
- In Settings > Integrations, search for the appropriate integration (e.g., ZHA for Zigbee or Z-Wave JS for Z-Wave).
- Select your USB device from the options and complete the integration setup.
- Test Functionality:
- Pair a device to test if Home Assistant can communicate effectively through the USB connection.
- Confirm that automations and controls work as expected with the new device.
Pro Tip: If Home Assistant doesn’t detect the USB device, try rebooting the VM or reconnecting the USB device to see if it resolves the issue.
Final Thoughts: Making USB Passthrough Work on Hyper-V
Setting up USB passthrough on Hyper-V for Home Assistant may not be the most straightforward task, but with these workarounds, you can make it work! Whether you opt for USB-over-IP software, Enhanced Session Mode, or a USB-to-serial adapter, each solution has its advantages.
So, plug in, configure, and automate! With your USB devices fully functional in Home Assistant on Hyper-V, you’ll be ready to enjoy all the perks of a smart home without the usual limitations of virtual machines.