Skip to content

Instantly share code, notes, and snippets.

@ScottG489
Last active July 14, 2023 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ScottG489/cbed99f539a4d6d3c36099d84cda8bc7 to your computer and use it in GitHub Desktop.
Save ScottG489/cbed99f539a4d6d3c36099d84cda8bc7 to your computer and use it in GitHub Desktop.
Home Assistant Supervisor installed in a Sysbox container

Prerequisite: You must have Sysbox installed on the host.

  1. Build the Dockerfile (follow it's instructions at the top)

  2. Run: docker run --rm -it --runtime sysbox-runc -p 8123:8123 --ulimit rtprio=-1:-1 --name ha hasys bash

  3. Run this after above has started: docker exec -it ha ./run.sh

Eventually HA should come up. However, there are a lot of serious problems and you won't have full functionality. I had 3 repairs mentioned:

  • Unhealthy system - Not privileged
  • Unsupported system - CGroup version
  • Unsupported system - Network Manager issues

Was able to add and control a wifi bulb then called it a success and stopped there!

Misc notes:

  • Installed iputils-ping because ping was required at least during install of supervisor.
  • Used version 23.0.6-1 of docker because there's a problem with sysbox and using --network=host in Docker v24 - nestybox/sysbox#712
  • BYPASS_OS_CHECK=true because debian:12 isn't yet supported by supervisor
  • mount --make-shared / because supervisor was complaining about this at runtime and wouldn't start
  • run.sh because some things needed to be run after starting the container so systemd was running
  • --ulimit rtprio=-1:-1 because the audio container tries to set a ulimit. This should maybe be set to different values.
# Build this:
# https://github.com/nestybox/dockerfiles/blob/master/ubuntu-bionic-systemd/Dockerfile
# Use debian:12 as the base. Then use the built image here:
#FROM replace-me:latest
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
iputils-ping \
apt-transport-https \
ca-certificates \
gnupg \
lsb-release \
unzip \
apparmor \
jq \
wget \
curl \
udisks2 \
libglib2.0-bin \
network-manager \
dbus \
lsb-release \
systemd-journal-remote \
systemd-resolved -y
RUN curl -fsSL get.docker.com | sh -s -- --version 23.0.6-1
RUN wget https://github.com/home-assistant/os-agent/releases/download/1.5.1/os-agent_1.5.1_linux_x86_64.deb
RUN wget https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
COPY run.sh /run.sh
ENV BYPASS_OS_CHECK=true
CMD ["ls"]
#!/bin/bash
mount --make-shared /
systemctl daemon-reload
dpkg -i os-agent_1.5.1_linux_x86_64.deb
apt install ./homeassistant-supervised.deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment