Unable to enter systemd containers
- Dominant language
- Go
- Stars
- 13k
- Forks
- 541
- Avg merge
- 20h 47m
- Merged PRs (30d)
- 4
Description
**Describe the bug**
I am attempting to create a container with an init system (systemd because the image is a Fedora image) and distrobox is refusing to start because it seems to believe that I am using cgroups v1, but I have made sure to use cgroups v2 and podman also reports that /sys/fs/cgroups is cgroup2.
It's worth noting I also tried the same with Ubuntu and had the same result.
**To Reproduce**
distrobox create --init --additional-packages "systemd" -n fedora
distrobox enter fedora
**Expected behavior**
The Fedora container gets created and starts up after correctly detecting that I am using cgroups v2.
**Logs**
[distrobox_fedora.log](https://github.com/user-attachments/files/24996573/distrobox_fedora.log)
[podman_fedora.log](https://github.com/user-attachments/files/24996591/podman_fedora.log)
**Host System Information**
Container manager: Podman 4.7.2
Distrobox version: 1.8.2.3
Host distribution: Slackware-current
Installation method: SlackBuild script from https://github.com/Ponce/slackbuilds/blob/current/system/distrobox/distrobox.SlackBuild
**Additional context**
I am very certain that I am using cgroups v2.
```
tzenfore@tzenfore-desktop:~$ grep group2 /etc/mtab
none /sys/fs/cgroup cgroup2 rw,relatime 0 0
```
```
tzenfore@tzenfore-desktop:~$ podman info | grep cgroup
cgroupControllers: []
cgroupManager: cgroupfs
cgroupVersion: v2
```
```
tzenfore@tzenfore-desktop:~$ cat /etc/default/cgroups
# Which version of cgroups should we mount, version 1 or version 2?
# Please note that the rc.cgred init script (as well as the cgrulesengd
# utility itself) will not function with cgroups version 2. Upstream
# did not implement support for this since systemd handles it (of course).
CGROUPS_VERSION=2
```
Contributor guide
Assessment
This issue has not been assessed yet.