> [!sub]- [[📌Subscribe & Engage|🧡FREE subscriber-only Products. Subscribe and get a chance to win!]]
This installation method nullifies the benefits of a [[HA]] Supervised installation, for those who only have one Linux system to tinker with and want to do other things with the [[OS]], while having a stable virtualised system based on [[HAOS]].
This document assumes a [[BM]] or [[VM]] installation of [[Debian]] and then [[HAOS]]. Following installation of [[HAOS]] you can install other software to your heart's content.
> [!attention] You can also use a different [[OS]] to install [[HAOS]]. You can, for example, use [[Ubuntu]] desktop, instead of [[Debian]]. The commands will be similar; however, if enough people request it I can write a full guide. You can engage with me on [Ko-Fi](https://ko-fi.com/habitatstech)
## Install [[Debian]]
Follow the instructions: [[3. Debian - Install BM|Debian - Install BM]] or [[3. Debian - Install VM|Debian - Install VM]]
## Setup [[Debian]]
<button class="login-root">🖥>login</button> <code class="login-root">root</code>
Make a note of the [[IPv4]].
<pre><code class="g-code">ip a</code></pre>
![[haos-os-0-0.png]]
> [!attention] Enabling `root` [[SSH]] login increases the attack surface from a security standpoint. Suggestion is to enable `root` [[SSH]] login for the purposes of this guide only, then remove ability for `root` to [[SSH]], by commenting `# PermitRootLogin yes`
Allow `root` to [[SSH]] login.
<pre><code class="g-code">nano /etc/ssh/sshd_config</code></pre>
```
PermitRootLogin yes
```
<button style="color:#888888; font-size: 18px;">ctrl</button><button style="color:#888888; font-size: 18px;">s</button> - Save <button style="color:#888888; font-size: 18px;">ctrl</button><button style="color:#888888; font-size: 18px;">x</button> - Exit
![[haos-os-0-1.png]]
<pre><code class="g-code">systemctl restart sshd</code></pre>
or
<pre><code class="g-code">reboot</code></pre>
<button class="login-root">🖥>login</button> <code class="login-root">root</code>
[[SSH]] as `root`.
```sh
ssh
[email protected]
```
![[haos-os-0-2.png]]
<pre><code class="g-code">apt update</code></pre>
<pre><code class="g-code">apt dist-upgrade</code></pre>
Find the timezone of your location.
<pre><code class="g-code">timedatectl list-timezones</code></pre>
Set the timezone using your location value.
<pre><code class="g-code">timedatectl set-timezone Europe/London</code></pre>
Install required dependencies for [[HAOS]] ([bridge-utils](https://wiki.debian.org/BridgeNetworkConnections) [libvirt](https://libvirt.org), [[QEMU]] and [virt-manager](https://virt-manager.org)).
<pre><code class="g-code">apt install bridge-utils qemu-system libvirt-clients libvirt-daemon-system virt-manager</code></pre>
Setup a bridge `br0` on the [[NIC]] connected to the [[LAN]] `enp1s0` and assign a static [[IPv4]] `192.168.0.44/24`.
<pre><code class="g-code">nano /etc/network/interfaces</code></pre>
> [!info]- Two methods to find the [[NIC]] name:
>
>> Use <code class="g-code">ip a</code> to identify the name by locating the [[NIC]] which has an [[IPv4]]
>>
>> <pre><code class="g-code">ip a</code></pre>
>>
>> ![[haos-os-1-0.png]]
>
>> Look in the `interfaces` config file under primary network interface.
>>
>> ![[haos-os-1-1.png]]
In case we need to revert to the default configuration in the future, comment the two lines for the primary [[NIC]] and change `allow-hotplug` to `auto`.
![[haos-os-1-2.png]]
DO NOT skip any of the directives below otherwise you will loose the network connection. Adjust [[NIC]] names and [[IPv4]] to suit your setup.
```
# The primary network interface
auto enp1s0
iface enp1s0 inet manual
# The network bridge
auto br0
iface br0 inet static
bridge_ports enp1s0
address 192.168.0.44/24
gateway 192.168.0.1
```
<button style="color:#888888; font-size: 18px;">ctrl</button><button style="color:#888888; font-size: 18px;">s</button> - Save <button style="color:#888888; font-size: 18px;">ctrl</button><button style="color:#888888; font-size: 18px;">x</button> - Exit
![[haos-os-1-3.png]]
Restart network for new settings to activate.
<pre><code class="g-code">systemctl restart networking</code></pre>
If you were accessing [[Debian]] remotely, you will have to [[SSH]] again using the new [[IPv4]].
<pre><code class="g-code">ssh
[email protected]</code></pre>
![[haos-os-2-0.png]]
[[3. HAOS - Install VM#Download HAOS|Download HAOS VM image]]
<pre><code class="g-code">
wget https://github.com/home-assistant/operating-system/releases/download/10.0/haos_ova-10.0.qcow2.xz -P /var/lib/libvirt/images
</code></pre>
Uncompress [[HAOS]] [[VM]] image
<pre><code class="g-code">unxz /var/lib/libvirt/images/haos_ova-10.0.qcow2.xz</code></pre>
Install [[Xfce]] desktop ([[Xfce]] is lightweight and suitable as a server [[GUI]]). Assuming you have the system resources, you can opt to install a more heavyweight desktop (e.g. `GNOME`, `KDE`, `MATE`).
<pre><code class="g-code">tasksel</code></pre>
![[haos-os-2-1.png]]
`Keyboard layout` selection comes up on [[BM]] installs only.
![[haos-os-2-2.png]]
<pre><code class="g-code">reboot</code></pre>
## Install [[Anydesk]]
This step is optional and only required if [[GUI]] remote access to [[Xfce]] desktop is required.
<button class="login-root">🖥>login</button> <code class="login-root">root</code>
<pre><code class="g-code">ssh
[email protected]</code></pre>
![[haos-os-3-0.png]]
Add [[Anydesk]] to the `deb` repository and install.
<pre><code class="g-code">wget -qO - https://keys.anydesk.com/repos/DEB-GPG-KEY | apt-key add -</code></pre>
<pre><code class="g-code">echo "deb http://deb.anydesk.com/ all main" > /etc/apt/sources.list.d/anydesk-stable.list</code></pre>
<pre><code class="g-code">apt update</code></pre>
<pre><code class="g-code">apt install anydesk</code></pre>
## Install [[HAOS]]
<button class="login-user">🖥>login</button> <code class="login-user">user</code>
![[haos-os-3-1.png]]
Locate and Launch `Virtual Machine Manager`.
<button style="color:#1e90ff; font-size: 18px;">Applications</button> <button style="color:#1e90ff; font-size: 18px;">System</button> <button style="color:#1e90ff; font-size: 18px;">Virtual Machine Manager</button>
![[haos-os-3-2.png]]
Authenticate using `root` user password.
![[haos-os-4-0.png]]
<button style="color:#1e90ff; font-size: 18px;">File</button> <button style="color:#1e90ff; font-size: 18px;">New Virtual Machine</button>
![[haos-os-4-1.png]]
<b style="color:#1e90ff; font-size: 18px;">Import existing disk image</b>
<button style="color:#1e90ff; font-size: 18px;">Forward</button>
![[haos-os-5-0.png]]
<button style="color:#1e90ff; font-size: 18px;">Browse</button> <b style="color:#1e90ff; font-size: 18px;">haos_ova-10.0.qcow2</b> <button style="color:#1e90ff; font-size: 18px;">Choose Volume</button>
<button style="color:#1e90ff; font-size: 18px;">Forward</button>
![[haos-os-5-1.png]]
<b style="color:#1e90ff; font-size: 18px;">Choose the operating system</b>: <code style="color:#ffffff">Generic Linux 2020</code>
<button style="color:#1e90ff; font-size: 18px;">Forward</button>
![[haos-os-5-2.png]]
<b style="color:#1e90ff; font-size: 18px;">Memory</b>: <code style="color:#ffffff">512</code> - increase to `2048` if possible
<b style="color:#1e90ff; font-size: 18px;">CPUs</b>: <code style="color:#ffffff">2</code>
<button style="color:#1e90ff; font-size: 18px;">Forward</button>
![[haos-os-5-3.png]]
<b style="color:#1e90ff; font-size: 18px;">Name</b>: <code style="color:#ffffff">haos</code> - change to suit your taste
<b style="color:#1e90ff; font-size: 18px;">Customise configuration before install</b>: <code style="color:#ffffff">enable</code>
<b style="color:#1e90ff; font-size: 18px;">Network Selection</b>: <code style="color:#ffffff">Bridge Device...</code>
<b style="color:#1e90ff; font-size: 18px;">Device Name</b>: <code style="color:#ffffff">br0</code>
<button style="color:#1e90ff; font-size: 18px;">Finish</button>
![[haos-os-5-4.png]]
<b style="color:#1e90ff; font-size: 18px;">Chipset</b>: <code style="color:#ffffff">Q35</code>
<b style="color:#1e90ff; font-size: 18px;">Firmware</b>: <code style="color:#ffffff">UEFI x86_64: OVMF_CODE_4M.fd</code>
<button style="color:#1e90ff; font-size: 18px;">Apply</button>
![[haos-os-6-0.png]]
<b style="color:#1e90ff; font-size: 18px;">Autostart</b>: <code style="color:#ffffff">enable</code> - `disable` if you wish
<button style="color:#1e90ff; font-size: 18px;">Apply</button>
![[haos-os-6-1.png]]
<button style="color:#1e90ff; font-size: 18px;">Begin Installation</button>
![[haos-os-7-0.png]]
Wait until you verify [[HAOS]] has an [[IPv4]] and [[IPv6]] on the correct [[NIC]].
![[haos-os-7-1.png]]
[[HAOS]] is now installed. Use the [[webUI]] to setup [[HAOS]]. Follow [[4. HAOS - Setup]]
`virt-manager` can now be used to manage one or more [[HAOS]] instances, take backups, snapshots, etc. `virt-manager` can also be used to run any virtualised workload. Of course [[Debian]] is also available to run any [[SW]] non-virtualised.
![[haos-virt-manager.mp4]]
## [[BM]] [[Debian]] + [[HAOS]] Example
### Hardware
[[GoWin]] **GW-R86S-P2** / cost ~ U$ 250/-
[[CPU]]: Intel [N5105](https://www.intel.com/content/www/us/en/products/sku/212328/intel-celeron-processor-n5105-4m-cache-up-to-2-90-ghz/specifications.html)
[[RAM]]: 16GB
[[eMMC]]: 128GB
[[NVMe]]: 1 x M2 2280 empty/unpopulated
[[NIC]]: 3 x 2.5GbE Intel [I225-V](https://www.intel.com/content/www/us/en/products/sku/184676/intel-ethernet-controller-i225v/specifications.html)
[[WiFi]]: AMD/Intel option addon module
For disk storage you can start using [[eMMC]] and later add [[NVMe]] either as a `boot` drive or additional disk storage.
Insert the [[Ventoy - Install|Ventoy USB drive]] in a USB port on **GW-R86S-P2** and power up.
### Configure [[BIOS]]
![[haos-os-8-0.png]]
<button style="color:#888888; font-size: 18px;">del</button> - when you see the **RS86S** logo above to access the [[BIOS]]
![[haos-os-8-1.png]]
<b style="color:#1e90ff; font-size: 18px;">VT-X</b>: <code style="color:#ffffff">Enabled</code>
![[haos-os-8-2.png]]
<b style="color:#1e90ff; font-size: 18px;">Secure Boot</b>: <code style="color:#ffffff">Disabled</code>
![[haos-os-8-3.png]]
<b style="color:#1e90ff; font-size: 18px;">Boot Option #1</b>: <code style="color:#ffffff">USB key</code> - external USB flash drives
<b style="color:#1e90ff; font-size: 18px;">Boot Option #2</b>: <code style="color:#ffffff">USB Hard Disk</code> - external USB disk drives, [[HDD]] or [[SSD]]
<b style="color:#1e90ff; font-size: 18px;">Boot Option #3</b>: <code style="color:#ffffff">NVME</code> - internal [[NVMe]] M2 slot
<b style="color:#1e90ff; font-size: 18px;">Boot Option #4</b>: <code style="color:#ffffff">Hard Disk</code> - internal [[eMMC]] disk storage
<b style="color:#1e90ff; font-size: 18px;">Boot Option #5</b>: <code style="color:#ffffff">SD</code> - external [[SD]] slot
<b style="color:#1e90ff; font-size: 18px;">Boot Option #6</b>: <code style="color:#ffffff">Disabled</code>
![[haos-os-8-4.png]]
<b style="color:#1e90ff; font-size: 18px;">Save Changes and Reset</b>: <code style="color:#ffffff">Yes</code>
![[haos-os-8-5.png]]
### Install [[Debian]]
Follow the instructions: [[3. Debian - Install BM|Debian - Install BM]], observing the following differences.
Because this system has 3 [[NIC]]s, select the [[NIC]] for the primary network interface. The [[NIC]]s are clearly labelled on the chassis `ETH0`, `ETH1`, `ETH2`.
<b style="color:#1e90ff; font-size: 18px;">Primary Network Interface</b>: <code style="color:#ffffff">enp1s0</code> - your choice
<button style="color:#1e90ff; font-size: 18px;">Continue</button>
![[haos-os-9-0.png]]
<b style="color:#1e90ff; font-size: 18px;">Partition Disks</b>: <code style="color:#ffffff">Guided - use entire disk</code> - recommended, especially for internal [[eMMC]] use
<button style="color:#1e90ff; font-size: 18px;">Continue</button>
![[haos-os-9-1.png]]
<b style="color:#1e90ff; font-size: 18px;">Select Disk</b>: <code style="color:#ffffff">MMC/SD card #1 (mmcblk0)</code> - use internal [[eMMC]]
<button style="color:#1e90ff; font-size: 18px;">Continue</button>
![[haos-os-9-2.png]]
<b style="color:#1e90ff; font-size: 18px;">Partitioning Scheme</b>: <code style="color:#ffffff">All files in one partition</code>
<button style="color:#1e90ff; font-size: 18px;">Continue</button>
![[haos-os-9-3.png]]
<b style="color:#1e90ff; font-size: 18px;">Partition Overview</b>: <code style="color:#ffffff">Finish partitioning and write changes to disk</code>
<button style="color:#1e90ff; font-size: 18px;">Continue</button>
![[haos-os-9-4.png]]
<b style="color:#1e90ff; font-size: 18px;">Write changes to disks?</b>: <code style="color:#ffffff">Yes</code>
<button style="color:#1e90ff; font-size: 18px;">Continue</button>
![[haos-os-9-5.png]]
Follow the rest of the guide: [[3. Debian - Install BM#Package Manager|Debian - Install BM - Package Manager]]
### Setup [[Debian]]
Follow this guide from this point: [[3. HAOS - Install OS#Setup Debian|Setup Debian]]