Systemd-nspawn?

I found no discussion about systemd-nspawn, so I’ll start one.

I’m running a home server with several services like nextcloud in systemd-nspawn containers. I would like to migrate home-assistant from pi4 to the server. What are my options? If possible, I would like to use systemd-nspawn.

  • Can I use nspawn instead of docker? Has anyone tried it? I suppose I can extract the filesystem from the docker container and run it with systemd-nspawn, but how would upgrades have to be done? I guess also supervised isn’t an option as it uses docker.
  • Is supervised install possible inside a systemd-nspawn container? Docker inside nspawn. That way I could have all my top level containers as nspawn. Are nested containers a good idea in general?
  • Is using docker/supervisor alongside nspawn a good idea? Should it have it’s own network bridge or use the same as the nspawn containers?
  • Would it be best to run a VM anyway? I guess the overhead isn’t too bad with KVM.

Did you ever get this working? I’d like a similar thing, posted about it here but also got no response so far:

Yes, I installed the python version (home-assistant core) inside a systemd-nspawn container, and it seems to work well. I like it as it works like a normal operating system. I run hass with tmux. Maybe a systemd service would be better, but I haven’t got to that yet.