In this guide, I’m going to show you how to install Home Assistant in Hyper-V on a Windows Server 2019 host. The Home Assistant team has already provided a pre-configured image for us to use, so creating this is really simple to get up and running. You can probably have this created from start to finish in less than 15 minutes.
There are a lot of popular ways to run Home Assistant. My preferred method is using the VMWare Workstation install because it supports USB passthrough, meaning I can use a Nortek GoControl zwave/zigbee dongle to control zwave and zigbee devices. However, you can’t have both Hyper-V and VMWare Workstation running on the same computer, so I have VMWare on my desktop and Hyper-V on my server.
Let’s get started!
Limitations of Home Assistant in Hyper-V
Like I mentioned earlier, the biggest disadvantage of installing Home Assistant on a Hyper-V VM is that USB passthrough isn’t supported. These means you can’t use an Aeotec zwave stick (or any other USB hub) to manage your zwave or zigbee devices.
There are some workarounds available, but for the most part – if you install Home Assistant in Hyper-V, plan on using wifi-only devices.
Or, if you are like me, I am setting up a 2nd Home Assistant instance. I ran into some issues with Frigate killing zwave/zigbee on my main Home Assistant install, so I’m installing in Hyper-V solely for the purpose of installing the Frigate addon.
This guide assumes that you already have a computer or server that has the Hyper-V role installed. If not, there are a ton of guides available on Google. Once Hyper-V is running, you can continue below.
Step 1: Download Home Assistant .VHDX image
To get started installing Home Assistant in Hyper-V, you first need to download the virtual hard disk (.vhdx) image that already has Home Assistant preinstalled.
Download that from here: https://www.home-assistant.io/installation/windows/
After clicking the Hyper-V link, a box will popup. Save this file to your Downloads folder.
Step 2: Create a VirtualMachines folder
Next, create a new folder in Windows. This is where you’re Hyper-V configuration files and the VHDX hard drive will be stored.
For this guide, I created a folder called homeassistant3 on my C:\ drive (C:\VirtualMachines\homeassistant3) You can name your folder whatever you want (mine is just called homeassistant3 because I had other folders already created during testing/creating this guide)
Right click the .zip file in your Downloads folder > Extract all. Then Browse to your C:\VirtualMachines\homeassistant3\ folder.
Step 3: Create Home Assistant Hyper-V VM
Open Hyper-V Manager. Right-click on your local server name (Danny-Server in the screenshot).
Then click New > Virtual Machine.
On the Before You Begin page, click Next.
On the Specify Name and Location page, give your VM a name (i.e. – homeassistant). Check the box for “store the virtual machine in a different location” and then enter the path you created in Step 2 (i.e. – C:\VirtualMachines\homeassistant3\). Then click Next.
On the Specify Generation page, choose Generation 2.
On the Assign Memory page, you can leave this as default 1024 for now (this can easily be changed later). Leave Use Dynamic Memory unchecked.
Under Configure Networking, select the dropdown and choose your network adapter. Note: If this is the very first VM you’ve ever created and nothing shows up here, you will first need to go into the Virtual Switch Manager settings of Hyper-V Manager and create a new External Switch.
On the Connect Virtual Hard Disk screen, choose Use an existing virtual hard disk. Then, browse to C:\VirtualMachines\homeassistant3 and select the .vhdx.
Then click Next and Finish. Congratulations! You’re VM is now setup and ready to start using.
There is one more thing you need to do before you power it on.
Step 4: Disable Secure Boot
Before you can boot your new VM, you first need to disable secure boot.
On your Hyper-V dashboard, you’ll see your new VM. Right-click it and go to Settings.
Under the Security section, uncheck Enable Secure Boot. Then click OK. The VM will not boot properly if you forget to do this.
Step 5: Start Home Assistant VM from Hyper-V Manager
To start your virtual machine, just right-click it and click Start.
Next, double-click the VM so you can what’s going on in a new window. You should see it running through a bunch of startup tasks.
If all goes well, then after a minute or so, it should land on a System Information page showing you the IP address of your Home Assistant instance:
Step 6: Launch Home Assistant in a Web Browser
If you made it to this screen, then all you need to do is enter the IP address and port into your web browser (i.e. – 192.168.68.133:8123). It will display a screen that says “Initializing, this may take up to 20 minutes” but in my experience, it took less than 1.
Once this screen goes away, you’ll be met with a user creation screen:
After creating a user, you’ll have a few additional first time parameters to setup, such as setting your timezone, currency, and whether or not you want to share analytics and statistic with the HA developers, etc.
Home Assistant can automatically attempt to start setting up devices on your network. Since this is just my 2nd instance and I’m only installing Frigate on it, I’m just going to click Finish.
And as you can see, Home Assistant has successfully been installed on a Hyper-V virtual machine in 2021!
Troubleshooting Home Assistant on Hyper-V Install
VM not booting: Disable secure boot (see step 4)
Not loading IP address/hostname in browser: Open Command Prompt and type
ipconfig /flushdns or use a Google Incognito browser.
hostname conflicts: If you are setting this up as a secondary Home Assistant instance, then it’s possible you have two devices on your network with the default name “homeassistant”. You can change the hostname of your main instance under Supervisor>System>Host.
VM still not working: If all else fails, create a brand new VM and try it again.
The first time I set this up in Hyper-V, I didn’t disable secure boot. After turning the VM off and disabling it, I still couldn’t load the instance in a web browser, so I resorted to creating another brand new VM and ensuring to turn off secure boot BEFORE starting it. After that, it launched exactly as expected.
Now that you’ve got everything configured correctly, I urge you to look through some of my 50+ other Home Assistant tutorials. I’m sure you’ll find something fun and useful to include in your own Home Assistant setup.
If you run into any issues while following my guide, please let me know in the comments below! I’d be happy to help you out.
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.
- Zwave/Zigbee hub: Nortek GoControl HUSBZB-1
- Smart Plugs: Sonoff S31 Lite Zigbee
- Motion Sensors: Hue Indoor Motion
- Outdoor Camera: Amcrest IP5M Turret
- Robot Vacuum: Roborock S7
The full list of all Home Assistant compatible & recommended devices I use can be found on my Equipment List page.