This post is a quick tutorial you can follow to get Home Assistant working on Hyper-V so you can take advantage of your PC’s compute power instead of running it on a Raspberry Pi. This installation method is really quick and doesn’t require any command line setup.
Important: If you want to use USB devices in Home Assistant, please this different tutorial -> USB Support for Home Assistant on Hyper-V. The approach used in this article doesn't allow for USB devices.
Step 1 – Create Hyper V Machine
- Download the VHDX file (hassos_ova-[version].vhdx.gz) from the home-assistant GitHub Releases page.
- I recommend only using the latest non-beta release so you won’t have trouble with HA’s built-in updater. As of writing this, that is version 3.13:
- Right-click on the downloaded
.gz
file, select “Properties”, check the “Unblock” checkbox and click OK. - Extract the .vhdx file from the
.gz
file (you can use 7-Zip to do this). Don’t worry about where you extract it to, Hyper-V will make a copy. - Open Hyper-V Manager app on Windows 10.
- In the right pane, select Quick Create (at the top right).
- Choose “Local Installation Source” option for an OS and use the extracted
.vhdx
file. - You’ll be presented with the VM’s Settings window before starting it up. Here are some recommendations:
- In the Memory tab, set the RAM to at least 2048 MBs or higher and disable Dynamic Memory
- Under the Security tab, make sure Secure Boot is disabled:
- Under the Automatic Stop Action tab, change the setting to “Shut down the guest operating system”:
- Finally, select the Automatic Start Action tab and set your preferred option:
- Start the machine and wait for initial setup to complete and you see the Welcome to HassOS prompt.
At this point, you should see the following:
You’re finished with the installation, theres one more thing to do so that you can access the machine from your network
Step 2 – Setup External Network Switch
The Default switch that comes with a HyperV machine doesn’t have access to the network that the host PC is using. You can easily add a new adapter and bridge it to the PC’s adapter.
- In Hyper-V manager, open the Virtual Switch Manager:
- Select “New Virtual Switch”, select “External” and click “Create Virtual Switch”
- When it’s created, you’ll see it in the left pane, select it to change the settings. First, give it a recognizable name, like “External Switch”. Next, select the External Network radio button and choose the network adapter that you want the new switch to use (in the screenshot below, you can see I chose the PC’s wireless adapter). Finally, click OK to save the changes.
- Back in Hyper-V manager’s VMs list, right click on the VM and select Settings:
- In the Settings window, select the Network Adapter tab and change the Virtual Switch setting to use the new “External Switch” you just created:
Result
Now you can connect to Home Assistant because it is available on the network (that is connected to the same adapter you chose for “External Switch”). It should be visible on the netowrk as ‘homeassistant’:
You can now access the machine using the IP address, plus the Home Assistant port “8123” (e.g. http://the_ip_address:8123
) to start the onboarding experience.
I did this and it worked great. However I am trying to setup certbot for SSL access which needs SSH. How do I get SSH access in my Hyper-V environment?
The VM will have its own IP address, this is how you can SSH/SMB/FTP into the machine. To see the IP address, the fastest option is from the CLI (e.g. ifconfig) or check the HyperV manager (click the machine, look at the bottom, select the Networking tab)
Hi,Lance
This is Sam, a developer from Microsoft UWP win10. I have some questions about the pricing of Microsoft Store setup add-ons. Can I ask you about them?
Many thanks
Hi Sam, I’m not sure what exactly you’re asking about. How to price your add-ons? They are extra listings under your published app in partnercenter.microsoft.com. You can set each IAP’s listing just like you can do for an app; price, listing visibility, regions, etc.
Thanks for the simple install steps. I did this a few months ago and all was good. but now – how do I update the version of Home Assistant?
Thanks for any help
Sorry for the delay, spam pushed this to the bottom 🙁 The Supervisor will do that for you. when there’s an update to Home assistant core or Home assistant Supervisor, it will appear in the supervisor tab.
Great article thanks! Do you know if there is a way to share a USB Z-wave stick to the VM via Hyper-V so I can setup a Z-Wave network that can connect to Home Assistant?
Try this https://redmondmag.com/articles/2018/05/17/usb-passthrough-in-hyperv.aspx (for storage thumb drives) and for other USB devices like Zwave, try USB Redirector https://www.incentivespro.com/hyper-v-usb.html. I found the easiest software to install and use was https://www.net-usb.com/virtual-usb/hyperv-usb-passthrough/
Thank you… worked great.
Default login “root”
No password
did you ever install Linux Integration Services into the image?
I haven’t needed to do it, but I imagine this depends on what the host system is. If you’re going to choose the Debian-first route (see my other post https://dvlup.com/2020/10/23/usb-in-hyper-v/), then it’s a bit easier because you have full access to the host. If you are going to take the virtual appliance route (this post’s guidance), then you are at the mercy of what the Supervisor offers you.
at the end of the day, if you’re trying to use the Integration Services to get USB support, I still do not know of a way to do this directly (without USB over IP) https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/supported-debian-virtual-machines-on-hyper-v
Thanks for the great tutorial. I have just one problem: I have installed HACS via SSH and the HACS files are present in the “custom_components” directory. but HACS does not appear in the Home Assistant menu. What can I do to get access to HACS with this installation?
You need to pay attention to which type of Home assistant you’re running in order to choose the specific HACS installation method. In this case, you’re running Home Assistant OS, so you can use HACS’s own install script (instructions here https://hacs.xyz/docs/installation/installation/#home-assistant-os). Since you’re not too invested already, I would recommend deleting everything you’ve done for HACS so far, and run that script.
If you did use the install script, I’m afraid I’m not sure what might have went wrong. The FAQ does say it can take up to an hour for HACS during it’s initial setup https://hacs.xyz/docs/faq/initial_startup
Finally, my best advice for getting help with individual problems is the excellent Home Assistant Discord (https://discord.gg/MXNmftrj) and specifically for HACS, use the HACS Discord (invite here https://discord.com/invite/apgchf8).
If you ask any questions, be sure to include the fact that you’re running Home Assistant OS
Thanks. I did get it working with a re-install. Thanks again for an excellent tutorial