Docker containers in LXD container do not start back up after LXC remote copy

I have an email server running in an Ubuntu 24.04 LXD container. Works great, been using it for approx 2 months. Never any trouble with it when I restart the main server or the LXD container, everything gets right back up and running as expected.

However, I’m running into a problem copying that container to my laptop for some local dev on it.

When I copy that container I first stop the container, take a snapshot, start the container back up, then download the snapshot to my laptop via:

lxc copy server1:container-name/snapshot-name local:server1-container-name

In the downloaded container, the OS seems fine. But this email server that I’m using gets installed using docker containers for a few things, including the database (mariadb).

None of the docker containers start back up when I start the container on my laptop. However, when I stop/start or restart this container on my server everything starts back up properly.

The email server software has 3 docker containers. Those are stopped on my laptop’s copy of the container, but I can easily restart them using the email server’s startup command.

The mariadb docker container, which was working perfectly on the server’s original container, is basically “lost” on the copy of that container that I downloaded to my laptop. It’s as if the docker container does not exist, although the files for it are still in /var/lib/docker

When I try to get that mariadb docker container started on the lxd container copied to my laptop, this is the result:

root@lxd-container-name:~# docker start postal-mariadb
Error response from daemon: No such container: postal-mariadb
Error: failed to start containers: postal-mariadb

That container, postal-mariadb, literally was and still is running on the original container on my server. I did nothing to it or the container, just made a snapshot & copied it to my laptop. Then, unexpectedly, postal-mariadb apparently no longer exists.

And just an additional note, in case it’s relevant, when I installed I made the config changes to the LXD container required for running Docker containers within:

lxc config set container-name security.nesting=true security.syscalls.intercept.mknod=true security.syscalls.intercept.setxattr=true

Any idea why all the docker containers work just fine and always restart properly on the container in the server but that same lxd container copied to my laptop does not startup the docker containers & appears to “lose” the mariadb container?

What storage pool are you using on your source and target hosts?

On the source server I’m using zfs managing two partitions as a mirror.

On the target laptop I have LXD storage in rpool/lxd zfs dataset.

I haven’t yet, but to sort this issue out I’m going to switch to using mariadb non-docker installed via apt. My guess is that will enable me to copy the container without these issues.

Only reason I installed mariadb into a docker container was because the email server software install instructions did it that way.