Update home assistant supervisor/core from virsh guest console

Posted by Bruce Liu on August 24, 2024 , updated on December 19, 2024

🏷️ Tags: home assistant , virsh , Ubuntu , Docker , ghcr , DaoCloud

Supervisor

homeassistant migrates image registry from Docker Hub to Github container registry. For example, the image link of supervisor changes from home-assistant/amd64-hassio-supervisor:2024.08.0 to ghcr.io/home-assistant/amd64-hassio-supervisor:2024.08.0. It is very difficult to access ghcr.io directly in China. Therefore, it is impossible to directly update supervisor, etc. This post show a temporary solution based on DaoCloud/public-image-mirror.

Set up a ready-to-go ghcr image source

Open a sync-image issue.

Place the image sorce as a title with the format of <domian>/<owner>/<image>:<tag>. For example, ghcr.io/home-assistant/amd64-hassio-supervisor:2024.08.0. Mark the checkbox. And wait one or two minutes. You will received a email with the following content.

镜像 ghcr.io/home-assistant/amd64-hassio-supervisor:2024.08.0 同步完成 请使用 m.daocloud.io/ghcr.io/home-assistant/amd64-hassio-supervisor:2024.08.0 替代源镜像

Let’s go to pull the image with the new source.

Update supervisor from a guest console

Open a guest console via virsh.

virsh console hass

root

Pull the supervisor image from the alternative source.

docker pull m.daocloud.io/ghcr.io/home-assistant/amd64-hassio-supervisor:2024.08.0

Add the recognizable tags.

docker tag "m.daocloud.io/ghcr.io/home-assistant/amd64-hassio-supervisor:2024.08.0" "ghcr.io/home-assistant/amd64-hassio-supervisor:2024.08.0"
docker tag "ghcr.io/home-assistant/amd64-hassio-supervisor:2024.08.0" "ghcr.io/home-assistant/amd64-hassio-supervisor:latest"

Stop current hassio_supervisor container.

docker stop hassio_supervisor

And reboot homeassistant os. hassos-supervisor script will recreate the container automatically. The deprecated images will be removed automatically as well.

Note that, you can do this on Terminal addon from homeassistant lovelace.

Useful commands

Normal method to update hassio_supervisor.

ha su update or ha supervisor update

Check jobs running on haos.

ha job info

List all containers:

docker ps -a

List images:

docker images

Core commands

docker pull m.daocloud.io/ghcr.io/home-assistant/qemux86-64-homeassistant:2024.12.4

docker tag m.daocloud.io/ghcr.io/home-assistant/qemux86-64-homeassistant:2024.12.4 ghcr.io/home-assistant/qemux86-64-homeassistant:2024.12.4

ha core update

I place a script to make it on Github Gist. And you can run it directly from terminal.

curl -l https://gh.api.99988866.xyz/https://gist.githubusercontent.com/longavailable/44af7d42ac76ac501fe7d7e832519084/raw/9adda982dc74d95ce5dfe2c1faa36829411f72c8/update-ha-core-qemux86-64-homeassistant.sh | bash

Both virsh and Terminal addon work.

References


Share on:

« PREVIOUS: Useful tools