Установка home assistant на windows 10 virtualbox

Есть много разных способов как можно установить Home Assistant.

Какой способ использовать — зависит от ситуации. В разных ситуациях
разные способы предпочтительны.

Один из способов как можно установить Home Assistant — это использовать бесплатную программу VirtualBox.
На компьютере появляется виртуальная машина в которой работает Home Assistant.

Большой плюс этого способа в том что нужно выполнить очень мало действий для
того чтобы получить работающий Home Assistant. На мой взгляд, это самый
простой и быстрый способ установки. Результат — вы получаете Home Assistant,
который установлен официальным способом, в котором работает Supervisor.
(специальный компонент, с помощью которого удобно управлять некоторыми частями Home Assistant. Не во всех
способах установки он доступен.)

Установка Home Assistant в VirtualBox хорошо подходит в ситуациях:

  • Вы еще не работали с Home Assistant и хотите поэкспериментировать с ним без необходимости покупать отдельный компьютер специально для Home Assistant
  • У вас уже есть работающий сервер Home Assistant, но вы хотите поднять тестовый сервер на котором проводить всякие опыты.

Этот способ нельзя использовать для того чтобы поставить Home Assistant на Raspberry Pi.

Запуск в VirtualBox это, скорее, экспериментальный запуск, хотя могут быть и исключения.
Можно держать основной сервер Home Assistant в VirtualBox, но обычно так не делают.

План

Установка Home Assistant в VirtualBox состоит из следующих частей:

  • установить на компьютер VirtualBox
  • скачать файл с образом Home Assistant
  • создать виртуальная машину
  • запустить виртуальную машину
  • выяснить ip адрес
  • зайти браузером в интерфейс Home Assistant

Установить на компьютер VirtualBox

Нужно зайти на страницу https://www.virtualbox.org/wiki/Downloads
и скачать файл-инсталлятор для вашей операционной системы, запустить его и пройти весь процесс установки.

Скачать файл с образом Home Assistant

Нужно зайти на страницу https://www.home-assistant.io/hassio/installation/
и скачать с этой страницы файл по ссылке «VMDK».

Размер файла — около 300 мегабайт.

У файла который скачался расширение «.vmdk.gz». Это архив. Нужно разархивировать
этот файл.

Создать виртуальная машину

Запускаем VirtualBox, там нажимаем кнопку New.

  • Name — вводим «ha»
  • Type — меняем на «linux»
  • В качестве жесткого диска выбираем файл c расширением «.vmdk»
  • И нажимаем кнопку «Create»

После этого в VirtualBox появилась виртуальная машина с именем «ha» в статусе «Выключена».

Но перед тем как ее включить нужно выполнить еще несколько настроек.

Нужно зайти в настройки и поставить чекбокс «Enable EFI»:

Если чекбокс «Enable EFI» не установить, то при попытке включить
виртуальную машину будет ошибка: «FATAL: No bootable medium found! System halted.»:

Вторая настройка которую нужно сделать — поменять настройки сети.
По умолчанию установлен «NAT», нужно выбрать «Bridged Adapter»:

С этой настройкой можно виртуальная машина станет частью вашей локальной сети.

Запустить виртуальную машину

Кнопка «Start»

Очень быстро система загрузится и на экране будет текст «homeassistant login:»
(возможно понадобится несколько раз нажать на клавишу Enter на клавиатуре
чтобы стал виден этот текст).

Все — Home Assistant работает. Но нужно выяснить адрес где он работает.

Выяснить ip адрес

Выяснить ip адрес виртуальной машины можно либо с помощью веб интерфейса роутера,
либо выполнив несколько команд в консоли виртуальной машины.

На приглашение «homeassistant login:» нужно ввести слово «root» и
нажать на клавишу Enter на клавиатуре. После этого вы сразу попадете в консоль
Home Assistant.

В этой консоли нужно ввести слово «login»:

И после этого ввести «nmcli» — в результате на экране будет виден ip адрес
этой виртуальной машины:

В моем случае это адрес 192.168.31.170

Зайти браузером в интерфейс Home Assistant

После того как известен ip адрес можно браузером зайти в интерфейс Home Assistant.

