lxc / incus

Powerful system container and virtual machine manager
https://linuxcontainers.org/incus
Apache License 2.0
2.51k stars 206 forks source link

Memory limits ignored for instances, even after setting security.syscalls.intercept.sysinfo=true #1069

Closed alex14641 closed 1 month ago

alex14641 commented 1 month ago

Required information

Issue description

Memory limits not being displayed. incus launch images:ubuntu/22.04 limited --config limits.cpu=1 --config limits.memory=192MiB incus exec limited -- free -m incus-env incus exec limited -- free -h total used free shared buff/cache available Mem: 31Gi 3.1Gi 20Gi 26Mi 8.0Gi 27Gi Swap: 33Gi 0B 33Gi incus config set limited security.syscalls.intercept.sysinfo=true incus-env incus exec limited -- free -h total used free shared buff/cache available Mem: 31Gi 3.1Gi 20Gi 26Mi 8.0Gi 27Gi Swap: 33Gi 0B 33Gi

I have stopped and restarted the instance; same result.

stgraber commented 1 month ago

Please provide the full incus info output and also detail how Incus was installed and on what Linux distribution.

alex14641 commented 1 month ago

incus info: incus-info.txt

Incus was installed from source following the instructions in the "From source: Install" section of the "Install Incus" chapter.

Linux distro is Slackware current. I have modified the distro to use cgroups v2. [~]$ grep cgroup /proc/mounts cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0

stgraber commented 1 month ago

Did you also install and run LXCFS?

alex14641 commented 1 month ago

Running LXCFS fixed the issue. Thank you for your help. Note that security.syscalls.intercept.sysinfo doesn't seem to be needed.