-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read-only file system (--init=systemd) [cgroupv2 not supported yet] #349
Comments
x11docker runs with an unprivileged user by default. If you want to run with user root (the default in |
This is a new issue I recently detected, too. For your setup, try without |
@eine I forgot to mention that my user is part the |
@mviereck Without |
I found a workaround to get back the old behaviour. You can set a kernel boot option in GRUB to enforce cgroupv1 for systemd:
|
Thanks
in |
Just want to add that |
Curiously the issue does not appear in Debian bullseye even without setting the kernel options in grub. Maybe some smart fix on side of systemd? Edit: |
The issue is still present on a minimal untweaked Arch Linux install with podman and crun (cgroupv2 only). But it can be easily fixed without modifying the grub cmdline.
Blog post about --systemd=always and podman cgroupv2 |
Thank you! Quite interesting that The blog post is helpful, but unfortunately does not describe exactly what podman does, vaguely speaking of some cgroup setup:
man
Maybe I find out more about this setup done by podman, so I can reproduce it for I have set boot option Edit:
It might help if I could tell systemd in container to use cgroupv2 only. But I found no direct systemd option for this except kernel options in https://www.man7.org/linux/man-pages/man1/init.1.html. |
The recommended way for running systemd in docker seems to be [1][2]: Since I generally do not like to use Based on podman container_internal_linux.go.
Initially, I tried using |
Great, much thanks for your investigation! Nice: even slim images like alpine provide
Instead of
|
I have just reread the nsenter man page and it might be good to also join the cgroup namespace (-C) in addition to the mount and PID namespace. Additionally, instead of joining the host PID NS it is also possible to join the other containers PID NS and therefore no longer needs to use docker inspect.
EDIT:
after a The same does not work with a docker container where the daemon is running with --userns-remap. |
Good catch! I've almost literally integrated your command in x11docker, works like a charm now. I still have to add
Currently I miss a way to detect if a system is set up with cgroupv1 only although the kernel supports cgroupv2. Curious: |
Yes in my tests I did not need cap_sys_ptrace. I tested with nsenter from ubuntu 20.04 (2.34) & nsenter from fedora:35 (2.37.2).
|
…box. Another fix for cgroup version check. #349
Maybe the host system makes a difference here? I run Debian bullseye.
Good to know. I've removed it from the command.
Hopefully this is fixed now. I found a hint close to bottom of https://www.man7.org/linux/man-pages/man7/cgroups.7.html :
x11docker now checks if
This answer indicates that it might help to change the ownership of the cgroup folder to the root user uid of container: https://serverfault.com/a/1054414 However, x11docker disables userns to allow sharing files with the host. For docker it sets |
Side note: |
Strange I did all my docker test inside a Debian bullseye VM managed by lxc/lxd (qemu based it is not a lxc container). But I could imagine that there is a sysctl that forces extra checks on your system. Just a hypothesis not really sure.
It seems like to intended way is to use statfs compare the type that against some magic numbers. [1]
|
Thanks for the investigation! Confusing: If I set kernel option I don't know an option to get a real hybrid setup. So x11docker would need two checks:
Currently x11docker is configured to use the nsenter setup only on a pure cgroupv2 system. For cgroupv1 and hybrid it falls back to the old behaviour sharing host cgroups. |
Today I could run a test on Debian buster with a hybrid cgroup. It runs well with the old setup sharing cgroup from host. Much thanks again @lukts30 , this would not have been possible without your help! |
For info and context I'm here providing a comment. Spank you very much! This helped me solve an issue I've had for pretty much ages. Namely running a Concourse CI worker on a QNAP NAS. Where Docker is in Using Only bummer in my case is that I need to use the |
Great that this helped you! However, just want to note that this setup exposes your host to the container and is quite insecure. Don't use it if there is any reason to distrust the container because basically no isolation is left. |
Thank you @mviereck - that sucks yes. I'm doing what I can to protect the workload in other ways. E.g. it's definitely not going to be publicly exposed. Thanks |
I am not sure why your unprivileged setup fails. If you like to, you could try to run your worker with x11docker and its option |
Hi,
I was trying to run Steam like so:
where
steam
is a Docker image built using the following Dockerfile:However, x11docker terminated with the following error
Could you give me some tips on troubleshooting this issue? The full
x11docker.log
can be found here.Cheers,
The text was updated successfully, but these errors were encountered: