-
Notifications
You must be signed in to change notification settings - Fork 2.4k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Unable to access /dev/tty0 in a rootless container #18845
Comments
I've also tried removing For reference:
|
If this is a regression please specify the last working version (and possibly even git bisect if you are able to do that). |
Does sway work with rootful Podman? @giuseppe PTAL |
the same commands you've provided work well for me on Fedora 38. Could it be something else blocking the access? AppArmor? |
Thanks for the assistance guys
@Luap99 I'm not sure if this ever worked in a rootless container. I noted it as a regression since Docker can access
@rhatdan Yes, if I run Podman with
@giuseppe Are you actually able to start Sway? I can give Fedora a shot, did you use Fedora Server or Fedora Workstation?
With OpenSuSE MicroOS and OpenSuSE Tumbleweed I've explicitly disabled SELinux and Apparmor during the installation: # SELinux
$ sudo sestatus
bash: sestatus: command not found
$ sudo getenforce
bash: getenforce: command not found
# Apparmor
$ sudo less /sys/kernel/security/apparmor/profiles
/sys/kernel/security/apparmor/profiles: No such file or directory
$ sudo apparmor_status
apparmor module is loaded.
apparmor filesystem is not mounted.
$ sudo systemctl status apparmor
○ apparmor.service - Load AppArmor profiles
Loaded: loaded (/usr/lib/systemd/system/apparmor.service; enabled; preset: enabled)
Active: inactive (dead)
Condition: start condition failed at Mon 2023-06-12 12:02:22 CEST; 8min ago |
Then it is not a regression for us, a regression means it worked in a previous version and then stopped working. Also docker runs as root by default unless you explicitly setup rootless docker. |
yes, it starts. I am using Fedora Workstation 38 |
Great find @giuseppe! Fedora Workstation 38This uses GNOME 44 out of the box. However, if I instead use tty2 I get: [wlr] [backend/wayland/backend.c:555] Could not connect to remote display: Connection refused
[sway/server.c:73] Unable to create backend For clarity: $ ls -ld /dev/tty0
crw--w----. 1 root tty 4, 0 Jun 12 14:55 /dev/tty0 Fedora Server 38This gives the same error as OpenSuSE Tumbleweed and OpenSuSE MicroOS: $ ls -ld /dev/tty0
crw--w----. 1 root tty 4, 0 Jun 12 13:51 /dev/tty0 In this case, how can a rootless container be given permission to handle seats/tty0? |
could be wayland to block the access? |
Hmm @giuseppe, I can't find any indication why Wayland would be the cause. Outside of Podman Sway works fine on NixOS (which is a distro that runs installed packages in user space). However, in Podman there's a check for podman/pkg/util/utils_linux.go Lines 114 to 124 in 8d0fcd4
|
Just to clarify, Sway in Podman with:
|
the device should still be present in the container if you explicitly bind mount it through |
That makes sense @giuseppe but it's not accessible with either 🙁
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Issue Description
I'm attempting to run Sway in rootless container but I'm unable to access
/dev/tty0
thus I can't create a graphical session.Possibly related: #15878
Here's what I've tried:
--device /dev/tty0
without success:ls: cannot access '/dev/tty0': No such file or directory
-v=/dev/tty0:/dev/tty0:rslave
results in[seatd/seat.c:60] Could not open tty0 to update VT: Permission denied
--group-add=keep-groups
+crun
doesn't make a differenceSteps to reproduce the issue
Using OpenSuSE Tumbleweed (SystemD) as Host, I've added my main user to the correct groups in order to use
--group-add=keep-groups
(run.oci.keep_original_groups=1
):For demonstration purposes I've created a rootless container which uses the root user inside of it. The same result can be observed if you use a regular user account inside the container and also if you don't specify
--group-add=keep-groups
:I've verified that
--group-add=keep-groups
works correctly withcrun
:Describe the results you received
Various scenarios for
/dev/tty0
--group-add=keep-groups
Describe the results you expected
Ability to access
/dev/tty0
podman info output
The text was updated successfully, but these errors were encountered: