Contents

Home Assistant: Install haos on Proxmox 8.1.x with ZFS setup

Introduction

In this tutorial, I will show you how to install Home Assistant on Proxmox 8.1.x using haos in a vm using ZFS storage.

There are already many good tutorials around, and you can even use some scripted installations, but I always prefer to understand what the scripts are doing and get my own way how to install things.

Let’s start…

Download latest haos vm image

In this tutorial, I’m trying to use the command line as much as I can, so you have to log in to the Proxmox console.
I prefer using an SSH connection.

1
ssh root@vhost01


Get the latest version of haos and download it.

1
2
ha_version=$(curl -s https://raw.githubusercontent.com/home-assistant/version/master/stable.json | grep "ova" | cut -d '"' -f 4)
wget -q --show-progress https://github.com/home-assistant/operating-system/releases/download/${ha_version}/haos_ova-${ha_version}.qcow2.xz


Now we can extract the vm image and get some infos.

1
2
3
4
5
unxz haos_ova-${ha_version}.qcow2.xz
qemu-img info haos_ova-${ha_version}.qcow2

# Cleanup
rm -f haos_ova-${ha_version}.qcow2.xz

Installation

First we will create a new vm without any vdisk.
Because we are using UEFI (ovmf) bios, we need to create an empty vdisk and attach it to the vm as EFI disk.
To use the haos image, we are importing the extracted vdisk to the vm and attach it to the scsi controller of the vm.
To create a new vm, we need to define a new vmid first.
I’m using 206 as vmid.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
qm create 206 \
  --name hass01 \
  --pool PROD \
  --tags prod \
  --ostype l26 \
  --agent 1 \
  --bios ovmf \
  --cpu host,flags=+aes \
  --cores 4 \
  --memory 4096 \
  --numa 0 \
  --scsihw virtio-scsi-single \
  --net0 virtio=AA:BB:CC:DD:E2:06,bridge=vmbr00,firewall=1,tag=50

Hints:
–name hass01 = vm name
–pool PROD = pve pool if you don’t use pools remove this option
–tags prod = pve tags
–net0 … = I’m using static mac-adresses, bridge vmbr00 and vlan 50
To attach the vdisks to the vm we need to get the name of the pve storage destination.
In my case I’m using pve_vdisks but on your setup it could be local or something different.

1
pvesm status


Now we can create a new vdisk for the UEFI bios.
Import the haos vdisk and attach both to the vm.

1
2
3
4
5
6
pvesm alloc pve_vdisks 206 vm-206-disk-0 4M
qm importdisk 206 haos_ova-${ha_version}.qcow2 pve_vdisks
qm set 206 \
  --efidisk0 pve_vdisks:vm-206-disk-0 \
  --scsi0 pve_vdisks:vm-206-disk-1,cache=writethrough,discard=on,iothread=1,size=32G \
  --boot order=scsi0


Let’s check if both vdisk are attached to the vm.

1
2
3
4
5
6
pvesm list pve_vdisks --vmid 206

# output:
Volid                    Format  Type             Size VMID
pve_vdisks:vm-206-disk-0 raw     images        4194304 206
pve_vdisks:vm-206-disk-1 raw     images    34359738368 206


And if you are using ZFS we can see the two new datasets.

1
2
3
4
5
zfs list | grep 206

# output:
rpool/pve_vdisks/vm-206-disk-0                     56K   151G    56K  -
rpool/pve_vdisks/vm-206-disk-1                   2.29G   151G  2.29G  -


If everything good, then you can start the vm.

1
qm start 206


Now you should be able to browse in your web browser to http://VM-IP:8123 and see a fresh Home Assistant installation start page.

I hope I could help you to get your Home Assistant running. If you need help, don’t hesitate to leaf a comment below.


Happy hacking

References