Alright so I’ve enabled cgroups (hybrid) but I’m still running into issues launching the container on a btrfs storage pool.
lxd --debug
INFO[11-16|20:17:57] LXD is starting version=4.20 mode=normal path=/var/lib/lxd
INFO[11-16|20:17:57] Kernel uid/gid map:
INFO[11-16|20:17:57] - u 0 0 4294967295
INFO[11-16|20:17:57] - g 0 0 4294967295
INFO[11-16|20:17:57] Configured LXD uid/gid map:
INFO[11-16|20:17:57] - u 0 100000 65536
INFO[11-16|20:17:57] - g 0 100000 65536
WARN[11-16|20:17:57] AppArmor support has been disabled because of lack of kernel support
INFO[11-16|20:17:57] Kernel features:
INFO[11-16|20:17:57] - closing multiple file descriptors efficiently: yes
INFO[11-16|20:17:57] - netnsid-based network retrieval: yes
INFO[11-16|20:17:57] - pidfds: yes
INFO[11-16|20:17:57] - core scheduling: yes
INFO[11-16|20:17:57] - uevent injection: yes
INFO[11-16|20:17:57] - seccomp listener: yes
INFO[11-16|20:17:57] - seccomp listener continue syscalls: yes
INFO[11-16|20:17:57] - seccomp listener add file descriptors: yes
INFO[11-16|20:17:57] - attach to namespaces via pidfds: yes
INFO[11-16|20:17:57] - safe native terminal allocation : yes
INFO[11-16|20:17:57] - unprivileged file capabilities: yes
INFO[11-16|20:17:57] - cgroup layout: hybrid
WARN[11-16|20:17:57] - AppArmor support has been disabled, Disabled because of lack of kernel support
WARN[11-16|20:17:57] - Couldn't find the CGroup blkio.weight, disk priority will be ignored
INFO[11-16|20:17:57] - shiftfs support: no
WARN[11-16|20:17:57] Instance type not operational err="QEMU command not available for architecture" type=virtual-machine driver=qemu
INFO[11-16|20:17:57] Initializing local database
DBUG[11-16|20:17:57] Refreshing local trusted certificate cache
INFO[11-16|20:17:57] Set client certificate to server certificate fingerprint=8f4f36d54cc081a1ba2c25feceecf89a92b219b224165e932a6673ebbf619d42
DBUG[11-16|20:17:57] Initializing database gateway
INFO[11-16|20:17:57] Starting database node id=1 address=1 role=voter
INFO[11-16|20:17:57] Starting /dev/lxd handler:
INFO[11-16|20:17:57] - binding devlxd socket socket=/var/lib/lxd/devlxd/sock
INFO[11-16|20:17:57] REST API daemon:
INFO[11-16|20:17:57] - binding Unix socket socket=/var/lib/lxd/unix.socket
INFO[11-16|20:17:57] Initializing global database
INFO[11-16|20:17:57] Connecting to global database
DBUG[11-16|20:17:57] Dqlite: attempt 1: server 1: connected
INFO[11-16|20:17:57] Connected to global database
INFO[11-16|20:17:57] Initialized global database
DBUG[11-16|20:17:57] Firewall detected "nftables" incompatibility: Backend command "nft" missing
DBUG[11-16|20:17:57] Firewall detected "xtables" incompatibility: Backend command "ebtables" is an nftables shim
WARN[11-16|20:17:57] Firewall failed to detect any compatible driver, falling back to "xtables" (but some features may not work as expected due to: Backend command "ebtables" is an nftables shim)
INFO[11-16|20:17:57] Firewall loaded driver driver=xtables
INFO[11-16|20:17:57] Initializing storage pools
DBUG[11-16|20:17:57] Initializing and checking storage pool pool=hostfs
DBUG[11-16|20:17:57] Mount started driver=btrfs pool=hostfs
DBUG[11-16|20:17:57] Mount finished driver=btrfs pool=hostfs
INFO[11-16|20:17:57] Initializing daemon storage mounts
INFO[11-16|20:17:57] Loading daemon configuration
INFO[11-16|20:17:57] Initializing networks
DBUG[11-16|20:17:57] New task Operation: 4572961e-f525-4eb9-ad51-85efc67b91a6
INFO[11-16|20:17:57] Pruning leftover image files
DBUG[11-16|20:17:57] Started task operation: 4572961e-f525-4eb9-ad51-85efc67b91a6
INFO[11-16|20:17:57] Done pruning leftover image files
INFO[11-16|20:17:57] Starting device monitor
WARN[11-16|20:17:57] Failed to initialize fanotify, falling back on fsnotify err="Failed to initialize fanotify: function not implemented"
DBUG[11-16|20:17:57] Success for task operation: 4572961e-f525-4eb9-ad51-85efc67b91a6
DBUG[11-16|20:17:57] Initialized filesystem monitor path=/dev
DBUG[11-16|20:17:57] Registering running instances
INFO[11-16|20:17:57] Started seccomp handler path=/var/lib/lxd/seccomp.socket
DBUG[11-16|20:17:57] Refreshing trusted certificate cache
DBUG[11-16|20:17:57] New task Operation: 41fd64e1-5d88-4a59-8697-4671103d54f4
INFO[11-16|20:17:57] Pruning expired images
DBUG[11-16|20:17:57] Started task operation: 41fd64e1-5d88-4a59-8697-4671103d54f4
INFO[11-16|20:17:57] Done pruning expired images
DBUG[11-16|20:17:57] New task Operation: c9771e46-8049-4014-9f77-b9acd065248a
INFO[11-16|20:17:57] Pruning expired instance backups
DBUG[11-16|20:17:57] Started task operation: c9771e46-8049-4014-9f77-b9acd065248a
DBUG[11-16|20:17:57] Success for task operation: 41fd64e1-5d88-4a59-8697-4671103d54f4
INFO[11-16|20:17:57] Done pruning expired instance backups
DBUG[11-16|20:17:57] Success for task operation: c9771e46-8049-4014-9f77-b9acd065248a
DBUG[11-16|20:17:57] New task Operation: 73ce3bdf-f4b2-49fb-b345-6e1196202b49
DBUG[11-16|20:17:57] New task Operation: 9998a265-51a1-4743-96a1-3df55bd32b5c
INFO[11-16|20:17:57] Updating images
DBUG[11-16|20:17:57] Started task operation: 73ce3bdf-f4b2-49fb-b345-6e1196202b49
DBUG[11-16|20:17:57] New task Operation: 2650ddc6-857d-4641-8a1a-ee4499922d14
INFO[11-16|20:17:57] Expiring log files
DBUG[11-16|20:17:57] Started task operation: 9998a265-51a1-4743-96a1-3df55bd32b5c
INFO[11-16|20:17:57] Daemon started
DBUG[11-16|20:17:57] New task Operation: fac7c1a6-87a4-4f73-809e-c39042d47459
INFO[11-16|20:17:57] Updating instance types
DBUG[11-16|20:17:57] Started task operation: fac7c1a6-87a4-4f73-809e-c39042d47459
INFO[11-16|20:17:57] Done updating images
INFO[11-16|20:17:57] Done expiring log files
DBUG[11-16|20:17:57] Success for task operation: 9998a265-51a1-4743-96a1-3df55bd32b5c
INFO[11-16|20:17:57] Done updating instance types
INFO[11-16|20:17:57] Pruning resolved warnings
DBUG[11-16|20:17:57] Started task operation: 2650ddc6-857d-4641-8a1a-ee4499922d14
DBUG[11-16|20:17:57] Processing image protocol=simplestreams alias=alpine/3.14 fingerprint=839527fec3fd32b314f00539e49e6e61ce12e2d186710ad82857a7bed13adf2d server=https://images.linuxcontainers.org
DBUG[11-16|20:17:57] Connecting to a remote simplestreams server URL=https://images.linuxcontainers.org
INFO[11-16|20:17:57] Done pruning resolved warnings
DBUG[11-16|20:17:57] Success for task operation: 2650ddc6-857d-4641-8a1a-ee4499922d14
DBUG[11-16|20:17:57] Acquiring lock for image download of "839527fec3fd32b314f00539e49e6e61ce12e2d186710ad82857a7bed13adf2d"
DBUG[11-16|20:17:57] Lock acquired for image download of "839527fec3fd32b314f00539e49e6e61ce12e2d186710ad82857a7bed13adf2d"
DBUG[11-16|20:17:57] Image already exists in the DB fingerprint=839527fec3fd32b314f00539e49e6e61ce12e2d186710ad82857a7bed13adf2d
DBUG[11-16|20:17:57] Image already exists on storage pool fingerprint=839527fec3fd32b314f00539e49e6e61ce12e2d186710ad82857a7bed13adf2d pool=hostfs
DBUG[11-16|20:17:57] Image already up to date fingerprint=839527fec3fd32b314f00539e49e6e61ce12e2d186710ad82857a7bed13adf2d
DBUG[11-16|20:17:57] Success for task operation: 73ce3bdf-f4b2-49fb-b345-6e1196202b49
DBUG[11-16|20:18:03] Success for task operation: fac7c1a6-87a4-4f73-809e-c39042d47459
lxc info --show-log alps
Name: alps
Status: STOPPED
Type: container
Architecture: x86_64
Created: 2021/11/16 20:01 AEDT
Last Used: 2021/11/16 20:16 AEDT
Log:
lxc alps 20211116091608.731 ERROR conf - conf.c:lxc_map_ids:3654 - newuidmap failed to write mapping "newuidmap: uid range [0-1000000000) -> [1000000-1001000000) not allowed": newuidmap 3735 0 1000000 1000000000
lxc alps 20211116091608.731 ERROR start - start.c:lxc_spawn:1785 - Failed to set up id mapping.
lxc alps 20211116091608.731 ERROR lxccontainer - lxccontainer.c:wait_on_daemonized_start:867 - Received container state "ABORTING" instead of "RUNNING"
lxc alps 20211116091608.731 ERROR start - start.c:__lxc_start:2068 - Failed to spawn container "alps"
lxc alps 20211116091608.731 WARN start - start.c:lxc_abort:1038 - No such process - Failed to send SIGKILL via pidfd 43 for process 3735
lxc 20211116091613.774 ERROR af_unix - af_unix.c:lxc_abstract_unix_recv_fds_iov:218 - Connection reset by peer - Failed to receive response
lxc 20211116091613.774 ERROR commands - commands.c:lxc_cmd_rsp_recv_fds:127 - Failed to receive file descriptors
lxc 20211116091757.676 TRACE commands - commands.c:lxc_cmd:509 - Connection refused - Command "get_state" failed to connect command socket
lxc 20211116091757.751 TRACE commands - commands.c:lxc_cmd:509 - Connection refused - Command "get_state" failed to connect command socket
lxc 20211116091820.921 TRACE commands - commands.c:lxc_cmd:509 - Connection refused - Command "get_state" failed to connect command socket
I created a dir backed storage pool and launched a container which seems to work.
lxc info --show-log dirtest
Name: dirtest
Status: RUNNING
Type: container
Architecture: x86_64
PID: 4293
Created: 2021/11/16 20:23 AEDT
Last Used: 2021/11/16 20:23 AEDT
Resources:
Processes: 4
CPU usage:
CPU usage (in seconds): 0
Memory usage:
Memory (current): 1.54MiB
Memory (peak): 4.68MiB
Network usage:
lo:
Type: loopback
State: UP
MTU: 65536
Bytes received: 0B
Bytes sent: 0B
Packets received: 0
Packets sent: 0
IP addresses:
inet: 127.0.0.1/8 (local)
inet6: ::1/128 (local)
Log:
lxc dirtest 20211116092349.371 WARN cgfsng - cgroups/cgfsng.c:fchowmodat:1251 - No such file or directory - Failed to fchownat(42, memory.oom.group, 65536, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )