Coder Social home page Coder Social logo

home-assistant-vm-guide's Introduction

Installing Home Assistant on VirtualBox

Updated guide to setting up Home Assistant in Oracle VirtualBox on a Windows 10 host system.

Based on a orginal guide (Installing_HASSOS_on_VirtualBox.pdf) written by Mark M for DrZzs' livestream. Rob also did a great walkthrough on his YouTube channel The Hook Up.

1. Installation

Download VirtualBox & VirtualBox Extension Pack here

Right click (Run as Administrator) on the executable you downloaded e.g.VirtualBox-6.1.10-138449-Win.exe

Once complete double click on Oracle VM VirtualBox Extension Pack

2. Download Home Assistant Image file

Goto Installing Home Assistant page and download the VMDK file under virtual appliance bullet.

3. Setup your virtual machine

Run the VirtualBox application then click the ​New​ button

New VM

Give your machine a name (avoid using spaces). This name will also be the name of the folder that the disks and configuration files will be stored. The default location for this is C:\Users<username>\VirtualBox VMs. You can change the default location in "Machine Folder:"

  • Choose Type: Linux
  • Choose Version: Ubuntu (64-bit)

Click "next"

New VM

Choose the amount of RAM you will be giving the guest, 2048Mb (2Gb) is recommended on a machine with 8Gb or more RAM. Click "next"

New VM

Choose a hard disk for the Virtual machine “​U​se an existing virtual hard disk file​” and click the folder icon on the right.

Image 4

Select the vmdk file downloaded previously if avaliable or click "Add" then browse to find the file. Then click “Choose”

Image 4b

then click “Create”

Image 4c

BEFORE we run the VM we need to make some configuration changes:

Click “File” >> “Virtual Media Manager”

Image 6

Then right click on the “hassos_ova-4.10.vmdk” image and then choose “Copy”

Image 7

Choose “VDI (VirtualBox Disk Image)” this is the native disk format for VirtualBox. Then click "Next"

Image 8

Give the disk a name e.g. hassos_vm (avoid using spaces). Then click "Copy"

Image 9

Expand your new .vdi disk, 32GB is the minimum recommended size. Drag the slider or type new size into the box then click "Apply", then "Close"

Image 7b

Click “Settings” then “Storage” tab. Click on the “Controller: SATA” then the “Add Disk” icon. Choose the VDI disk you created above.

Image 13

Image 14

Now you can delete the original .vmdk file you attached by selecting “hassos_ova-4.10.vmdk” and clicking the small disk with the red cross through it. And then hit “OK”

Image 15

Click on "Network" tab. Change it from “Nat Network” to “Bridged Adaptor” (if you have more than one network interface on your host make sure you select the one you want to use, usally the ethernet adaptor). Click on the blue triangle for "Advanced" settings. Change “Promiscuous Mode” from "Deny" to "Allow All”

Image 16

Click on the "System" tab and check “Enable EFI (Special OSes only)”. You have another opportunity to change the RAM allocation again here.

Image 12

Congratulations! Thats it, Now start your VM and wait a few minutes for it boot and configure itself.

Open your browser and go to the address http://homeassistant:8123/ if the above doesn’t connect you may have to wait a few minutes more or the problem may be that your router may not support mDns. If so you will need to log into your router and see which IP address was allocated to HASSIO.

4. Optional

Static IP address

To give the VM a static IP address, click on the VM window and press enter. It should now ask you for a login name and this is root This should give you the hassio prompt.

Now type login then hit enter.

Login

https://www.tecmint.com/configure-network-connections-using-nmcli-tool-in-linux/ https://manpages.ubuntu.com/manpages/bionic/en/man1/nmcli.1.html

nmcli c s
nmcli c e "HassOS default"
print ipv4
set ipv4.addresses [hassio ip address]/24
set ipv4.dns [router ip address]
set ipv4.gateway [router ip address]
save
quit

Power down your VM using Close > Acpi Shutdown

Shudown

Restart the VM and check you can access via new fixed IP address

Restore previous config

install samba

copy snapshot

hit refresh in top right of snapshot window

click on snapshot

"restore selected"

Auto Starting our VM

There are a couple of options to auto start our VM

Use a Windows Startup Shortcut

  1. Right click on the VM then click "Create Shortcut on Desktop"
  2. Win+R to bring up Run dialog then type shell:startup to bring up startup folder
  3. Move shortcut to VM from desktop to this startup folder
  4. The VM will not start until you login, so optionally you can get Windows to autologin (:warning:security warning). Do this by Win+R to bring up Run dialog then type netplwiz then uncheck the box "Users must enter a username and password to use this computer"

Windows Autologin

Run as a service using VmServiceControl

Setup a service to start our VM (downside: the VM doesn't show as running state in the VirtualBox application) but can be controlled via tray

  1. Download and install VmServiceControl from github: direct link here
  2. Open VBoxVmService.ini in your favourite text editor. Under Vm0 section edit the following entries:

VmName = <name of your virtual machine>
ShutdownMethod = acpipowerbutton

  1. Delete any un-needed blocks (e.g. Vm1) and save

VmServiceControl

  1. Bring up a command prompt by typing cmd into start menu, then selecting "Run as administrator"
  2. At the command prompt type:
C:\vms\VmServiceControl.exe -u
C:\vms\VmServiceControl.exe -i 

Any time the .ini is changed you will need to run these to commands to unload then reload the service.

  1. Open the vms folder and right click on VmServiceTray.exe and then "Copy"
  2. Win+R to bring up Run dialog then type shell:startup to open the startup folder
  3. Right click and then "Paste shortcut"
  4. Restart your computer and the VM should start automatically, before you even login.

VmService tray icon

That's it! I hope you found guide useful 😀

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.