Unable to start Lxc container on Android

Hi,

Lxc container on Android is not starting.
Please help. Below is the debug log.

lxc-start myContainerImage 20210317093031.625 INFO lsm - external/lxc/src/lxc/lsm/lsm.c:lsm_init:50 - LSM security driver nop
lxc-start myContainerImage 20210317093031.626 DEBUG terminal - external/lxc/src/lxc/terminal.c:lxc_terminal_peer_default:714 - Using terminal “/dev/tty” as proxy
lxc-start myContainerImage 20210317093031.626 DEBUG terminal - external/lxc/src/lxc/terminal.c:lxc_terminal_signal_init:192 - Created signal fd 9
lxc-start myContainerImage 20210317093031.626 DEBUG terminal - external/lxc/src/lxc/terminal.c:lxc_terminal_winsz:90 - Set window size to 211 columns and 53 rows
lxc-start myContainerImage 20210317093031.627 WARN cgfsng - external/lxc/src/lxc/cgroups/cgfsng.c:cg_hybrid_get_controllers:746 - Found hierarchy not under /sys/fs/cgroup: "/dev/cg2_bpf rw,nosuid,nodev,noexec,relatime shared:8 - cgroup2 none rw
"
lxc-start myContainerImage 20210317093031.627 WARN cgfsng - external/lxc/src/lxc/cgroups/cgfsng.c:cg_hybrid_get_controllers:746 - Found hierarchy not under /sys/fs/cgroup: "/dev/cpuctl rw,nosuid,nodev,noexec,relatime shared:10 - cgroup none rw,cpu
"
lxc-start myContainerImage 20210317093031.627 WARN cgfsng - external/lxc/src/lxc/cgroups/cgfsng.c:cg_hybrid_get_controllers:746 - Found hierarchy not under /sys/fs/cgroup: "/acct rw,nosuid,nodev,noexec,relatime shared:11 - cgroup none rw,cpuacct
"
lxc-start myContainerImage 20210317093031.627 WARN cgfsng - external/lxc/src/lxc/cgroups/cgfsng.c:cg_hybrid_get_controllers:746 - Found hierarchy not under /sys/fs/cgroup: "/dev/cpuset rw,nosuid,nodev,noexec,relatime shared:12 - cgroup none rw,cpuset,noprefix,release_agent=/sbin/cpuset_release_agent
"
lxc-start myContainerImage 20210317093031.627 WARN cgfsng - external/lxc/src/lxc/cgroups/cgfsng.c:cg_hybrid_get_controllers:746 - Found hierarchy not under /sys/fs/cgroup: "/dev/memcg rw,nosuid,nodev,noexec,relatime shared:13 - cgroup none rw,memory
"
lxc-start myContainerImage 20210317093031.627 WARN cgfsng - external/lxc/src/lxc/cgroups/cgfsng.c:cg_hybrid_get_controllers:746 - Found hierarchy not under /sys/fs/cgroup: "/dev/stune rw,nosuid,nodev,noexec,relatime shared:14 - cgroup none rw,schedtune
"
lxc-start myContainerImage 20210317093031.627 INFO start - external/lxc/src/lxc/start.c:lxc_init:897 - Container “myContainerImage” is initialized
lxc-start myContainerImage 20210317093031.629 INFO start - external/lxc/src/lxc/start.c:lxc_spawn:1692 - Cloned CLONE_NEWNS
lxc-start myContainerImage 20210317093031.629 INFO start - external/lxc/src/lxc/start.c:lxc_spawn:1692 - Cloned CLONE_NEWPID
lxc-start myContainerImage 20210317093031.629 INFO start - external/lxc/src/lxc/start.c:lxc_spawn:1692 - Cloned CLONE_NEWUTS
lxc-start myContainerImage 20210317093031.629 INFO start - external/lxc/src/lxc/start.c:lxc_spawn:1692 - Cloned CLONE_NEWIPC
lxc-start myContainerImage 20210317093031.629 DEBUG start - external/lxc/src/lxc/start.c:lxc_try_preserve_namespaces:196 - Preserved mnt namespace via fd 15
lxc-start myContainerImage 20210317093031.629 DEBUG start - external/lxc/src/lxc/start.c:lxc_try_preserve_namespaces:196 - Preserved pid namespace via fd 16
lxc-start myContainerImage 20210317093031.629 DEBUG start - external/lxc/src/lxc/start.c:do_start:1100 - do_start
lxc-start myContainerImage 20210317093031.629 DEBUG start - external/lxc/src/lxc/start.c:lxc_try_preserve_namespaces:196 - Preserved uts namespace via fd 17
lxc-start myContainerImage 20210317093031.629 DEBUG start - external/lxc/src/lxc/start.c:lxc_try_preserve_namespaces:196 - Preserved ipc namespace via fd 18
lxc-start myContainerImage 20210317093031.629 DEBUG start - external/lxc/src/lxc/start.c:lxc_spawn:1746 - Preserved net namespace via fd 10
lxc-start myContainerImage 20210317093031.629 INFO start - external/lxc/src/lxc/start.c:do_start:1243 - Unshared CLONE_NEWCGROUP
lxc-start myContainerImage 20210317093031.630 DEBUG storage - external/lxc/src/lxc/storage/storage.c:get_storage_by_name:231 - Detected rootfs type “dir”
lxc-start myContainerImage 20210317093031.630 DEBUG conf - external/lxc/src/lxc/conf.c:lxc_mount_rootfs:1332 - Mounted rootfs “/data/lxc/containers/myContainerImage/rootfs” onto “/data/lxc/rootfs” with options “(null)”
lxc-start myContainerImage 20210317093031.630 INFO conf - external/lxc/src/lxc/conf.c:setup_utsname:791 - Set hostname to “myContainerImage”
lxc-start myContainerImage 20210317093031.630 INFO conf - external/lxc/src/lxc/conf.c:mount_autodev:1118 - Preparing “/dev”
lxc-start myContainerImage 20210317093031.632 INFO conf - external/lxc/src/lxc/conf.c:mount_autodev:1165 - Prepared “/dev”
lxc-start myContainerImage 20210317093031.632 INFO conf - external/lxc/src/lxc/conf.c:lxc_fill_autodev:1209 - Populating “/dev”
lxc-start myContainerImage 20210317093031.632 DEBUG conf - external/lxc/src/lxc/conf.c:lxc_fill_autodev:1224 - Created device node “/data/lxc/rootfs/dev/full”
lxc-start myContainerImage 20210317093031.632 DEBUG conf - external/lxc/src/lxc/conf.c:lxc_fill_autodev:1224 - Created device node “/data/lxc/rootfs/dev/null”
lxc-start myContainerImage 20210317093031.632 DEBUG conf - external/lxc/src/lxc/conf.c:lxc_fill_autodev:1224 - Created device node “/data/lxc/rootfs/dev/random”
lxc-start myContainerImage 20210317093031.632 DEBUG conf - external/lxc/src/lxc/conf.c:lxc_fill_autodev:1224 - Created device node “/data/lxc/rootfs/dev/tty”
lxc-start myContainerImage 20210317093031.632 DEBUG conf - external/lxc/src/lxc/conf.c:lxc_fill_autodev:1224 - Created device node “/data/lxc/rootfs/dev/urandom”
lxc-start myContainerImage 20210317093031.632 DEBUG conf - external/lxc/src/lxc/conf.c:lxc_fill_autodev:1224 - Created device node “/data/lxc/rootfs/dev/zero”
lxc-start myContainerImage 20210317093031.632 INFO conf - external/lxc/src/lxc/conf.c:lxc_fill_autodev:1286 - Populated “/dev”
lxc-start myContainerImage 20210317093031.632 DEBUG conf - external/lxc/src/lxc/conf.c:mount_entry:2027 - Remounting “/system” on “/data/lxc/rootfs/system/” to respect bind or remount options
lxc-start myContainerImage 20210317093031.632 DEBUG conf - external/lxc/src/lxc/conf.c:mount_entry:2048 - Flags for “/system” were 4101, required extra flags are 5
lxc-start myContainerImage 20210317093031.632 DEBUG conf - external/lxc/src/lxc/conf.c:mount_entry:2102 - Mounted “/system” on “/data/lxc/rootfs/system/” with filesystem type “none”
lxc-start myContainerImage 20210317093031.632 DEBUG conf - external/lxc/src/lxc/conf.c:mount_entry:2027 - Remounting “/vendor” on “/data/lxc/rootfs/vendor/” to respect bind or remount options
lxc-start myContainerImage 20210317093031.632 DEBUG conf - external/lxc/src/lxc/conf.c:mount_entry:2048 - Flags for “/vendor” were 4097, required extra flags are 1
lxc-start myContainerImage 20210317093031.632 DEBUG conf - external/lxc/src/lxc/conf.c:mount_entry:2102 - Mounted “/vendor” on “/data/lxc/rootfs/vendor/” with filesystem type “none”
lxc-start myContainerImage 20210317093031.632 INFO conf - external/lxc/src/lxc/conf.c:mount_file_entries:2333 - Finished setting up mounts
lxc-start myContainerImage 20210317093031.632 DEBUG conf - external/lxc/src/lxc/conf.c:lxc_setup_dev_console:1771 - Mounted pts device “/dev/pts/1” onto “/data/lxc/rootfs/dev/console”
lxc-start myContainerImage 20210317093031.633 INFO utils - external/lxc/src/lxc/utils.c:lxc_mount_proc_if_needed:1253 - Mounted /proc in container for security transition
lxc-start myContainerImage 20210317093031.650 DEBUG conf - external/lxc/src/lxc/conf.c:lxc_setup_devpts:1605 - No new devpts instance will be mounted since no pts devices are requested
lxc-start myContainerImage 20210317093031.650 INFO conf - external/lxc/src/lxc/conf.c:lxc_setup_ttys:949 - Finished setting up 0 /dev/tty device(s)
lxc-start myContainerImage 20210317093031.650 DEBUG conf - external/lxc/src/lxc/conf.c:setup_caps:2506 - Capabilities have been setup
lxc-start myContainerImage 20210317093031.650 NOTICE conf - external/lxc/src/lxc/conf.c:lxc_setup:3692 - The container “myContainerImage” is set up
lxc-start myContainerImage 20210317093031.666 DEBUG start - external/lxc/src/lxc/start.c:lxc_spawn:1821 - Preserved cgroup namespace via fd 19
lxc-start myContainerImage 20210317093031.666 NOTICE utils - external/lxc/src/lxc/utils.c:lxc_setgroups:1400 - Dropped additional groups
lxc-start myContainerImage 20210317093031.666 DEBUG start - external/lxc/src/lxc/start.c:do_start:1423 - Calling Start
lxc-start myContainerImage 20210317093031.666 NOTICE start - external/lxc/src/lxc/start.c:start:2028 - Exec’ing “/sbin/init”

This doesn’t actually show any error suggesting that the issue may instead be the init process immediately crashing or something similar?

If LXC itself had failed, you’d see ERROR messages in there and you wouldn’t see that last line showing that LXC is handing things over to /sbin/init in the container.

Yes, but the container is not getting started. And i don’t see any error also.

Once sbin/init starts we expect the below log.
" Started “/sbin/init” with pid ".

Could you suggest a way to debug this issue?

You’d probably want to start with lxc-start in the foreground and maximum logging (trace) setup to go into a separate file. That way you may get to see what the init process tells you.