> [!sub]- [[📌Subscribe & Engage|🧡FREE subscriber-only Products. Subscribe and get a chance to win!]]
[[HAOS]] can be installed as a [[VM]] or [[BM]]. This guide details the [[VM]] method.
> [[PVE]] is used in all virtualisation operations.
## Create [[KVM]]
We will use [[PVE]] to deploy a [[KVM]] and then install [[HAOS]].
<button class="navigate">Node</button> <button class="navigate">Create VM</button>
![[Home Assistant (HA)/_attachments/pve-kvm-0.png]]
<span class="fieldname">Node:</span> `pve`
<span class="fieldname">VM ID:</span> `200` - enter your preference
<span class="fieldname">Name:</span> `haos` - enter your preference
<span class="fieldname">Start at boot:</span> <code class="w-code">enable</code>
<span class="fieldname">Advanced:</span> <code class="w-code">enable</code>
<button class="navigate">Next</button>
![[haos-kvm-0.png]]
<code class="w-code">Do not use any media</code>
<span class="fieldname">Guest OS Type</span>: <code class="w-code">Linux</code>
<span class="fieldname">Guest OS Version</span>: <code class="w-code">6.x-2.6 Kernel</code>
<button class="navigate">Next</button>
![[haos-kvm-1.png]]
<span class="fieldname">Graphic card</span>: <code class="w-code">Default</code>
<span class="fieldname">SCSI Controller</span>: <code class="w-code">VirtIO SCSI single</code>
<span class="fieldname">Machine</span>: <code class="w-code">q35</code>
<span class="fieldname">Qemu Agent</span>: <code class="w-code">enable</code>
<span class="fieldname">BIOS</span>: <code class="w-code">OVMF (UEFI)</code>
<span class="fieldname">Add EFI Disk</span>: <code class="w-code">enable</code>
<span class="fieldname">EFI Storage</span>: `local-lvm` | `local-zfs`
<span class="fieldname">Pre-Enroll keys</span>: <code class="w-code">disable</code>
<span class="fieldname">Add TPM</span>: <code class="w-code">disable</code>
<button class="navigate">Next</button>
![[haos-kvm-2.png]]
<span class="fieldname">Storage</span>: `local-lvm` | `local-zfs`
<span class="fieldname">Disk size (GiB)</span>: <code class="w-code">32</code>
<span class="fieldname">Discard</span>: <code class="w-code">enable</code>
<span class="fieldname">IO thread</span>: <code class="w-code">enable</code>
<span class="fieldname">SSD emulation</span>: <code class="w-code">enable</code>
<button class="navigate">Next</button>
![[haos-kvm-3.png]]
<span class="fieldname">Cores: </span><code class="w-code">2</code>
<span class="fieldname">Type</span>: <code class="w-code">host</code>
<button class="navigate">Next</button>
![[haos-kvm-4.png]]
<span class="fieldname">Memory (MiB)</span>: <code class="w-code">2048</code> - can change any time
<span class="fieldname">Minimum Memory (MiB)</span>: <code class="w-code">1024</code> - can change any time
<span class="fieldname">Ballooning Device</span>: <code class="w-code">ENABLE</code>
<button class="navigate">Next</button>
![[haos-kvm-5.png]]
No change from defaults
<button class="navigate">Next</button>
![[haos-kvm-6.png]]
<span class="fieldname">Start after created</span>: <code class="w-code">DISABLE</code>
<button class="navigate">Finish</button>
![[haos-kvm-7.png]]
Following [[KVM]] creation we need to change a few things:
## Setup [[KVM]]
<button class="navigate">KVM</button> <button class="navigate">Hardware</button> <span class="fieldname">CD/DVD Drive (ide2)</span> <button class="navigate">Remove</button>
![[haos-kvm-8-0.png]]
<button class="navigate">Yes</button>
![[haos-kvm-8-1.png]]
<button class="navigate">KVM</button> <button class="navigate">Hardware</button> <span class="fieldname">Hard Disk (scsi0)</span> <button class="navigate">Detach</button>
![[haos-kvm-8-2.png]]
<button class="navigate">Yes</button>
![[haos-kvm-8-3.png]]
<button class="navigate">KVM</button> <button class="navigate">Hardware</button> <span class="fieldname">Unused Disk 0</span> <button class="navigate">Remove</button>
![[haos-kvm-8-4.png]]
<button class="navigate">Yes</button>
![[haos-kvm-8-5.png]]
<button class="navigate">KVM</button> <button class="navigate">Options</button> <span class="fieldname">Use Tablet for Pointer</span> <button class="navigate">Edit</button> <code class="w-code">DISABLE</code> <button class="navigate">OK</button>
![[haos-kvm-8-6.png]]
### Download [[HAOS]]
Visit the [HAOS GitHub page](https://github.com/home-assistant/operating-system/releases) to find the version you want to install. I suggest you settle for the most recent non-beta version, like in the example below:
<button class="navigate">Show all ___ assets</button>
![[haos-github-0.png]]
Locate the file ending in .qcow2: <span class="fieldname">haos_ova-9.5.qcow2.xz</span>
![[haos-github-1.png]]
right click on <span class="fieldname">haos_ova-9.5.qcow2.xz</span> and select <button class="navigate">Copy Link</button>
![[haos-github-2.png]]
Type <code class="g-code">wget</code> $space$ and <button class="navigate">Paste as Plain Text</button> the link address copied earlier;
![[pve-haos-0.png]]
the command should be similar to:
<pre><code class="g-code">wget https://github.com/home-assistant/operating-system/releases/download/9.5/haos_ova-9.5.qcow2.xz</code></pre>
Press `enter` to run the command and start the download)...
![[pve-haos-1.png]]
When download is complete...
![[pve-haos-2.png]]
run the following commands...
<pre><code class="g-code">ls -al</code></pre>
![[pve-haos-3.png]]
Note the downloaded file name `haos_ova-9.5.qcow2.xz`
Uncompress the `qcow2` file:
<pre><code class="g-code">unxz haos_ova-9.5.qcow2.xz</code></pre>
Following uncompression, `haos_ova-9.5.qcow2.xz` is now named `haos_ova-9.5.qcow2`
![[pve-haos-4.png]]
### Configure [[KVM]]
We need to attach the uncompressed file `haos_ova-9.5.qcow2` to the [[KVM]] (created above), with the below command, using this information:
<span class="fieldname">VM ID</span>: `200`
<span class="fieldname">Storage</span>: `local-lvm` | `local-zfs`
if `lvm` storage:
<pre><code class="g-code">qm importdisk 200 haos_ova-9.5.qcow2 local-lvm</code></pre>
if `zfs` storage:
<pre><code class="g-code">qm importdisk 200 haos_ova-9.5.qcow2 local-zfs</code></pre>
Proceed only if: <code><b>Successfully imported disk as ....</b></code>
![[pve-haos-5.png]]
If disk imported successfully we can find it under: <button class="navigate">KVM</button> <button class="navigate">Hardware</button> <span class="fieldname">Unused Disk 0</span>
![[haos-kvm-9-0.png]]
Attach the disk to the [[KVM]]: <button class="navigate">KVM</button> <button class="navigate">Hardware</button> <span class="fieldname">Unused Disk 0</span> <button class="navigate">Edit</button>
<span class="fieldname">Disk Image</span>: `local-lvm:vm-200-disk-1` | `local-zfs:vm-200-disk-1`
<span class="fieldname">Discard</span>: <code class="w-code">enable</code>
<span class="fieldname">IO thread</span>: <code class="w-code">enable</code>
<span class="fieldname">SSD emulation</span>: <code class="w-code">enable</code>
<button class="navigate">Add</button>
![[haos-kvm-9-1.png]]
Now we have a disk to boot from: <button class="navigate">KVM</button> <button class="navigate">Hardware</button> <span class="fieldname">Hard Disk (scsi0)</span>
![[haos-kvm-9-2.png]]
Change the boot order:
<button class="navigate">KVM</button> <button class="navigate">Options</button> <span class="fieldname">Boot Order</span> <button class="navigate">Edit</button>
<span class="fieldname">scsi0</span>: <code class="w-code">ENABLE</code>
<span class="fieldname">net0</span>: <code class="w-code">DISABLE</code>
<button class="navigate">OK</button>
![[haos-kvm-9-3.png]]
Check boot order: <button class="navigate">KVM</button> <button class="navigate">Options</button> <span class="fieldname">Boot Order</span> <code class="w-code">scsi0</code>
![[haos-kvm-9-4.png]]
## Run/Start [[HAOS]]
Start the [[KVM]]: <button class="navigate">KVM</button> <button class="navigate">>_ Console</button> <button class="navigate">Start Now</button>
![[haos-kvm-9-5.png]]
Ensure [[HAOS]] has been assigned a valid [[IPv4]] and [[IPv6]] and make a note of how you access [[HA]] over the network:
<pre><code class="g-code">http://homeassistant.local:8123</code></pre>
![[haos-kvm-9-6.png]]
## Configure [[HAOS]] - Network
Always run [[HAOS]] using a static [[IP]] address.
One method to assign a static [[IPv4]] is using a [[DHCP]] [[MAC]] reservation. First we need to find the [[MAC]] of [[HAOS]], then on the [[DHCP]] server we need to make the reservation.
The [[MAC]] of [[HAOS]] can be found: <button class="navigate">KVM</button> <button class="navigate">Hardware</button> <span class="fieldname">Network Device (net0)</span> <code class="w-code">virtio=__:__:__:__:__:__</code>
![[haos-kvm-9-7-0.png]]
Our [[DHCP]] server resides in [[Pi-hole]], where we will make a lease reservation for the [[HAOS]] [[MAC]]. If you are not using [[Pi-hole]] the [[DHCP]] server most likely can be found in the Internet router/gateway.
![[haos-kvm-9-7-1.png]]
A [[MAC]] reservation is easier administratively, because static [[IPv4]] configuration requires substantially more information to get right.
We can change the [[HAOS]] [[IPv4]], from [[DHCP]] to static, from the [[webUI]], or from the console using the [[CLI]]:
Prior to using the [[CLI]], we need the following information first:
1. The interface name
2. The static [[IPv4]] in CIDR notation, which must be outside the [[DHCP]] address pool
3. The netmask so we can provide the CIDR notation; for home networks it usually is `/24`
4. The gateway [[IPv4]]
5. The DNS server [[IPv4]]
Using [[Pi-hole]], select the right [[IPv4]] from outside the [[DHCP]] address pool, which, in our guide, is any address smaller than `192.168.0.60` and greater than `192.168.0.98`. Additionally the [[IPv4]] should not conflict with any other static [[IPv4]] on the network. In our case we will select `192.168.0.99` as our [[IPv4]].
![[haos-kvm-9-7-2.png]]
The interface name, [[CIDR]], gateway and [[DNS]] server addresses can be found by issuing the command:
<pre><code class="g-code">net info</code></pre>
![[haos-kvm-9-7-3.png]]
We can now issue the command to change the [[IPv4]] to static:
<pre><code class="g-code">net update enp6s18 --ipv4-method static --ipv4-address 192.168.0.99/24 --ipv4-gateway 192.168.0.1 --ipv4-nameserver 192.168.0.248</code></pre>
`192.168.0.248` is the [[Pi-hole]] [[DNS]] server (the nameserver); if you are not using any internal [[DNS]] server, use `1.1.1.1` or `8.8.8.8` instead.
Check if all changed values are correct:
<pre><code class="g-code">net info</code></pre>
![[haos-kvm-9-7-4.png]]
Command syntax help:
<pre><code class="g-code">net update -h</code></pre>
![[haos-kvm-9-7-5.png]]
[[HAOS]] is now installed. Use the [[webUI]] to setup [[HAOS]]. Follow [[4. HAOS - Setup]]