Cannot start container made from image created from lxd-p2c

Okay, can you show ls -lh /mnt/lib/systemd/systemd as well as file /mnt/lib/systemd/systemd and ldd /mnt/lib/systemd/systemd?

@stgraber ok, here it is:

root@hcpplcc1:/# ls -lh /mnt/rootfs/lib/systemd/systemd
-rwxr-xr-x 1 1000000 1000000 1.6M Aug 26 10:20 /mnt/rootfs/lib/systemd/systemd

root@hcpplcc1:/# file /mnt/rootfs/lib/systemd/systemd
/mnt/rootfs/lib/systemd/systemd: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/, for GNU/Linux 3.2.0, BuildID[sha1]=230acb059171dc7c19b9318d5ef5feb2c6f4e568, stripped

root@hcpplcc1:/# ldd /mnt/rootfs/lib/systemd/systemd (0x00007ffe6c7d3000) => /lib/x86_64-linux-gnu/ (0x00007f6976b30000) => not found => /lib/x86_64-linux-gnu/ (0x00007f6976b25000) => /lib/x86_64-linux-gnu/ (0x00007f6976b03000) => /lib/x86_64-linux-gnu/ (0x00007f6976ad8000) => /lib/x86_64-linux-gnu/ (0x00007f6976a78000) => /lib/x86_64-linux-gnu/ (0x00007f6976a1f000) => /lib/x86_64-linux-gnu/ (0x00007f6976a0d000) => /lib/x86_64-linux-gnu/ (0x00007f69769e1000) => /lib/x86_64-linux-gnu/ (0x00007f69769c6000) => /lib/x86_64-linux-gnu/ (0x00007f69769b1000) => /lib/x86_64-linux-gnu/ (0x00007f69769a6000) => /lib/x86_64-linux-gnu/ (0x00007f6976934000)
        /lib64/ (0x00007f69770bc000) => /lib/x86_64-linux-gnu/ (0x00007f6976911000) => /lib/x86_64-linux-gnu/ (0x00007f6976881000) => /lib/x86_64-linux-gnu/ (0x00007f697687b000) => /lib/x86_64-linux-gnu/ (0x00007f6976873000) => /lib/x86_64-linux-gnu/ (0x00007f6976848000) => /lib/x86_64-linux-gnu/ (0x00007f6976572000) => /lib/x86_64-linux-gnu/ (0x00007f6976569000) => /lib/x86_64-linux-gnu/ (0x00007f69764fe000) => /lib/x86_64-linux-gnu/ (0x00007f69764f4000) => /lib/x86_64-linux-gnu/ (0x00007f69764e2000) => /lib/x86_64-linux-gnu/ (0x00007f69764b3000) => /lib/x86_64-linux-gnu/ (0x00007f6976364000)

Ok, that all looks plausibly correct :slight_smile:

Can you try:

  • chroot /mnt/rootfs /sbin/init

Here is the result:

root@hcpplcc1:~# chroot /mnt/rootfs /sbin/init
/sbin/init: error while loading shared libraries: cannot open shared object file: No such file or directory

ok, so that’s the problem, you’re missing a library that systemd needs apparently.

How is that possible? systemd is running fine on the system that was cloned.

The system that was cloned uses LVM2 and individual filesystems for /, /var, /opt, /home, /usr, and more. Is it doing something in the clone that would prevent it from traversing the whole tree correctly?

What is the next step given systemd works on the cloned system?

Does /var, /usr, … look empty in that container (/mnt/…)?

/var, /tmp are empty. /usr, /sbin, /etc are full.

That’s odd… Anyway to answer your original question, when dealing with multiple mounts, they should all be passed to lxd-p2c.

  lxd-p2c <target URL> <container name> <filesystem root> [<filesystem mounts>...] [flags]

So this expects a call like lxd-p2c URL NAME / /var /opt /home /usr so the rsync transfer will include those mountpoints too.

I will try to recreate the image and see if that helps. Thanks