During the upgrade of an unprivileged Incus container (with security.nesting = false) from Debian 11 to Debian 12, the systemd-logind.service encounters the following error:
Aug 14 17:12:41 ds-ca-it-lps-S01 systemd[1]: Starting systemd-logind.service - User Login Management...
Aug 14 17:12:41 lps-S01 (d-logind)[29155]: systemd-logind.service: Failed to set up mount namespacing: /run/systemd/unit-root/proc: Permission denied
Aug 14 17:12:41 lps-S01 (d-logind)[29155]: systemd-logind.service: Failed at step NAMESPACE spawning /lib/systemd/systemd-logind: Permission denied
Aug 14 17:12:41 lps-S01 systemd[1]: systemd-logind.service: Main process exited, code=exited, status=226/NAMESPACE
Additionally, on the host system, I observe the following error:
Based on my research, it appears that AppArmor is preventing the systemd-logind service within the Incus container from accessing the /proc directory on the host.
Interestingly, if I create a completely new Incus container with Debian 12, I do not encounter this error. This new container is also unprivileged, with nesting disabled.
Does anyone have insight into how I might resolve this problem without setting security.nesting to true?
After reboot, systemd-logind service failed, and starts to have permission denied errors.
I did this process on at least 10 different containers that were debian-11, all hosted on different bare metal servers and all of them have this issue.
@stgraber Is it safe to use this distrobuilder script in a privileged container?
I have a case where I need to use privileged container, because I need to use block device from the host, but I can’t mount it on the container, if the container isn’t privileged.
Yeah, we use security.privileged=true for our own image builders because that’s still needed to do all the block stuff.
It’s not great but so long as you’re just running trusted software, in this case distrobuilder and you feed it similarly trusted data like packages coming from a distro, it’s fine.