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

8 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

Leave a 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.