Для этого нужно ввести в браузере http://IP:8123 (вместо IP нужно подставить тот
ip адрес, который вы выяснили на предыдущем шаге, например http://192.168.31.170:8123 )

Дальше нужно придумать имя и пароль и начинается самое интереснео — настройка Home Assistant.


Install Home Assistant Operating System

Download the appropriate image

  • VirtualBox (.vdi)

  • KVM (.qcow2)

  • Vmware Workstation (.vmdk)

  • Hyper-V (.vhdx)

After downloading, decompress the image. If the image comes in a ZIP file, for example, unzip it.

Follow this guide if you already are running a supported virtual machine hypervisor. If you are not familiar with virtual machines, we recommend installing Home Assistant OS directly on a Home Assistant Yellow, a Raspberry Pi, or an ODROID.

Create the virtual machine

Load the appliance image into your virtual machine hypervisor. (Note: You are free to assign as much resources as you wish to the VM, please assign enough based on your add-on needs).

Minimum recommended assignments:

  • 2 GB RAM
  • 32 GB Storage
  • 2vCPU

All these can be extended if your usage calls for more resources.

Hypervisor specific configuration

VirtualBox

KVM (virt-manager)

KVM (virt-install)

Vmware Workstation

Hyper-V

  1. Create a new virtual machine.
  2. Select type Linux and version Linux 2.6 / 3.x / 4.x (64-bit).
  3. Select Use an existing virtual hard disk file, select the unzipped VDI file from above.
  4. Edit the Settings of the VM and go to System > Motherboard. Select Enable EFI.
  5. Then go to Network > Adapter 1. Choose Bridged Adapter and choose your network adapter.

Please keep in mind that the bridged adapter only functions over a hardwired Ethernet connection.
Using Wi-Fi on your VirtualBox host is unsupported.

6. Then go to **Audio** and choose **Intel HD Audio** as audio controller.

By default, VirtualBox does not free up unused disk space. To automatically shrink the vdi disk image
the discard option must be enabled using your host machine’s terminal:

VBoxManage storageattach <VM name> --storagectl "SATA" --port 0 --device 0 --nonrotational on --discard on

More details can be found about the command can be found here.

  1. Create a new virtual machine in virt-manager.
  2. Select Import existing disk image, provide the path to the QCOW2 image above.
  3. Choose Generic Default for the operating system.
  4. Check the box for Customize configuration before install.
  5. Under Network Selection, select your bridge.
  6. Under customization select Overview > Firmware > UEFI x86_64: …. Make sure to select a non-secureboot version of OVMF (does not contain the word secure, secboot, etc.), e.g., /usr/share/edk2/ovmf/OVMF_CODE.fd.
  7. Click Add Hardware (bottom left), and select Channel.
  8. Select device type: unix.
  9. Select name: org.qemu.guest_agent.0.
  10. Finally, select Begin Installation (upper left corner).
virt-install --name hass --description "Home Assistant OS" --os-variant=generic --ram=2048 --vcpus=2 --disk <PATH TO QCOW2 FILE>,bus=sata --import --graphics none --boot uefi

If you have a USB dongle to attach, you need to add the option `—hostdev busID.deviceId`. You can discover these IDs via the `lsusb` command.
As example, if `lsusb` output is:

   Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
   Bus 003 Device 004: ID 30c9:0052 Luxvisions Innotech Limited Integrated RGB Camera
   Bus 003 Device 003: ID 1a86:55d4 QinHeng Electronics SONOFF Zigbee 3.0 USB Dongle Plus V2
   Bus 003 Device 002: ID 06cb:00fc Synaptics, Inc. 
   Bus 003 Device 005: ID 8087:0033 Intel Corp. 
   Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
   Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
   Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

You can recognize the Sonoff dongle at Bus 003 Device 003. So the command to install the VM will become:

virt-install --name hass --description "Home Assistant OS" --os-variant=generic --ram=2048 --vcpus=2 --disk <PATH TO QCOW2 FILE>,bus=sata --import --graphics none --boot uefi --hostdev 003.003

