ha: replace the HAOS VM with a native Podman Quadlet container
The fixed 2 GiB ha_van allocation starved the 4 GB Pi. HA Container now runs on the host network (http://10.42.0.1:8123): ha/homeassistant.container installs to /etc/containers/systemd/, config in /srv/homeassistant, host D-Bus mounted for onboard Bluetooth (needs apparmor=unconfined — Ubuntu's dbus-daemon mediates per AppArmor label and denies AddMatch to BlueZ — plus NET_ADMIN/NET_RAW for habluetooth adapter recovery). Drop the VM-era plumbing: the 10.42.0.50 dhcp-host pin becomes a host-record for 10.42.0.1, and the legacy-URL DNAT + hairpin masquerade go away entirely. ha_van.xml retired to git history. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
8ab5a4cbd8
commit
3add42a0cb
@@ -61,7 +61,7 @@ This directory is the source of truth. The live system files live under `/etc`,
|
||||
- Cockpit: `https://192.168.10.251:9090` (or `.27`, or ZeroTier). Log in with a Unix account; enable *Administrative access* for action buttons.
|
||||
- Regulatory domain **CA** (unlocks 5GHz ch149–161 @30dBm, no DFS).
|
||||
- ZeroTier network `d3ecf5726d041b2a`, pushed DNS domain `wrede.pvt` via `192.168.196.115` + `192.168.10.5`.
|
||||
- Home Assistant (HAOS in libvirt VM `ha_van`) is bridged into `br0` at **`10.42.0.50:8123`** (pinned DHCP lease, name `homeassistant`); legacy URL `http://10.42.0.1:8123` still works via DNAT.
|
||||
- Home Assistant runs **natively on this host** (Podman Quadlet, host network) at **`http://10.42.0.1:8123`** (name `homeassistant`). The old HAOS VM `ha_van` (`10.42.0.50`) was retired 2026-07-07.
|
||||
|
||||
---
|
||||
|
||||
@@ -139,13 +139,13 @@ This directory is the source of truth. The live system files live under `/etc`,
|
||||
The `hbc` binary itself (venv at `~/venvs/hbd`, symlink `~/bin/hbc`) is installed once via the
|
||||
heartbeat project's own installer — see §4. `deploy.sh` only starts the service once it exists.
|
||||
|
||||
### `ha/` — Home Assistant VM
|
||||
### `ha/` — Home Assistant (native container)
|
||||
| file | → installs to | purpose |
|
||||
|---|---|---|
|
||||
| `ha_van.xml` | *(reference only — `virsh define ha/ha_van.xml` to restore)* | libvirt domain: HAOS VM, virtio NIC bridged onto `br0` (MAC `52:54:00:ad:0a:01`). Disk image lives outside the repo. |
|
||||
| `homeassistant.container` | `/etc/containers/systemd/homeassistant.container` | Podman Quadlet: HA Container on the host network (`:8123`), config in `/srv/homeassistant`, host D-Bus mounted for onboard Bluetooth. |
|
||||
|
||||
Not touched by `deploy.sh` — the VM's LAN address/name come from `ap/van-ap-dnsmasq.conf`
|
||||
(`dhcp-host` → `10.42.0.50`, `homeassistant`) and the legacy-URL DNAT from `ap/nftables.conf`.
|
||||
The `homeassistant` LAN name comes from `ap/van-ap-dnsmasq.conf` (`host-record` →
|
||||
`10.42.0.1`). The retired HAOS VM's domain XML (`ha_van.xml`) lives in git history.
|
||||
|
||||
---
|
||||
|
||||
@@ -206,20 +206,25 @@ Not touched by `deploy.sh` — the VM's LAN address/name come from `ap/van-ap-dn
|
||||
- The Access Points card shows both bands (5GHz `hostapd`, 2.4GHz `hostapd-2g`) with per-band client lists and **Restart** buttons; the radio list lives in `vanrouter.js` (`const APS`).
|
||||
- **Prefer** sets the manual WAN preference (see *Manual preference* above); **Up/Down** connect/disconnect the NM device.
|
||||
|
||||
### Home Assistant VM (`ha_van`)
|
||||
- HAOS runs as a libvirt KVM VM whose NIC is **bridged into `br0`** — it is a first-class LAN
|
||||
device, not NAT'd behind libvirt's `virbr0`. VanLink + wired clients reach it directly at
|
||||
`http://10.42.0.50:8123` (or `http://homeassistant:8123` / `homeassistant.local` via mDNS);
|
||||
ZT clients route in via the ZT-managed `10.42.0.0/24` route. mDNS/SSDP device discovery works
|
||||
because the VM shares the clients' L2 segment.
|
||||
- The old NAT-era URL `http://10.42.0.1:8123` keeps working: nftables DNATs it to `10.42.0.50`,
|
||||
with a hairpin masquerade for same-subnet clients (see comments in `ap/nftables.conf`).
|
||||
- History: the VM used to sit on libvirt's `default` NAT net (`192.168.122.50`) with a
|
||||
`/etc/libvirt/hooks/network` hook inserting FORWARD accepts above libvirt's REJECT. That broke
|
||||
whenever libvirtd re-inserted its chains on restart (hook doesn't fire then) — bridging removed
|
||||
the whole failure mode. The hook and the libvirt DHCP reservation are gone.
|
||||
- Operate: `virsh {start,shutdown,domstate} ha_van`; autostart is per libvirt config. Verify:
|
||||
`curl -s -o /dev/null -w '%{http_code}' http://10.42.0.50:8123/` → `200`.
|
||||
### Home Assistant (native Podman container)
|
||||
- HA Container runs on the host via a **Podman Quadlet** (`ha/homeassistant.container` →
|
||||
`/etc/containers/systemd/`; systemd generates `homeassistant.service`). **Host network**:
|
||||
HA binds `:8123` directly, so clients use `http://10.42.0.1:8123` (or
|
||||
`http://homeassistant:8123`); mDNS/SSDP discovery sees the LAN because there's no bridge
|
||||
or NAT in the way. Config lives in `/srv/homeassistant`.
|
||||
- **Bluetooth**: host BlueZ (`bluetooth.service`) serves the Pi's onboard `hci0` to HA over
|
||||
the mounted `/run/dbus` socket — add the Bluetooth integration in HA and it appears.
|
||||
- No add-on store (that was HAOS's Supervisor): Mosquitto/Zigbee2MQTT-style add-ons become
|
||||
their own containers/services if ever needed.
|
||||
- Operate: `systemctl {status,restart} homeassistant`. Update: bump/pull the image
|
||||
(`podman pull ghcr.io/home-assistant/home-assistant:stable`) and restart. After editing
|
||||
the `.container` file: `./deploy.sh` (or install + `systemctl daemon-reload`), then
|
||||
`systemctl restart homeassistant`. Verify:
|
||||
`curl -s -o /dev/null -w '%{http_code}' http://10.42.0.1:8123/` → `200`.
|
||||
- History: HA started as a HAOS VM on wayback (libvirt NAT, then bridged onto `br0` at
|
||||
`10.42.0.50` with a legacy-URL DNAT), moved to this Pi as an aarch64 VM 2026-07-06, and
|
||||
went native 2026-07-07 — the fixed 2 GiB VM allocation starved the 4 GB Pi. The domain
|
||||
XML (`ha/ha_van.xml`) and the DNAT/hairpin nftables rules are in git history.
|
||||
|
||||
### Never sleep (lid-closed operation)
|
||||
- wayback lives lid-closed in the van and must stay up. Stock logind `HandleLidSwitch=suspend` would sleep it on lid close (even on AC). The `power/10-vanlink-nolid.conf` drop-in sets all three lid actions to `ignore`; `deploy.sh` also masks every sleep target so idle / GUI / a stray `systemctl suspend` can't suspend it.
|
||||
|
||||
Reference in New Issue
Block a user