Table of Contents

Unified CGroups

Problem introduced with change from systemd 241 to 247. Main change is to drop CGroup V1 support and switch by default to unified CGroup V2.

$ systemctl --version
systemd 247 (247.3-1~bpo10+1)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified

Lots of issues are reported, and lots of containerization software needs to be upgraded:

Resources:

Workaround

Switch systemd to hybrid hierarchy

Add kernel boot commandline argument: systemd.unified_cgroup_hierarchy=0

echo 'GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT systemd.unified_cgroup_hierarchy=false"' > /etc/default/grub.d/cgroup.cfg

More info:

Delegate a cgroup in advance

From: https://linuxcontainers.org/lxc/getting-started/

Running unprivileged containers as an unprivileged user only works if you delegate a cgroup in advance (the cgroup2 delegation model enforces this restriction, not liblxc). Use the following systemd command to delegate the cgroup:

systemd-run --unit=myshell --user --scope -p "Delegate=yes" lxc-start <container-name>