dockerfiles icon indicating copy to clipboard operation
dockerfiles copied to clipboard

Failed to connect to bus: No such file or directory on Kali 6.16.8-1kali1 (2025-09-24) x86_64 GNU/Linux

Open aspi1234 opened this issue 2 months ago • 3 comments

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 via docker 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:12

Result: 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:10

Result: 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

aspi1234 avatar Oct 25 '25 09:10 aspi1234

Hi @aspi1234, I just tried on Debian 14 without issues with podman. That's a container engine you could also try, it has the same commands as docker.

j8r avatar Oct 25 '25 20:10 j8r

Hello.

Thanks for looking into the problem. Used podman and it worked seamlessly both on kali and windows.

For learning purposes why did it work on podman and not on docker ??

Thanks once again

aspi1234 avatar Oct 27 '25 05:10 aspi1234

I'm not sure, may be because the docker runtime needs more provileges for its deamon, which runs as root.

j8r avatar Oct 29 '25 15:10 j8r