Installing Home Assistant on Hyper-V

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

  1. 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:
    • image
  2. Right-click on the downloaded .gz file, select “Properties”, check the “Unblock” checkbox and click OK.
  3. 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.
  4. Open Hyper-V Manager app on Windows 10.
  5. In the right pane, select Quick Create (at the top right).
  6. Choose “Local Installation Source” option for an OS and use the extracted .vhdx file.
    • image
  7. 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
    • image
    • Under the Security tab, make sure Secure Boot is disabled:
    • image
    • Under the Automatic Stop Action tab, change the setting to “Shut down the guest operating system”:
    • image
    • Finally, select the Automatic Start Action tab and set your preferred option:
    • image
  8. 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:

image

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.

  1. In Hyper-V manager, open the Virtual Switch Manager:
image
  1. Select “New Virtual Switch”, select “External” and click “Create Virtual Switch”
image
  1. 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.
image
  1. Back in Hyper-V manager’s VMs list, right click on the VM and select Settings:
image
  1. In the Settings window, select the Network Adapter tab and change the Virtual Switch setting to use the new “External Switch” you just created:
image

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’:

A list of the devices on my network, the Hyper-V machine should appear 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.

image

14 thoughts on “Installing Home Assistant on Hyper-V

  1. Brad says:

    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?

    Reply
    1. Lance says:

      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)

      Reply
  2. Sam says:

    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

    Reply
    1. Lance says:

      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.

      Reply
  3. BT says:

    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

    Reply
    1. Lance says:

      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.

      Reply
  4. Rich says:

    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?

    Reply
  5. Clint says:

    Thank you… worked great.
    Default login “root”
    No password

    Reply
  6. Alex Balcanquall says:

    did you ever install Linux Integration Services into the image?

    Reply
    1. Lance says:

      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

      Reply
  7. Dennis says:

    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?

    Reply
    1. Lance says:

      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

      Reply
      1. Dennis says:

        Thanks. I did get it working with a re-install. Thanks again for an excellent tutorial

        Reply

Leave a Reply to Lance Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.