Installing Home Assistant Supervised on a Raspberry Pi using Debian 12

i.e within the title: Installing Home Assistant Supervised on a Raspberry Pi with Debian 11

or: Using Debian 11 and following a strict set of guidelines available HERE → Please also follow the link

or: This guide will help you to install Home Assistant Supervised, on a Raspberry Pi with Debian 11

or: 1.1) Start by downloading the correct xz-compressed image for your Pi from HERE → the link points to downloads for Debian, not Raspberry Pi OS.

Please note: Supported Operating System, System dependencies and versions → Debian Linux (no derivatives). Although Raspberry Pi OS is based on Debian, it is a derivative.

Probably you’ll find more to-the-point-instructions for installing Home Assistant on Raspberry Pi OS here (fairly new, those instructions are as of July 25, 2022).

3 Likes

Thanks Tamsy. I suggest the following be added at the top to make is very clear “Although Raspberry Pi OS is based on Debian, it is a derivative and as such is not supported with these installation instructions. Do so at your own risk.”

Thanks for the link. I started down that path but it seems to be for HA without Supervised.

Did you click the all caps link and read it? It says this right in the requirements section:

Debian Linux Debian 11 aka Bullseye (no derivatives)

1 Like

Reading, What’s that?

2 Likes

The file for PiOS is in /boot/

Here are my exact steps - worked like a perfect charm (and proof of it working too):

Same here…

I thought this was going to be successful install but although the supervisor would run in docker container, it was getting a “connection refused” trying to access more images and sat there for an hour. Trying to kill the supervisor took another half hour. Another hour of research and someone mentioned ‘resolv.conf had been overwritten’. So I checked mine.

My /etc/resolve.conf was empty. There was no part of the instructions that described how to set up the network. My router knew to assign the eth0 port an ip address and I was able to ssh into it. I ended up manually editing resolv.conf and adding nameserver information and BINGO! it started to come up.

Would you please add some mention in this list of instructions how to ensure the network was configured properly. It put me back hours and untold aggravation.

Hopefully I won’t end up with an unsupported configuration…
Cheers

This is because the DNS settings are managed by NetworkManager.

You should not edit resolv.conf manually as it is generated by NetworkManager. It will likely to get overridden at any time.

The easiest procedure to configure network settings (including DNS servers) is from within Home Assistant:

  1. Goto HA → Settings → System → Network
  2. Choose your network interface → IPv4
  3. Choose “Static” and set:
  • IP-Address/Netmask (i.e. 192.168.0.10/24).
  • Gateway Address.
  • DNS Server.
  1. Save and restart HA.

If you want to edit/change DNS settings through the CLI use nmcli (instead of editing /etc/resolv.conf):

  1. Find out the active connection name:
    sudo nmcli con

The output looks something like:

NAME             UUID                                  TYPE      DEVICE 
Supervisor eno1  76b55560-114g-47ba-844e-a1eke625bd48  ethernet  eno1

were the connection name is "Supervisor eno1".

  1. Now set/change DNS Servers like:
    sudo nmcli con mod "Supervisor eno1" ipv4.dns "8.8.8.8 8.8.4.4"

  2. To ignore automatically configured nameservers and search domains, i.e. the settings passed from DHCP:
    sudo nmcli con mod "Supervisor eno1" ipv4.ignore-auto-dns yes

  3. To not to get temporarily disconnected restart NetworkManager with:
    sudo service NetworkManager restart

More:

PS. If you are not using IPv6 you should switch this off (see above: 1. Goto HA → Settings → System → Network).

1 Like

Thank you - very helpful info. Unfortunately after getting it running, it came up as unsupported and trying to correct it has me starting all over. So I’ll keep this handy to get through the next attempt. There appears to be quite a few folks that ended up in ‘unhealthy’ when I read gown to the end and it’s not clear why or how best to prevent it. (Hopefully the reason will be made clear later.

Cheers and thanks again.

I started all over, wiped the disk and followed verbatim (I know, everyone says that) but after booting up the debian bullseye and doing the update - it apparently updated to bookworm when it failed to get the docker image. I specifically used the Bullseye release here. The error was:

The repository 'https://download.docker.com/linux/debian bookworm Release' does not have a Release file.

So after fiddling and googling around, I’m starting over again to try to get a SUPPORTED HA installation.

It’s a little perplexing when those two links point to pages that look exactly alike except for the revisions called out. When you look at github homeassistant/architecture section they are document 014 readme files. I don’t get how they are the same yet different, but then I’m not a github source developer.
It’s just very confusing when you think you’re following sanctioned procedures. There should be a warning on the top of the outdated one saying see: updated instructions here->architecture/0014-home-assistant-supervised.md at 2017fdae15d48f287f2398e3243a91ec7a34b161 · home-assistant/architecture · GitHub

That is indeed the correct image to use for the RPI4.:

But:

points to Debian 12 (Bookworm) which is certainly unsupported as for HA Supervised. Where did you get that from?

Checking the script at https://get.docker.com/ Debian 12 alias Bookworm is not even implemented yet:

			case "$dist_version" in
					11)
						dist_version="bullseye"
					;;
					10)
						dist_version="buster"
					;;
					9)
						dist_version="stretch"
					;;
					8)
						dist_version="jessie"
					;;

