Run Home Assistant on VMware ESXi

Updated: August 19, 2023. Debian 11 is not supported any more for running Home Assistant Supervised. For a supported configuration, you need Debian 12. The steps in this blog are updated to install Home Assistant as Debian 12 VM in VMware ESXi.

Updated: December 2, 2022. Debian 10 is not supported any more for running Home Assistant Supervised. For a supported configuration, you need Debian 11 (Bullseye). The steps in this blog are updated to install Home Assistant as Debian 11 VM in VMware ESXi.

Home Assistant Supervised provides the full Home Assistant experience on a regular operating system. The Supervisor is not just an application but it is a full appliance that manages the whole system. Home Assistant supervised is only supported on a Debian 12 Operating System. Below are the steps described on how to install Home Assistant Supervised as Virtual Machine on a Debian 11 (Bullseye) Operating System in VMware ESXi.

Configure the Virtual Machine hardware specifications

  • Download the debian-live-12.1.0-amd64-standard.iso, Link
  • Make a connection to the ESXi host: https://<ip-address>/ui
  • Upload the Debian ISO to a datastore
  • Create a new virtual machine with the following specifications:
    • Name: <Name of the VM>
    • Compatibility: Default (ESXi  8 and later)
    • Guest OS family: Linux
    • Guest OS version: Debian GNU/Linux 12 (64-bit)
    • Storage: datastore with more than 30 GB of free space
    • CPUs: 2
    • Memory: 2048 MB
    • Hard disk 1: 40 GB
      • Disk Provisioning: Thin provisioned
    • SCSI Controller 0: VMware Paravirtual
    • USB controller 1: USB 2.0 or 3.0 depending on the ESXi hardware
    • Network adapter 1: Select the port group
      • Adapter type: E1000e
    • CD/DVD Drive 1: Datastore ISO file
      • Browse to the Debian ISO
      • Connect at Power: checked
    • Video Card: Default settings
    • Next
    • Finish
    • Power on the VM
    • Open a console session

The VM is now configured with a paravirtualized SCSI controller (PVSCSI) and VMXNET3 Virtual NIC.

Install Debian 12 as VM on VMware ESXi

  • Installer Menu: Start Installer 
  • Language: English
  • Location:  Other, Europe, Netherlands
  • Locales:  United States
  • Keymap:  American English
  • Enter the hostname: ha-deb12-01
  • Domain name: <domain name>
  • Root password: <Enter the root password>
  • Full Name for the user:<Full name>
  • User name: <username>
  • Choose Password for the new user: <Enter the root password>
  • Partition Disks: Guided – Use the entire disk and set up LVM
    • Select disk to partition: SCSI1 (0,0,0) – 32,2 GB VMware Virtual Disk
    • Partition scheme: All files in one partition (recommended for new users)
    • Write the changes to disk and configure LVM: Yes
    • Amount of volume group to use for guided partitioning: 42.4 GB
    • Select: Continue
    • Write changes to disks: Yes
  • Configure the Package manager: Yes
  • Debian archive mirror country: Select the archive mirror country nearby. I selected Netherlands
  • Debian archive mirror: deb.debian.org
  • HTTP Proxy: Leave empty and select continue
  • Participate in the package usage survey: No
  • Software selection:
    • Check: SSH server and standard system utilities
    • Uncheck: Debian desktop environment
    • Uncheck: GNOME
  • Install the GRUB boot loader to the master boot record. Yes
  • Device for boot loader installation? /dev/sda
  • Installation is complete. 
    • Finish the installation: Continue

The Debian VM will be rebooted and is ready for use. After the installation, open a console session and log in.

Enable SSH

sudo apt install openssh-server
sudo nano /etc/ssh/sshd_config

Enable port 22 and save the file

systemctl restart ssh

Enable Sudo on the user account

nano /etc/sudoers

Save

Under the “User privilege specification” add the user account created during the Debian installation. Replace the <username> with the name of the user you entered in the installation phase.

username ALL=(ALL:ALL) ALL

Press CTRL + X to save the file. Now it is possible to use the sudo account under your username.

exit
sudo -i

More information: How to Install and Enable SSH on Debian 12/11/10 – LinuxCapable

Update all Debian packages

apt update && sudo apt upgrade -y && sudo apt autoremove -y

Find the IPv4 address of the VM by using the command:

VMware Tools is included in the Debian distribution so you don’t need to install VMware Tools package. Find the IP address by using the following command:

ifconfig ens192

