Migrate from HA core to HA operating system (or container image) running in a systemd-nspawn container?

I don’t really want to run Docker on my RPi, what I’d like to do is grab the HA operating system image and get systemd-nspawn to run it. And I’d like to migrate my existing config.

Right now it’s running core on a device that is primarily a fileserver. I’d like to keep it running on that physical device, which will continue to run RPI OS, but just have that RPi OS boot HA OS inside a whole-OS container via systemd-nspawn, and pass the USB devices and a veth into that container.

Anyone have any idea how I could do that?

I grabbed the disk image, but the partition table has many partitions on it and systemd-nspawn can’t figure out which one is the root partition (and honestly neither can I).

It looks like maybe the OCI support in systemd-nspawn together somehow with the image normally used by docker might be the way to go also. Anyone with any systemd-nspawn experience?

You might consider Podman. It uses the same basic interfaces (and images) as Docker but does not require running a daemon. (And it works nicely as non-root!)

Ooh, I like that idea, and it seems to be available on RPi OS so I’ll try that out.

How do I make the new podman managed thing have the same config as the existing core? I just point the pod at the current config directory?

Also does the container get access to the USB devices by default? Or do I have to manually specify my zigbee and zwave devices?

I think that will work, yeah.

You need to pass them in as --device. I’m still working on my own configuration… I have the best intentions of writing it up all nicely once I have it as I want. But … I’ll go ahead and start a thread with some bits from what I have now that might be useful to others.

1 Like

Great. can you link to that thread from here?

Yes. Work in progress: configuration for running a Home Assistant in containers with systemd and podman on Fedora IoT

(I would have sooner but I spent the last two hours writing it!)