Repository navigation
Run X11 display server without root privileges - #1371
Conversation
|
Let me know if this gets out of WIP, or if you hit something that you need a second set of eyes on. |
|
Things to do:
|
I did see this when redirecting the output, maybe it's the same reason? |
|
Xorg needs have stdin (from a simple test with startx). I suggest we need set stdin to be set to /dev/ttyN for the Xserver as workaround. |
|
Rebased on top of #1377 |
Fixed in the PR that I just sent to your personal branch that this is based on. |
|
Thanks guys for the help. This PR is now ready for your reviews. |
|
I quickly tested it and I don't seem to be able to log out from X11 sessions using this. Tried it with plasma, gnome and icewm. Starting them seems to work fine. 👍 |
|
There's still a few things left to fix, there's the issue above which is breaking our logout, but even with that fixed my original greeter we go back to is in a broken state. I'll try to follow up on that. |
|
|
I'm pretty sure this was an issue with my installation and cannot reproduce anymore. If I had the powers I'd approve the patch. |
davidedmundson
left a comment
There was a problem hiding this comment.
I still want to do the helper refactor before release, but as stated in the in-line comment we can resolve that after merging this so we don't stall this forever.
|
It's worth noting that one of these commits is of super-importance even with the current Xorg daemon: "Allocate VT for the display" We have an important downstream bug that if you start a wayland session then call switch user, SDDM will start on what SDDM thinks is the next available VT, which naturally is the one the wayland session is on. This fails and we can't switch users. This patch here fixes that, which is nice \o/ |
Does this PR also help with #1281? |
Replace the old crude algorithm to find the next available VT with a more reliable method using the VT_OPENQRY ioctl. General.MinimumVT setting is now obsolete and it's no longer used.
|
Ready for review! |
Introduce an alternative display server option to run the greeter with the X11 server as an unprivileged user. Root privileges are required by default, but this will change in the future. Greeter output is forwarded to the helper process, instead of saving it into a separate file like user sessions do. This means the greeter output is available in the journal with the daemon and helper logs. Display start and stop commands are executed as sddm user and this might break the workflow of our users. That is the reason why we still run Xorg as root for the greeter by default. X11 user session always spawn a new display server without root privileges. Closes: #246
|
+1 just tested, worked as expected. |
|
What happened to the commit "Make sure the helper process is stopped when shutting down." that was previously part of this PR? edit: oh, I guess it was its own PR as #1377 , and was in this one accidentally? |
It was needed due to an error that is now solved |
|
How would a user run the Xorg server as rootless with SDDM? |
|
You need to set |
I did put this in the Xwrapper.config file but this caused my system to hang on startup. |
No, you have to put it in the SDDM configuration file. |
Ah, okay; sorry, I misunderstood where it was supposed to go. |
Yes sure, but right now we can't make it the default because some people rely on the fact that it's running as root |
|
The man files says "For x11-user you might need to configure Xorg.wrap(1)". Is it correct? |
Tweak that file only if it's not working.
Yes that is correct and should force X11 to run without root privileges, but you only have to configure this stuff if really needed. |
|
I've set x11-user in the sddm conf file and now I have Xorg owned by my user. The same happens for sddm-helper. Sddm is running as root. |
|
I've noted that command launched with firejail are not able to connect to the X server. With GDM in rootless mode the same command works correctly. |
|
When using sddm, echo $XAUTHORITY gives /run/user/1000/c04e4bb9-0531-4ab3-86a8-caaa6f30a661 with the file name changingat every reboot Moreover when I look at the Xorg process it is runned by sddm as: GDM instead runs Xorg in this way: Finally running xauth when started by sddm I get: Whereas running when uning GDM I get: |
|
When using sddm, echo $XAUTHORITY gives /run/user/1000/c04e4bb9-0531-4ab3-86a8-caaa6f30a661 with the file name changingat every reboot Moreover when I look at the Xorg process it is runned by sddm as: GDM instead runs Xorg in this way: Finally running xauth when started by sddm I get: Whereas running when using GDM I get: |
|
Does this mean we will have a rootless X in the v0.20 release? That would be 🔥 What will be needed? I have read the conversations above and it looks like a user will have to add the following to the Am I right or did I misunderstand something 😁? thx |
|
That is how you do it, yes. |
|
When do you plan to release 0.20? I'm really waiting for this. |
|
Ok, I tried this and I have been using it for the last month or so, it really works as we described, just adding the Everything works fine for me but I have one big issue, when I log into the system, write the password down and press enter, then the I'm on Gentoo with OpenRC and the exec /usr/bin/X -nolisten tcp -keeptty "$@" "vt$XDG_VTNR"And the This problem is not happening without the Is there any workaround for this or a patch? How can I force the sddm to switch to the |
Introduce an alternative display server option to run the greeter the
X11 server as an unprivileged user.
Closes: #246