Look for the inet address. That’s the IP address.

Make an SSH connection to the VM

Connect using SSH to the IP address of the Debian VM by using Putty for example.

sudo -i

Install the required packages

apt-get install \
apparmor \
jq \
wget \
curl \
udisks2 \
libglib2.0-bin \
network-manager \
dbus \
lsb-release \
systemd-journal-remote -y

Install Docker-CE

curl -fsSL get.docker.com | sh

Install the latest Agent

The latest agents can be found here:
https://github.com/home-assistant/os-agent/releases/latest

Replace the “os-agent_1.5.1_linux_x86_64.deb” with the agent version you downloaded.

wget https://github.com/home-assistant/os-agent/releases/download/1.5.1/os-agent_1.5.1_linux_x86_64.deb
dpkg -i os-agent_1.5.1_linux_x86_64.deb

You can check if the installation was successful by running the following command.

gdbus introspect --system --dest io.hass.os --object-path /io/hass/os

This should not return an error.

Install Home Assistant Supervised Debian Package

wget https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
dpkg -i homeassistant-supervised.deb

A reboot of the Debian VM is necessary.

reboot

After the reboot, you need to wait (between 1 and 20 minutes) for the initial Home Assistant configuration.  With the command “docker ps” you can view the status of the Docker containers. The status must be Up xx minutes.

Connect to Hass.io: http://;:8123

Home Assistant Supervised is now installed and running as a Virtual Machine on VMware ESXi. You can check the system health by browsing to:

Settings -> System -> Repairs -> 3 dots -> System Information

More information:

GitHub – home-assistant/supervised-installer: Installer for a generic Linux system

 

Install Home Assistant Hass.io as Virtual Machine (VM) on VMware ESXi

I started exploring Home Assistant Hass.io on a Raspberry Pi. After several SD card crashes I decided to installed Hass.io as Virtual Machine (VM) on VMware ESXi. There is a VMDK version available (link) that can attached (this involves manual steps) but I prefer a clean installation. VMware ESXi is installed on my Shuttle SH370R6 plus home lab server (link).

Update: June 2021: Ubuntu is not supported anymore as Operating System for Home Assistant. See my blog post about installing the Debian for Home Assistant for more information.

Run Home Assistant on VMware ESXi as Debian VM

 

Other advantages of running Hass.io as VM on VMware ESXi are for example:

  • The Raspberry PI has limited hardware resources and can be a performance bottleneck when using more and more sensors and installing Hass.io add-ons. A home lab server offers more CPU power, memory and storage performance.
  • Snapshot functionality. Quickly make a Virtual Machine snapshot before upgrading the add-ons or Hass.io itself. When something went wrong during the upgrade, simply revert the snapshot and everything works again within seconds.
  • The installation of Hass.io in a Ubuntu VM on ESXi is simple.
  • USB sticks like Z-Wave or Zigbee2MQTT can be attached to the Hass.io VM using ESXi USB pass-through.

Here are the steps outlined how-to install an Ubuntu VM and install Hass.io.

Configure the Virtual Machine hardware specifications

  • Download Ubuntu 18.04.2 LTS (Long-Term Support), link.
  • Make a connection to the ESXi host: https://<ip-address>/ui
  • Upload the Ubuntu ISO to a datastore
  • Create a new virtual machine with the following specifications:
    • Name: HA-01
    • Compatibility: ESXi 6.7 virtual machine
    • Guest OS family: Linux
    • Guest OS version: Ubuntu Linux (64-bit)
    • Storage: datastore with 30 GB free space
    • CPUs: 2
    • Memory: 2048 MB
    • Hard disk 1: 30 GB
      • Disk Provisioning: Thin provisioned
    • SCSI Controller 0: VMware Paravirtual
    • USB controller 1: USB 2.0 or 3.0 depending on the ESXi hardware
    • Network adapter 1: Select the portgroup
      • Adapter type: VMXNET 3
    • CD/DVD Drive 1: Datastore ISO file
      • Browse to the Ubuntu ISO
      • Connect: checked
    • Video Card: Default settings

  • Next
  • Finish
  • Power on the VM
  • Open a console session

The VM has a paravirtualized SCSI controller (PVSCSI) and Virtual NIC (VMXNET3)

