Need help debugging lxc container on Rocky Linux 9 and Ubuntu 24

Heavens! That was a tricky one for sure.

The error:

lxc-start centos5-base 20240924185128.959 NOTICE   start - ../src/lxc/start.c:start:2194 - Exec'ing "/sbin/init"
lxc-start centos5-base 20240924185128.959 ERROR    start - ../src/lxc/start.c:start:2197 - No such file or directory - Failed to exec "/sbin/init"

Is misleading at best. I copied the same image to a variety of different hosts to try and get my head wrapped around the reason why it works on one, but not another.

Eventually I moved it to a machine where by accident I figured out what I was doing wrong all along… On this one host the image would run, but died immediately complaining about a missing shared library.

I then realized that the configuration I created for the image mounted /lib and /usr/lib from the host OS. Once I fixed that, the image runs successfully.

So it wasn’t anything to do with “no such file or directory” as the error seemed to indicate, but init in the image trying to execute with incompatible libraries.

1 Like