<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I can run a full Arch system (with systemd as PID 1) in a Docker container in Docker privileged mode:<br class=""><div class="postmsg"><div class="codebox"><pre class=""><code class=""> sudo docker run -i -t --privileged archlinux /usr/lib/systemd/systemd</code></pre></div><p class="">but privileged mode is, well, a bit privileged. I believe used to be able to tone this down with something like:</p><div class="codebox"><pre class=""><code class=""> sudo docker run -i -t --cap-add=ALL -v /sys/fs/cgroup:/sys/fs/cgroup:ro archlinux /usr/lib/systemd/systemd</code></pre></div><p class="">or even less capabilities than "all". But now I'm getting:</p><div class="codebox"><pre class=""><code class=""> systemd 248.3-2-arch 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 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +XKBCOMMON +UTMP -SYSVINIT default-hierarchy=unified)
Detected virtualization docker.
Detected architecture x86-64.
Detected first boot.
Welcome to Arch Linux!
Initializing machine ID from random generator.
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...</code></pre></div><p class="">I don't understand what that
means. (Somebody likes exclamation marks.) What's the "manager object",
and who is trying to allocate it?</p><p class="">Assuming that the "Read-only
filesystem" in question is that /sys/fs/cgroup, when binding it into the
container as read-write I get that instead:</p><div class="codebox"><pre class=""><code class=""> Failed to create /init.scope control group: No such file or directory
Failed to allocate manager object: No such file or directory</code></pre></div><p class=""><a href="https://serverfault.com/questions/1053187/systemd-fails-to-run-in-a-docker-container-when-using-cgroupv2-cgroupns-priva" rel="nofollow" class="">This long Serverfault thread</a> may be related? Are they saying it's broken? Can it be done?</p><div class="">Posted this <a href="https://bbs.archlinux.org/viewforum.php?id=23" class="">earlier</a> in the Arch forum, lots of views, no answers.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Johannes.</div></div></body></html>