-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Subject: Failure to Start on cgroup v2 Host: "Failed to create /init.scope"
Hi there jrei,
First, thank you for maintaining this very useful systemd-debian image. I'm using it to reproduce a lab environment and have run into some startup issues on my host machine. I've tried to gather as much diagnostic information as possible.
My Environment
- Host OS: Kali Linux (Debian-based)
6.16.8-1kali1 - Docker Version:
26.1.5+dfsg1 - Cgroup Version:
v2(Confirmed viadocker info) - Image Tags Tested:
jrei/systemd-debian:12(Bookworm),jrei/systemd-debian:11(Bullseye),jrei/systemd-debian:10(Buster)
Issue 1: Newer Images (Bullseye/Bookworm) Fail to Start
When I try to run the newer images using the documented docker run command, the container exits immediately.
Command Used:
docker run -d --name systemd-lab --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro jrei/systemd-debian:12Result: The container exits. When I run it interactively (-it), I get the following error log from systemd before it exits:
systemd 252.39-1~deb12u1 running in system mode (+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)
Detected virtualization docker.
Detected architecture x88-64.
Welcome to Debian GNU/Linux 12 (bookworm)!
Failed to create /init.scope control group: Read-only file system
Failed to allocate manager object: Read-only file system
[!!!!!!] Failed to allocate manager object.
Exiting PID 1...
Note: I receive a similar error with the :11 tag.
Based on troubleshooting, I've also tried adding the --cgroupns=private flag and removing the :ro from the cgroup volume mount, but the result is the same failure to create the init.scope.
Issue 2: Older Image (Buster) Starts but systemctl is Unresponsive
As a workaround, I tried the older :10 (Buster) tag.
Command Used:
docker run -d --name systemd-lab --privileged --cgroupns=private -v /sys/fs/cgroup:/sys/fs/cgroup:ro jrei/systemd-debian:10Result: This is more successful—the container starts and remains running. However, when I get a shell inside the container, any systemctl command fails with the following D-Bus error:
Failed to connect to bus: No such file or directory
This suggests that while systemd is PID 1, it failed to initialize its communication bus. Adding --tmpfs /run to the docker run command does not resolve this specific issue.
My Question
Any guidance you could offer would be greatly appreciated. Thank you