Beginner's Guide: How to Install Home Assistant on the Oracle Virtual Box

In this post, I will demonstrate to you the easiest way to evaluate Home Assistant on a PC. In the end, we’ll have a fully operational copy of Home Assistant (Hass.io flavor), which is accessible via browser in your home network.

Terminology

  • Home Assistant (HA) - a top ten’s fastest-growing open-source project (as of 2019) of home automation system written on Python language. It carries on a huge number of components to integrate with the most if not all devices and services on the market
  • Guest - a Virtual Machine with Home Assistant installed
  • Host - a computer with Microsoft Windows/Linux/macOS, with Oracle VirtualBox installed

Hass.io - the framework consisting of a few Docker containers which make it easier to install and upgrade Home Assistant and allows you to install tenths of Hass.io addons literally in a mouse click.

The screenshots below were taken from macOS version of Oracle VirtualBox, though it should work the same way in other operating systems like Windows or Linux.

Step 1: Install Oracle VirtualBox and Use an Official Hass.io Image

First of all, we need to download an installation package for your OS here and install it. Then go to Home Assistant site and pick up an official VM image, the one you want is “VDI”.

Create a new VM (guest) in Oracle VirtualBox, specify Linux 64 bit as “OS Type” and allocate 2-4 Gb of RAM for better performance.

image-20200119230223619

Choose your downloaded VM image in the guest’s storage settings:

image-20200119230332092

Finish the creation wizard, but don’t start your guest yet.

Step 2: Set Up The Virtual Machine

To access Home Assistant UI, we have to adjust the network settings of our guest. Open the Settings and change Network settings so that the guest uses Bridged Adapter instead of NAT:

image-20200119230828599

Another important setting is to Enable EFI in the System tab. Without it your guest will not be able to boot:

image-20200119154008699

Step 3: Run It

Start your guest and open the following URL in your browser: http://xx.xx.xx.xx:8123, where хх.xx.xx.xx is the IP address, assigned to your guest. If you don’t know it, the easiest way is to check the list of devices in your home router/access point settings. If your hardware is not up-to-date, the first boot process may take a few minutes as it includes download and install of recent Hass.io image from the net.

Step 4: Using Hass.io Command Line

Since you have access to the guest console, you may also ssh to the Hass.io command line. One has to realize that this is not the full access to the host OS command line. Instead, this is Hass.io command line toolset which is running inside a container.

In order to access it, open the guest console and hit Enter to see the welcome prompt:

Welcome to HassOS
hassio login:

Type root and press Enter to login to the Hass.io.

image-20200121101804014

Try to type help to get the list of available commands. You may also edit the configuration file of your Home Assistant instance by the following command:

nano /config/configuration.yaml

To leave the editor, Ctrl+x hotkey can be used.