Thanks Tamsy,
This is exactly what I found too, except it took me a few hours while you probably found it in minutes. After loading the bullseye image, I thought the apt update && apt upgrade -y command might have brought it up to bookworm. But I have no idea.

sudo cat /etc/issue.net

will show you the name and version of the underlying OS.

It should read:
Debian GNU/Linux 11

Also it should be emphasized to strictly follow 1.5) to create an unpriviledged user to continue the installation as followed by 1.6.) where you are continuing the installation from “remote” through the LAN.

I have seen all sorts of hard to track errors with users doing the whole installation as super user (root) and directly connected to the RPI.

2 Likes

@kanga_who and @Tamsy, you have both saved my butt when I bit the bullet and reinstalled EVERYTHING on my HA machine (FYI it is a RPI 4 (8 Gig ram) - booting off a (samsung model T7) 1TB SSD) - a few weeks back - to make my supervised version fully supported, per the above post you just made. I smiled when I ready your latest post, really lucky timing on my part! I have to say, @Tamsy was UNBELIEVEABLY helpful, supportive and very patient with me as had to redo it numerous times due to strange issues. Long story short, most of the issues revolved around DNS. I think it is due to my local network setup as it is not very common for home use (someone tried to steal my identity right before I barely rectified a cvery bad flooding situation in my home - so I because a security ‘freak’ and have leak sensors etc. al over thye home. My local network is using the Omada (TP-LInk product line) paradigm with a TL-ER7206 router controled via the OC300 controller with all sorts of whacky securitiy and VPN settings.

Long story short, when utlilizing this line in your install script (and as I said before it might be because of my router/local network):

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

vs. the ever so slighlty different step in the official Nabu Cases / HomeAssistant.io instructions for Home Assitant Supervised (from here):

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

  • the only difference I saw in the entire installation process (besides your version including the up front OS install) between the two, was:

Your script include apparmor-utils whereas the otherone uses apparmor instead. My install only works flawlessly without any issues using the second version. Is my understanding the apparmor-utils automatically cause apparmor to be insalled (any maybe it is a slighly different version?), or the apparmor-utils has or is missing something that causes the DNS issues for me - ?

My system has been running smooth as glass lately so I do not want to make any unnecessary changes, but I thought I should mention this to you.

@kanga_who (and @Tamsy feel free to please chime in as you helped me with my journey), what are your thoughts on this?

Thanks to both of you again and I am so lucky to have finished the reinstall when I did!

System Information

version core-2022.12.4
installation_type Home Assistant Supervised
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.10.7
os_name Linux
os_version 5.10.0-19-arm64
arch aarch64
timezone America/New_York
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.28.4
Stage running
Available Repositories 1227
Downloaded Repositories 23
AccuWeather
can_reach_server ok
remaining_requests 27
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Debian GNU/Linux 11 (bullseye)
update_channel stable
supervisor_version supervisor-2022.11.2
agent_version 1.4.1
docker_version 20.10.21
disk_total 915.4 GB
disk_used 17.5 GB
healthy true
supported true
supervisor_api ok
version_api ok
installed_addons AdGuard Home (4.7.5), AppDaemon (0.10.1), Core DNS Override (0.1.1), Duck DNS (1.15.0), File editor (5.4.2), Home Assistant Google Drive Backup (0.109.2), Log Viewer (0.14.0), Mosquitto broker (6.1.3), Samba share (10.0.0), Terminal & SSH (9.6.1)
Dashboards
dashboards 4
resources 15
views 25
mode storage
Recorder
oldest_recorder_run November 13, 2022 at 9:55 AM
current_recorder_run December 13, 2022 at 7:06 AM
estimated_db_size 1729.08 MiB
database_engine sqlite
database_version 3.38.5
1 Like

Hi all,

I do have a quite dumb question and it bothers me a lot that I cannot find myself the answer to.
What is the username/password if I want to login via SSH after flashing the SSD with balenaEtcher?

No username/password does not work.
‘root/root’ or ‘root/password’ or ‘root/’ does not work as well.

I even tried to modify the sysconfig.txt file and set my own password or simply uncommenting the standard one. I also tried copy/pasting the password.

It just does not work.
I do not have a spare monitor at the moment so ssh is all I got :-/

edit: I just noticed that editing the sysconfig.txt does not help, because it is getting overwritten.
Just pulled the ssd and plugged it into my laptop and the changes are gone.

Best regards,
Manuel

Welcome to the forum, Manuel :wave:t3:

You simply cant without being connected directly to your RPI with a monitor and keyboard.

The root password can only be set by directly being connected to the RPI with a new installation and there are good reasons for this restriction.

User root is not supposed to connect directly through SSH anyway for security matters. Do yourself (and the community here) a favor and create that unpriviledged user as described with 1.5).
Login through SSH as that user only and manage the system by prepending sudo to every console command.

FYI if you are not strictly sticking to the guide there is little chance that you get support in here.

So I need to connect the PI to a montior at least once, right?

Adding an unpriviledged user would have been my first step.