LXC problem on Yocto

Hello,

I’m facing with the problem bellow on Yocto Linux with Rocko version of Poky. I created a rootfs on desktop machine and transfered it on my platform.

Kernel version 4.19

$ lxc-start -n mediatek -F
lxc-start: sync.c: __sync_wait: 57 An error occurred in another process (expected sequence number 5) lxc-start: start.c: __lxc_start: 1354 Failed to spawn container “mediatek”. lxc-start: cgfsng.c: recursive_destroy: 1288 Error destroying /sys/fs/cgroup/systemd//lxc/mediatek lxc-start: cgfsng.c: recursive_destroy: 1288 Error destroying /sys/fs/cgroup/blkio//lxc/mediatek lxc-start: cgfsng.c: recursive_destroy: 1288 Error destroying /sys/fs/cgroup/cpu//lxc/mediatek lxc-start: cgfsng.c: recursive_destroy: 1288 Error destroying /sys/fs/cgroup/pids//lxc/mediatek lxc-start: cgfsng.c: recursive_destroy: 1288 Error destroying /sys/fs/cgroup/hugetlb//lxc/mediatek lxc-start: cgfsng.c: recursive_destroy: 1288 Error destroying /sys/fs/cgroup/freezer//lxc/mediatek lxc-start: cgfsng.c: recursive_destroy: 1288 Error destroying /sys/fs/cgroup/rdma//lxc/mediatek lxc-start: cgfsng.c: recursive_destroy: 1288 Error destroying /sys/fs/cgroup/debug//lxc/mediatek lxc-start: cgfsng.c: recursive_destroy: 1288 Error destroying /sys/fs/cgroup/perf_event//lxc/mediatek lxc-start: cgfsng.c: recursive_destroy: 1288 Error destroying /sys/fs/cgroup/memory//lxc/mediatek lxc-start: cgfsng.c: recursive_destroy: 1288 Error destroying /sys/fs/cgroup/devices//lxc/mediatek lxc-start: lxc_start.c: main: 366 The container failed to start. lxc-start: lxc_start.c: main: 370 Additional information can be obtained by setting the --logfile and --logpriority options.

I enabled everything LXC needs in kernel(from lxc-checkconfig list)

$ lxc-checkconfig
— Namespaces —
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled — Control groups —
Cgroup: enabled
Cgroup clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled — Misc —
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
Bridges: enabled
Advanced netfilter: enabled
CONFIG_NF_NAT_IPV4: enabled CONFIG_NF_NAT_IPV6: enabled CONFIG_IP_NF_TARGET_MASQUERADE: enabled CONFIG_IP6_NF_TARGET_MASQUERADE: enabled CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled
FUSE (for use with lxcfs): enabled — Checkpoint/Restore —
checkpoint restore: enabled
CONFIG_FHANDLE: enabled
CONFIG_EVENTFD: enabled
CONFIG_EPOLL: enabled
CONFIG_UNIX_DIAG: enabled
CONFIG_INET_DIAG: enabled
CONFIG_PACKET_DIAG: enabled CONFIG_NETLINK_DIAG: enabled
File capabilities: enabled

From Yocto recipes :
lxc: meta-virtualization 2.0.8

$ ps auxf | grep apparmor
4173 root 0:00 grep apparmor

I hope we find solution to this problem.

You could try this.
Maybe it gives some more information.

Otherwise give us some more info about the rootfs.
How did you create it and what is it based on?

Created container just with lxc-create -t download -n mediatek on desktop machine with this options:
Distribution : ubuntu
Release : trusty
Architecture : arm64

And i changed config file : https://pastebin.com/2EkELABz

lxc-start -n mediatek --logfile log.txt --logpriority=DEBUG
log.txt - https://pastebin.com/hpK6cK6g

Update :
Fixed error :slight_smile:

Well, could you provide your solution, in case it might help others?

Sure, It’s generarly problem with Ubuntu in LXC. Ubuntu 14.04 is broken, Ubuntu 18.04 have a problem with network configuration. Fedora for example works nice.