How to enable swap support in lxc? (actually, I see same issue in LXD)
I have this in lxc/config “lxc.cgroup2.memory.max = 2G”
and this in grub " cgroup_enable=memory swapaccount=1"
uname = Linux LXCHOST 5.10.0-8-amd64 #1 SMP Debian 5.10.46-1 (2021-06-24) x86_64 GNU/Linux
root@lxc:~# free
total used free shared buff/cache available
Mem: 2097152 127228 1652728 1584 317196 1969924
Swap: 0 0 0
Hi, would you like share, how to mount/use cgroup v1 for lxc on debian sid (/sys/fs/cgroup is v2)?
Is it possible, mount cgroup v1 some where (other than /sys/fs/cgroup) for lxc/lxd only?
Thanks.
No, it’s not. If your system is cgroup2, you only get cgroup2.
You can pass a boot time parameter to have systemd switch back to cgroup1 though which will then let you run containers which require cgroup1 but that will have your entire system switch back.