Install Ubuntu on ESXi

  • Language: English
  • Select: Install Ubuntu Server
  • Choose your preferred language: English
  • Keyboard configuration: Select the layout and variant: English US (
  • Installation: Install Ubuntu
  • Networking connections: The VMXNET3 NIC of the VM is displayed. Select for the IPv4 method DHCP or a manual fixed IP address
  • Configure proxy: leave this blank
  • Ubuntu mirror: Use the mirror address suggested
  • Filesystem setup: Use an Entire Disk
    • Choose the disk to install to: /dev/sda 30.00G
    • Filesystem summary: Done
    • Confirm destructive action. Are you sure you want to continue: Continue

  • Profile setup: Fill in the following fields (remember the username and password)
    • Your name:
    • Your server’s name:
    • Pick a username:
    • Choose a password:
    • Confirm a password:
  • SSH Setup: Install OpenSSH server
    • Import SSH identity: No
  • Featured Server Snaps: Select none
  • The installation of Ubuntu begins
  • The installation is complete! Reboot the system

  • Remove the attached Ubuntu ISO from the VM and press enter
  • After the reboot it’s time to install Hass.io in the VM

The Open VM Tools is already installed  by default so there no need to install this package.

Install Hass.io

  • Because we installed OpenSSH we are using a SSH session for the Hass.io configuration.
  • Connect to the IP address of thje Ubuntu VM using SSH (i’m using putty) for the connection.
  • Packages requirements (link) for Hass.io:
    • apparmor-utils
    • apt-transport-https
    • avahi-daemon
    • ca-certificates
    • curl
    • dbus
    • jq
    • network-manager
    • socat
    • software-properties-common (already installed in Ubuntu 18.04)
    • As docker package Docker-CE must be installed.
  •  Use the following commands to install all the required packages and install Hass.io
sudo -i
add-apt-repository universe
apt-get update
apt-get install -y apparmor-utils apt-transport-https avahi-daemon ca-certificates curl dbus jq network-manager socat
curl -fsSL get.docker.com | sh
curl -sL https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh | bash -s
  • After the installation check if there are two containers running using the following command:
root@ha-01:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8def326c0ce7 homeassistant/qemux86-64-homeassistant "/bin/entry.sh pytho…" About a minute ago Up About a minute homeassistant
47945d4fe0f4 homeassistant/amd64-hassio-supervisor "python3 -m hassio" 2 minutes ago Up 2 minutes hassio_supervisor
root@ha-01:~#
  • Connect to Hass.io: http://<IP address>:8123

Home Assistant Hass.io is now running as VM on VMware ESXi.

Install Home Assistant Hass.io as VM in VMware Workstation

There a multiple ways to install Home Assistant Hass.io on different platforms. The instructions for deploying Hass.io as Virtual Machine (VM) are not very clear when using VMware Workstation or VMware ESXi. In this blog post I highlight the steps needed to deploy Hass.io as VM using VMware Workstation 15 Pro.

Here are the steps:

  • Download the VMDK image of Hass.io (link) and save it to a folder were the VMware Workstation Virtual Machine will be stored
  • Unzip the downloaded VMDK file with 7zip
  • Open VMware Workstation
  • Choose a custom (advanced) configuration

  • For the VM hardware comparability select: ESXi 6.5
  • Select: I will install the operating system later
  • As Guest Operating System select: Other 64-bit
  • Give the Virtual Machine a name and browse to the location the VMDK file stored. The will be a warning that there already resides a Virtual Machine in the same location. Select: Continue

  • Select the number of processors and cores. A minimum is 1 processor and 1 core.
  • Assign memory to Hass.io VM. A minimum is: 1024 MB.
  • Select as network type: NAT
  • Select as I/O controller: LSI Logic (Recommended)
  • Select as disk type: SATA
  • Select a disk: Use an existing virtual disk
  • Browse to the VMDK file downloaded earlier
  • There will be a question to convert the existing virtual disk to a newer format, select: Convert

  • The Hass.io VM is ready to be created, select Finish

Before starting the VM, edit the Virtual Machine settings and modify to following:

  • The disk is only 6 GB, expand the disk to 32 GB or higher.

  • Remove the Sound Card in the hardware configuration.

  • Change the firmware from BIOS to UEFI. Do not select “Enable secure boot”!

  • Select OK and Power On the VM.
  • When the boot is completed press “enter” in the console and the login prompt appears. To log in, use “root” without a password.

  • The Hassio console prompt appears, enter “login” for host access.
  • To find the IP address assigned, use the “ip a” command in the console and look for the IP address on the enp2s0 nic.

  • Open a browser session and use the following format: http://ip-address:8123

Now you’re ready to update Home Assistant and let’s start playing.