This message was deleted.
# puppet
s
This message was deleted.
y
I bet it’s cgroups hierarchy incompatibilities.. ubuntu image runs fine, right?
j
Good question , let me check (but the cgroups compat sounds like a good lead)
c
Likely needs
--cgroupns=host -v /sys/fs/cgroup:/sys/fs/cgroup:rw
added to the Docker run args.
y
I’m not 100% sure about cgroups because I hit some issue when running old enough containers on top of new enough OS.. but I’m not sure it’s the same issue
I saw a few similar reports but about beaker
j
Copy code
docker run --privileged --cgroupns=host  --cap-add=SYS_ADMIN -v /sys/fs/cgroup:/sys/fs/cgroup -it --entrypoint /bin/sh litmusimage/centos:7                                                    
sh-4.2# systemctl 
Failed to get D-Bus connection: Operation not permitted
Damned
(About old docker on newer os, could be the cgroups 1<>2 )
c
Ah, yup. I think Yury is right: this is a problem when the SystemD version of the host OS is "too new" and the version of the guest in the container is "too old". Might not be a way to bridge that incompatibility other than using an older host OS.
y
ah.. my issue was a bit different though: https://github.com/containerd/nerdctl/discussions/1659
I was unable to run a systemd image with rootless docker & containerd
j
Ok, let me launch an old VM
y
but I was able to do so with rootless podman
j
Ok, so podman could be a solution ?>
y
worth to try I’d say
j
indeed
c
Aye. Podman tends to have better support for SystemD.
j
I will perform two tests and keep you posted alrgight ?
y
yes please 🙂
j
Copy code
[root@localhost ~]# cat /etc/redhat-release 
CentOS Linux release 7.8.2003 (Core)
[root@localhost ~]# docker run --privileged --cgroupns=host  --cap-add=SYS_ADMIN -v /sys/fs/cgroup:/sys/fs/cgroup:rw -it --entrypoint /bin/sh litmusimage/centos:7
sh-4.2# systemctl 
Failed to get D-Bus connection: Operation not permitted
A ! my bad, i overloaded the entrypoint hold on
Ok, got it .
docker run  -v /sys/fs/cgroup:/sys/fs/cgroup:rw  litmusimage/centos:7
< this seems to be the minimal viable docker run
y
ah, so it was :rw, right?
j
A ! let me check without the rw
docker run  -v /sys/fs/cgroup:/sys/fs/cgroup:ro  litmusimage/centos:7
This seems to be working too
y
hmm.. so what is the difference with the usual litmus call then? 🤔
j
this is on a redhat machine, this does not seems to work on a ubuntu .
y
ah, I see
c
Ubuntu 22.04 is new enough that it uses the CGroups v2 layout which is witchcraft from the future to CentOS 7.
☝🏻 1
j
Yep, i definitly do have some black magic cgroups v2 happening on my system
c
Docker containers are nice and fast to create/destroy compared to full VMs, but that is enabled by sharing certain aspects of the host operating system with the guests. One of those is the CGroup layout, which SystemD needs to interact with. So, at a point there is likely to be too much divergence between how SystemD and CGroups worked in 2014 and how they work now, nearly 10 years later. Trying to put CentOS 7 with its SystemD on top of Ubuntu 22.04 may have passed that point.
y
I’d recommend to try with podman anyway
j
you know what, lets try to podman.
y
hmm.. I guess in my case podman was good because it was running on top of Fedora 🤔
j
Funny enought : podman seems to need much more rights.
y
--privileged
and
--cap-add SYS_ADMIN
should be enough for everything I guess 🙂
j
podman run  --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro  litmusimage/centos:7
well, the priviledged flag is A LOT !
y
try with just --cap-add SYS_ADMIN w/o --privileged
does it work for you on ubuntu now?
j
Nope, still not working on a ubuntu, even with privileged
y
last chance is to switch ubuntu cgroups hierarchy to old version.. there was a kernel cmdline flag for this IIRC
unfortunately I cannot check it as I’m on MacOS aarch64.. so no luck with CentOS 7 at all I guess..
litmus has no arm64 containers AFAIK
j
no, but you can vagrant your way out.
(This is how i added my centos7 vm)
Well, it works like a charm with litmusimage/centos:stream9 on my ubuntu
👍🏻 1
y
yeah, it should be ok starting from RHEL 8 I believe.. so alma/rocky/oraclelinux/centos stream 8 should be good
j
Funny enought : rhel8 still uses v1 by default, BUT can be tweaked to use V2
But another funny joke : rhel8 seems to have v2 activated by default now.
Upgrade here : rhel8 do have v2 activated , but does not boot using it. You can however use it.
👍🏻 1
Uhm, another question concerning litmus again. Got my tests up and running, but it seems it cannot resolve dependencies. I guess i missed something, but i cannot see what, (.fixtures.yml and metadata.json are both changed to probably correct values, but not 100% sure. )