How to debug container boot on LXD

Hi guys,

I’m trying to run Android x86 on Ubuntu with LXD. After running:
lxc start anx
the container won’t start and I can’t find any boot log for the container. The /var/log/lxd/anx/lxc.log only has:
lxc 20171128022043.438 WARN lxc_cgfsng - cgroups/cgfsng.c:chown_cgroup_wrapper:1496 - Error chmoding /sys/fs/cgroup/unified//lxc/anx: No such file or directory
lxc 20171128022043.438 WARN lxc_cgfsng - cgroups/cgfsng.c:chown_cgroup_wrapper:1523 - Error chmoding /sys/fs/cgroup/unified//lxc/anx: No such file or directory

Is this container started but fail to execute init or just fail to start? If the former, where can I find the init boot log to /dev/console when the container is not started?

Thanks,
Qiang

The most common problem with Android is that its init is at /system/init rather than /sbin/init, so the container just fails to start.

You could set the raw.lxc config key to:

lxc.init_cmd = /system/init
lxc.loglevel = debug

That should provide more information in the log and also run the right command.

Thanks for your advice. I’ve set the init_cmd, the container start but stuck at some point. Is there some way to log the /dev/console output when container boot (execute init) or make it output to host /dev/console directly?

lxc.console.logfile=/some/path