<h1 id="introduction">Introduction</h1>
<p>This is a follow up episode on Home Assistant (HA), see
<a href="https://hackerpublicradio.org/eps/hpr4099/index.html">hpr4099
:: An introduction to Home Assistant (HA)</a> for an explanation of what
Home Assistant (HA) is, and why you might want to install it.</p>
<p>The <a href="https://www.home-assistant.io/installation/">Home
Assistant Installation page</a> offers several different install
methods, listed along with the level of difficulty.</p>
<ul>
<li>Easiest: Plug and play with Home Assistant Green</li>
<li>Easy: DIY with Raspberry Pi</li>
<li>Intermediate: Extend with Home Assistant Yellow</li>
<li>Hard: Install on other hardware</li>
<li>Expert: Advanced installation methods</li>
</ul>
<p>Today we will be installing Home Assistant Operating System (HAOS),
on a x86-64 machine.</p>
<blockquote>
<p>Home Assistant can be repurposed and installed on various hardware,
such as an Odroid or a generic x86-64 machine. The Home Assistant
Operating System allows you to install Home Assistant on these devices
even if you have little to no Linux experience.</p>
</blockquote>
<p>We are going to my HP t610 Flexible Thin Client, which has a 16GB
SATA Flash Drive, and I upgraded it to 16G of Ram.</p>
<p><strong>Note</strong> that this will install Home Assistant Operating
System (HAOS) as a computer appliance. That means that it will run a
bare OS with the various components in a customised docker setup. It
will take over the entire computer, and requires secure boot to be
disabled.</p>
<p>On the HP t610 Flexible Thin Client, that involves pressing "Esc" at
boot to get to the bootup menu. If that doesn't work try pressing "F10"
just after turning on the power.</p>
<h1 id="two-methods-to-install">Two methods to install</h1>
<p>HAOS has no integrated installer like you would expect with
<a href="https://en.wikipedia.org/wiki/Linux_distribution#Distro_hopping">distro
hopping</a>, but it requires that the image be burned directly onto the
disk of the computer itself.</p>
<p>It has two methods to do this and "Method 2: Installing HAOS directly
from a boot medium", is basically take the disk out of the target system
and attach it to your own computer. The use a burning tool like Balena
Etcher, or <code>dd</code> to write the image to disk. Much as you would
burn a sdcard for a raspberry pi. I don't have a way to do this so let's
go with method 1.</p>
<h2
id="method-1-installing-haos-via-ubuntu-booting-from-a-usb-flash-drive">Method
1: Installing HAOS via Ubuntu booting from a USB flash drive</h2>
<p>Here you download and burn live operating system as you would if you
were
<a href="https://en.wikipedia.org/wiki/Linux_distribution#Distro_hopping">distro
hopping</a>, the document suggests to use Ubuntu. I tried it but my HP
t610 Flexible Thin Client didn't like it. It also didn't like Fedora
despite having worked earlier, so I just used
<a href="https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-12.5.0-amd64-lxqt.iso">Debian
LXQT</a>.</p>
<ul>
<li><a href="https://www.debian.org/download"
class="uri">https://www.debian.org/download</a></li>
<li><a
href="https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-12.5.0-amd64-lxqt.iso"
class="uri">https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-12.5.0-amd64-lxqt.iso</a></li>
</ul>
<p>Now you have Debian running off a usb stick on your target
machine.</p>
<h3
id="steps-to-burn-home-assistant-operating-system-haos-to-disk-on-target">Steps
to burn Home Assistant Operating System (HAOS) to disk on target</h3>
<p>Anything after the '#' character is a comment and doesn't need to be
typed.</p>
<p><strong>Note</strong> The following steps are optional, and you
should only do them if you wish to ssh to the target machine from your
pc.</p>
<pre><code># Anything after the &#39;#&#39; charachter is a comment and doesn&#39;t need to be typed.
apt install openssh-server  # Install the ssh server on the target
systemctl start ssh         # Start it once installed
passwd user                 # Change the password or you can just use the default which is `live`
ip add                      # Get the IP address of the target
ssh user@ip.of.the.computer # Replace ip.of.the.computer with the actual ip address in the step above</code></pre>
<p>Open a terminal on the machine, and type the <code>su -</code>
commands to get root access on the Debian OS running from the usb drive
on the target machine.</p>
<pre><code>user@debian:~$ su -
Password:
root@debian:~#</code></pre>
<p>Now you are root, the super user admin, you can install the
<code>wget</code> command using the Debian <code>apt</code> package
manager.</p>
<pre><code>root@debian:~# apt install wget</code></pre>
<p>Once wget is installed, we can use it to download the latest image
from the
<a href="https://www.home-assistant.io/installation/generic-x86-64">HAOS
Download Page</a>, which is <code>haos_generic-x86-64-12.1.img.xz</code>
at time of writing.</p>
<pre><code>root@debian:~# wget https://github.com/home-assistant/operating-system/releases/download/12.1/haos_generic-x86-64-12.1.img.xz</code></pre>
<p>Now we have the image we are going to write to the disk, but the
question is which disk to write it to.</p>
<p>Your target PC will be different to mine but the tool
<code>lsblk</code> is good for showing what is installed and
mounted.</p>
<pre><code>root@debian:~# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
loop0    7:0    0  2.5G  1 loop /usr/lib/live/mount/rootfs/filesystem.squashfs
                                /run/live/rootfs/filesystem.squashfs