Note that this configuration (bus 003, device 003) is just an example, your dongle could be on another bus and/or with another device ID.
Please check the correct IDs of your USB dongle with lsusb.

  1. Create a new virtual machine.
  2. Select Custom, make it compatible with the default of Workstation and ESX.
  3. Choose I will install the operating system later, select Linux > Other Linux 5.x or later kernel 64-bit.
  4. Select Use Bridged Networking.
  5. Select Use an existing virtual disk and select the VMDK file above.

After the VM has been created, go to Settings > Options > Advanced. Under Firmware type select UEFI.

Hyper-V does not have USB support

  1. Create a new virtual machine.
  2. Select Generation 2.
  3. Select Connection > Your Virtual Switch that is bridged.
  4. Select Use an existing virtual hard disk and select the VHDX file from above.

After creation, go to Settings > Security and deselect Enable Secure Boot.

Start up your virtual machine

  1. Start the virtual machine.
  2. Observe the boot process of the Home Assistant Operating System.
  3. Once completed, you will be able to reach Home Assistant on homeassistant.local:8123. If you are running an older Windows version or have a stricter network configuration, you might need to access Home Assistant at homeassistant:8123 or http://X.X.X.X:8123 (replace X.X.X.X with your ’s IP address).

Help us improve Home Assistant

Have you just installed Home Assistant? The Home Assistant team is looking to talk to you to understand how the installation went.

With the Home Assistant Operating System installed and accessible, you can continue with onboarding.

Install Home Assistant Core

Install WSL

To install Home Assistant Core on Windows, you will need to use the Windows Subsystem for Linux (WSL). Follow the WSL installation instructions and install Ubuntu from the Windows Store.

As an alternative, Home Assistant OS can be installed in a Linux guest VM. Running Home Assistant Core directly on Windows is not supported.

This is an advanced installation process, and some steps might differ on your system. Considering the nature of this installation type, we assume you can handle subtle differences between this document and the system configuration you are using. When in doubt, please consider one of the other installation methods, as they might be a better fit instead.

Prerequisites

This guide assumes that you already have an operating system setup and have installed Python 3.11 (including the package python3-dev) or newer.

Install dependencies

Before you start, make sure your system is fully updated, all packages in this guide are installed with apt, if your OS does not have that, look for alternatives.

sudo apt-get update
sudo apt-get upgrade -y

Install the dependencies:

sudo apt-get install -y python3 python3-dev python3-venv python3-pip bluez libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata ffmpeg liblapack3 liblapack-dev libatlas-base-dev

The above-listed dependencies might differ or missing, depending on your system or personal use of Home Assistant.

Create an account

Add an account for Home Assistant Core called homeassistant.
Since this account is only for running Home Assistant Core the extra arguments of -rm is added to create a system account and create a home directory.

sudo useradd -rm homeassistant

Create the virtual environment

First we will create a directory for the installation of Home Assistant Core and change the owner to the homeassistant account.

sudo mkdir /srv/homeassistant
sudo chown homeassistant:homeassistant /srv/homeassistant

Next up is to create and change to a virtual environment for Home Assistant Core. This will be done as the homeassistant account.

sudo -u homeassistant -H -s
cd /srv/homeassistant
python3 -m venv .
source bin/activate

Once you have activated the virtual environment (notice the prompt change to (homeassistant) homeassistant@raspberrypi:/srv/homeassistant $) you will need to run the following command to install a required Python package.

python3 -m pip install wheel

Once you have installed the required Python package, it is now time to install Home Assistant Core!

pip3 install homeassistant==2023.10.1

Start Home Assistant Core for the first time. This will complete the installation for you, automatically creating the .homeassistant configuration directory in the /home/homeassistant directory, and installing any basic dependencies.

You can now reach your installation via the web interface on http://homeassistant.local:8123.

If this address doesn’t work you may also try http://localhost:8123 or http://X.X.X.X:8123 (replace X.X.X.X with your machines’ IP address).

When you run the hass command for the first time, it will download, install and cache the necessary libraries/dependencies. This procedure may take anywhere between 5 to 10 minutes. During that time, you may get a site cannot be reached error when accessing the web interface. This will only happen the first time. Subsequent restarts will be much faster.

Help us to improve our documentation

Suggest an edit to this page, or provide/view feedback for this page.

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 (⚠️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 😀

В последнее время, мне как-то надоедает включать свою домашнюю виртуализацию, базирующуюся на Debian 10 + Proxmox 6 и работать с VM из-под браузера. Может конечно если что-то масштабное, то да. А вот с целью побыстрее обкатать то можно на рабочем месте использовать Virtualbox (я против использования Hyper-V)

Итак, рабочая Windows 10 Pro (Version 10.0.18363.592)

Железо:

  • Intel® Core™ i3-2120 CPU @ 3.30GHz
  • RAM: 8Gb
  • HDD: 250 SSD Samsung
  • Motherboard: Asus P8H61-M LX3 R2.0

Шаг №1: На рабочую Windows 10 Pro устанавливаю VirtualBox 6.1.12 (VirtualBox-6.1.12-139181-Win.exe)

Шаг №2: Скачиваю с официального сайта Home Assistant на момент (05.08.2020) написания данной заметки vmdk файл hassos_ova-4.11.vmdk.gz (его вес 243 395 КБ), распаковываю получается файл hassos_ova-4.11.vmdk (его вес 752 128 КБ)

Шаг №3: Создаю VM через Virtualbox

Virtualbox – Машина – Создать

  • Имя: srv-ha
  • Папка машины: C:\VM
  • Тип: Linux
  • Версия: Other Linux (64-bit)

И нажимаю "Экспертный режим", указываю количество выделяемой данной VM оперативной памяти, к примеру 1024 и Жесткий диск выбираю "Использовать существующий виртуальный жесткий диск""Выбрать образ виртуального жесткого диска"Добавить – выбираю распакованный в C:\VM\hassos_ova-4.11.vmdk и нажимаю "Открыть""Выбрать" — и нажимаю "Создать"

Создаю VM через Virtualbox для Home Assistant

После пока VM еще выключена изменять (через меню "Настроить" на VM) тип сетевого адаптера с

  • Адаптер 1: Intel PRO/1000 MT Desktop (NAT)

На "Сетевой мост".

После запускаю VM путем нажатия на кнопку "Запустить"

На заметку: Если после запуска идет надпись в консоли VM "FATAL: No bootable medium found! System halted", то это значит нужно выключить VM: Машина – Завершить работу, открыть опять "Настроить" и в меню "Система" — вкладка "Материнская плата" и отменить галочкой

  • Включить EFI (только специальные ОС): включить галочкой

И нажимаю ОК, а затем нажимаю "Запустить". Вижу, как бегут строки загрузки VM

Виртуальная машина загружается, ожидаю...

После в консоли нажимаю клавишу Enter и вижу приглашение на авторизацию:

homeassistant login: указываю учетную запись root

И нажимаю клавишу Enter

После вижу приглашение:

Welcome on Home Assistant command line

ha > В этой консоли нужно ввести слово "login":

# набираю команду nmcli и вижу свой IP адрес, полученный от моего DHCP-сервиса в локальной сети

Отображение текущего IP адреса у Вашего Home Assistant под Virtualbox

Шаг №4: Теперь зная этот адрес я могу в своей локальной сети обратиться к сервису Home Assistant посредством браузера через URL строку: http://IP&DNS:8123 (http://192.168.10.185:8123)

http://192.168.10.185:8123/onboarding.html — создаю первый раз учетную запись пользователя

  • Имя: ekzorchik
  • Логин: ekzorchik
  • Пароль: 712mbddr@
  • Подтвердите пароль: 712mbddr@

И нажимаю "Создать учетную запись"

Именую свой Home Assistant: к примеру, как ekzhome

  • Часовой пояс: Europe/Moscow

И нажимаю "Далее" - "Готово"

После чего передо мной развернутый из заводского образа разработчиков система домашней автоматизации под Virtualbox операционной системы Windows 10 Pro. Когда у меня выдается свободные минуты я разбираю на работе что-то полезное для себя, как процесс самообразования:

Home Assistant успешно развернут внутри Virtualbox и готов к эксплуатации

Итого я в шагах задокументировал для себя, как под Virtualbox быстро и легко развернуть Home Assistant дабы иметь тестовый полигон настройки чтобы в последствии переносить только реально работающие решения и не засорять боевую систему. Так делаю я, да это почти двойная работа, но что в эксплуатации не должно страдать от тестов. На этом моя заметка завершена, с уважением автор блога Олло Александр aka ekzorchik.


I’m going to install Home Assistant on Windows using VirtualBox. It may sound complicated, but it is not and I will show you everything step-by-step.

Home Assistant on Windows using VirtualBox Guide

I decided to move my Home Assistant installation from raspberry to a desktop PC to test is it going to be faster and more stable. It doesn’t matter If you are getting started with a fresh Home Assistant installation or just like me you want to migrate to a more powerful machine. This guide is tailored for you!

Table of Contents

I’m will use VirtualBox on Windows 10, but you can use Linux or MacOS as your VirtualBox host and all of the steps that you will see in this video will be pretty much the same.

So let’s go:

Download and install VirtualBox for your OS

Nothing fancy here, just go to VirtualBox website then download and install the package for your Operating System. In my case this is Winodws.

If you have any difficulties with this step check my video above for detailed instructions.

Download Home Assistant Image file

Open the following link https://www.home-assistant.io/hassio/installation/ and download the VDI file under “As a virtual appliance (x86_64/UEFI)” bullet.

This is the virtual disk image that contains everything we need to start our Home Assistant on Windows.

Configure and install Home Assistant

To prevent yourself from issues in the future with not enough virtual storage, because by default Home Assistant VirtualDisk is 6GB only it is recommended to execute these several steps first.

Add the downloaded Home Assistant VDI image to Virtual Media Manager.

Home Assistant on Windows using VirtualBox Guide 1

You will need VirtualBox 6 or higher to have this Virtual Media Manager option.

You can increase the size to whatever is suitable for you. In this example the size will be increased to 100GB.

Increasing the initial size of the Home Assistant virtual disk to prevent disk space issues in the future.

Increasing the initial size of the Home Assistant virtual disk to prevent disk space issues in the future.

Apply the changes and you should have something similar (of course your VDI version will be different, newer not 3.13)

Increased Home Assistant Virtual Disk Size to avoid no free disk space in the future.

Increased Home Assistant Virtual Disk Size to avoid no free disk space in the future.

Next, create New Virtual Machine in VirtualBox application.

Clicking on the new button

Click on the new button.

After that type a name for you virtual machine and choose either Other Linux 32-bit or 64-bit depending of your system.

Choose Name and "Other Linux" here

Choose Name and “Other Linux” here

On the next dialog select the amount of RAM that you want to dedicate for this virtual machine. Absolute minimum should be 512MB.

Selecting the amount of RAM for the Home Assistant Virtual Machine

Selecting the amount of RAM for the Home Assistant on Windows Virtual Machine

The good think about this setting is that you can increase or decrease it at later stage if there is such need.

For the hard disk select the “Use an existing virtual hard disk file”.

Home Assistant on Windows using VirtualBox Guide 2

On the next dialog click on the “Add” button

Home Assistant on Windows using VirtualBox Guide 3

To add the VDI file just click Add.

At the end you should see something similar like the picture below, if you resize your VDI the digit under Virtual Size should mach your desired size.

Home Assistant Operating System image file added to VirtualBox

Home Assistant Operating System image file added to VirtualBox

Your final step here is to click the “Create” button.

Before you click “Start” button

Next we have to change some settings in VirtualBox to run our Home Assistant on Windows.

Click on the gear-wheel with the label “Settings” inside VirtualBox window.

In the “System” section under “Motherboard” tab click on “Enable EFI” option.

Home Assistant on Windows using VirtualBox Guide 4

In the “System” section under “Motherboard” tab click on “Enable EFI” option.

Then click on the Network tab and change from Nat Network to Bridged Adapter – this will allow using your home network IP. 

Selecting Bridged Adapter

Selecting Bridged Adapter

Of course you can increase your virtual processors/cores if your host system allows that, but I don’t see point to put here more than 2 processor. You can find this section again in System -> Processors.

When you are ready with everything click “OK”

Now you can freely click “Start” button (BIG green arrow pointed at right) to start Home Assistant on Windows as a Virtual Machine.

Performing one of the most important task

Now it is time to perform one of the most important parts. Without doing it you are putting the whole installation at risk, so be very careful when you are executing this.

Just look below this text and smash the “Subscribe” button to get my free Getting Started Smart Home Guide and to receive my articles every week via email. Thank you. 🙏

Setting a static IP from Home Assistant (Optional Step)

This step is optional. It is recommended if you are using AdGuard. If you don’t know what AdGuard is – check my video article about it.

Open you Home Assistant and go to:

Supervisor > System > Change IP address > Static

Enter the IP that you wish to set. For example: 10.0.0.2/24.

As Gateway type the IP of your router. The DNS is usually your router, or some public DNS service like 8.8.8.8. And if you use AdGuard you should add the AdGuard IP.

Setting a Static IP of Home Assistant

Setting a Static IP of Home Assistant

To test if everything is OK open in a new browser/tab the configured by you address on port 8123. For example: http://10.0.0.2:8123.

Using Home Assistant Snapshot for migration (Optional Step)

I’m going to use Home Assistant Snapshot functionality to migrate all of my data and configurations from my Raspberry Pi (old machine) to this new fresh installation. If you don’t have anything to migrate from – go directly to the next step/heading.

I will open my Home Assistant installation on the Raspberry Pi (old machine). And I will go to “Supervisor” in the lower left part of the screen and then on “SNAPSHOTS” tab.

Creating a Home Assistant Snapshot

Create a full snapshot or use already existing one if you have such.

Then click on you snapshot that you want to migrate and choose “DOWNLOAD SNAPSHOT” button.

Next go to your new HOST (where you want to migrate everything) and again click on “Supervisor” button, but before you click the Snapshots – click on the “ADD-ON STORE”.

Installing the "samba" add-on

Search and install “Samba” add-on.

Open and install this add-on. Don’t forget to add username and password under Config section. You will need them to access the snapshot that we created earlier.

Click "SAVE" when you update your Samba Configuration.

Click “SAVE” when you update your Samba Configuration.

After you save your changes scroll up a bit and click on the “START” button.

Now you have to open that shared folder. Depending of your Operating system you can do one of the following:

Access shared folder from Windows

In Windows you can press WINDOWS + R buttons simultaneously and in the Run dialog you have to enter:

\\YOUR_NEW_HA_IP\

In my case this is

\\10.0.0.15\

Access shared folder from macOS

To open a shared folder in macOS, open the Finder and press COMMAND + k, then type something like smb://10.0.0.15 and don’t forget to change the IP.

Access shared folder from Linux

If you are using Linux the universal way is from Terminal using smbclient by typing the following:

smbclient //YOUR_NEW_HA_IP/ -U <user>

Remember to login successfully you have to enter the credentials that you configure in the samba add-on within Home Assistant.

When you open the shared folder find “backup” folder and paste inside the snapshot that you downloaded from your old machine.

pasting snapshot inside the home assistant backup folder

paste inside the snapshot that you downloaded from your old machine.

Head back to Supervisor > Snapshots menu in the Home Assistant of your new/target machine and click “refresh” button in the upper right corner.

You should see your snapshot under the “Available snapshot” section.

Restoring Home Assistant snapshot

Click on it and then select “RESTORE SELECTED”.

The only thing left is to wait a bit for the process to finish. It can take up to 20min so be patient please.

Auto Start VirtualBox and Home Assistant after Windows restart

I’m going to configure VirtualBox to automatically start Home Assistant when windows reboots.

Go to your VirtualBox window and right click on your Home Assistant virtual machine and select “Create Shortcut on Desktop”

Creating a shortcut on desktop of our Home Assistant virtual machine

Creating a shortcut on desktop of our Home Assistant on Windows virtual machine

Then open windows explorer or Run dialog (WINDOWS + R) and type:

shell:startup

this will open a system startup folder in which everything pasted there will try to auto start after restarting Windows.

And we are going to do exactly that. Just paste the created shortcut of your Home Assistant on Windows virtual machine inside this system startup folder.

This is not enough for auto starting VirtualBox and HomeAssistant, because your windows user have to successfully login in order the things inside the startup folder to be executed.

We will fix that “issue” in the next section.

Auto Log in Windows after restart

I’m going to enable auto login feature in Windows, so when the computer restarts our account will be automatically logged in.

And the VirtualBox will auto start Home Assistant virtual machine if you execute the previous step in this tutorial.

Press WINDOWS + R and type

netplwiz

In the window that will be displayed uncheck the “User must enter a username and password to use this computer.”

Uncheck "User must enter a username and password to use this computer." option
Uncheck “User must enter a username and password to use this computer.” option

Then click OK and enter your user password twice and you are ready.

What if netplwiz is not working?

If the above check in netplwiz is not visible for you (and there is a big chance for that if you are using Windows 10 version 1909 or above). Follow these steps:

  • Go to windows search (start menu) and type: passwordless sign-in
Home Assistant on Windows using VirtualBox Guide 5

Then, Click on the result!

  • After that disable the following option if it’s enabled.
Disable this option to activate the check in netplwiz.
Disable this option to activate the check in netplwiz.
  • Finally execute the netplwiz procedure exactly as described above.

Set your Windows Power Options correctly

Don’t forget to set your power options right to avoid unwanted sleep of your computer after several working hours.

To check if everything is alright open windows control panel and search for “power options” and click on “Change power-saving settings” and then change when the computer sleeps. Last find the option “Put the computer to sleep” and from the dropdown menu select – Never.

Resize Home Assistant Virtual Disk

The following steps are only needed If for whatever reason your Home Assistant Virtual Disk size that you already have is not enough.

How Do I know that my Home Assistant Virtual Disk have not enough space?

You will understand that you have disk space issues when for example you receive warnings in your Home Assistant logs, that your disk is full. Or you cannot update your Home Assistant and/or you can’t create new snapshots anymore. Only if you face any of these symptoms above you will know that it is time to resize your VDI file.

And here is how you can do it.

  • Shut down the Home Assistant virtual machine – ensure that the state is set to Powered Off and not to Saved.
  • Open command prompt and go to the folder where Virtual Box is installed (C:\Program Files\Oracle\VirtualBox by default) by type the following:
cd “C:\Program Files\Oracle\VirtualBox”
  • Then type the following command and don’t forget to replace the full path to your Home Assistant image (VDI file) and to change the size you want to enlarge the image to in Megabytes.
VBoxManage modifymedium disk “C:\FULL_PATH_TO_YOUR_HOME_ASSISTANT_IMAGE.vdi” --resize 81920
  • This process doesn’t enlarge the partition on the Home Assistant virtual hard disk, so you won’t have access to the new space just yet.  You can use a GParted live CD to resize your virtual machine’s partition.
  • Simply boot the GParted ISO image in your virtual machine and you’ll be taken to the GParted partition editor. GParted will be able to enlarge the partition on the Home Assistant virtual hard disk.
  • Once GParted is booted, right-click the partition you want to enlarge and select Resize/Move.
  • Drag the slider all the way to the right to use all the available space for the partition. Click the Resize/Move button after you’ve specified the space you want to use.
  • Finally, apply your changes and enlarge the partition.
  • After the resize operation completes, restart your virtual machine and remove the GParted ISO file.
  • You will now have a resized Home Assistant on Windows.

Question for You

What kind of device are you using for your main home server?

Raspberry PI, some kind of desktop or laptop or maybe enterprise grade server. 

If you are feeling lazy like me these days just put one word in the comments like: raspberry or desktop and I will know for what are you talking about.

That doesn’t mean that you cannot put the full  configuration specification if you wish. It will be interesting to see that as well.

Support my Work

Any sort of engagement on this site does really help out a lot with the Google algorithm, so make sure you hit the subscribe If you enjoy this article.

Also feel free to add me on Twitter by searching for @KPeyanski. 

You can find me on my Discord server as well. This is the invite link.

I really hope that you find this information useful and you now know how to install Home Assistant on Windows using VirtualBox . 

Thank you for watching, stay at home, stay safe and see you next time.

  • Установка hasp эмулятора на windows 10
  • Установить устройство вывода звука на windows 10
  • Установка jlr sdd 160 на windows 10
  • Установить фрагмент и набросок windows 10
  • Установка grub на флешку из windows