sda      8:0    0 14.9G  0 disk
&#x251C;&#x2500;sda1   8:1    0    1M  0 part
&#x251C;&#x2500;sda2   8:2    0    1G  0 part
&#x2514;&#x2500;sda3   8:3    0 13.9G  0 part
sdb      8:16   1 58.6G  0 disk
&#x251C;&#x2500;sdb1   8:17   1    3G  0 part /usr/lib/live/mount/medium
&#x2502;                               /run/live/medium
&#x2514;&#x2500;sdb2   8:18   1    5M  0 part</code></pre>
<p>The <code>loop0</code> is the mount where Debian is running from,
while the mounted <code>sdb1</code> and <code>sdb2</code> have the word
<em>live</em> telling us that's the actual USB drive we installed Debian
on to.</p>
<p>While your disk will be different, for me the disk to install it on
is <code>sda</code>. The partitions <code>sda1</code>,
<code>sda2</code>, and <code>sda3</code> are left overs from a previous
install. They will be overwritten anyway.</p>
<p>The drive I will be targeting is therefore known to the system as
<code>/dev/sda</code></p>
<p>The <code>dd</code> command will do a disk duplication and writes the
ones and zeros from the <code>if</code> input file, to the
<code>of</code> output file.</p>
<p>The command below will take a while and not display anything</p>
<pre><code>root@debian:~# dd if=haos_generic-x86-64-12.1.img.xz of=/dev/sda
761949+1 records in
761949+1 records out
390118272 bytes (390 MB, 372 MiB) copied, 66.3225 s, 5.9 MB/s</code></pre>
<p>Plug in an Ethernet cable that is connected to the network. Power the
system on. If you have a screen connected to the Generic x86-64 system,
after a minute or so the Home Assistant welcome banner will appear in
the console. In the browser of your desktop system, within a few minutes
you will be able to reach your new Home Assistant at
<code>homeassistant.local:8123</code>.</p>
<h1 id="links">Links</h1>
<ul>
<li><a href="https://hackerpublicradio.org/eps/hpr4099/index.html"
class="uri">https://hackerpublicradio.org/eps/hpr4099/index.html</a></li>
<li><a href="https://www.home-assistant.io/"
class="uri">https://www.home-assistant.io/</a></li>
<li><a href="https://support.hp.com/us-en/document/c03235347"
class="uri">https://support.hp.com/us-en/document/c03235347</a></li>
<li><a href="https://www.parkytowers.me.uk/thin/hp/t610/"
class="uri">https://www.parkytowers.me.uk/thin/hp/t610/</a></li>
<li><a href="https://www.home-assistant.io/installation/"
class="uri">https://www.home-assistant.io/installation/</a></li>
<li><a href="https://www.home-assistant.io/installation/generic-x86-64"
class="uri">https://www.home-assistant.io/installation/generic-x86-64</a></li>
<li><a
href="https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/"
class="uri">https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/</a></li>
</ul>
