Repository navigation
Closed
Labels
6.topic: GNOMEGNOME desktop environment and its underlying platform
Milestone
Description
GNOME Wayland session can be run manually, see #5071 (comment)
We might need to package few more things like flatpak (for portals, see #33371) and pipewire (for screen capture/remote access, done in #34507).
Then we will need to create a session file for the wayland session. For xsessions the code is here
nixpkgs/nixos/modules/services/x11/display-managers/default.nix
Lines 183 to 202 in 5450c22
| mkDesktops = names: pkgs.runCommand "desktops" | |
| { # trivial derivation | |
| preferLocalBuild = true; | |
| allowSubstitutes = false; | |
| } | |
| '' | |
| mkdir -p "$out" | |
| ${concatMapStrings (n: '' | |
| cat - > "$out/${n}.desktop" << EODESKTOP | |
| [Desktop Entry] | |
| Version=1.0 | |
| Type=XSession | |
| TryExec=${cfg.displayManager.session.script} | |
| Exec=${cfg.displayManager.session.script} "${n}" | |
| X-GDM-BypassXsession=true | |
| Name=${n} | |
| Comment= | |
| EODESKTOP | |
| '') names} | |
| ''; |
but it would be great if we could re-use the already existing $(nix-build -A gnome3.gnome_session)/share/wayland-sessions/gnome.desktop.
Reacted by Robin Bozan, phile314-fh, Tor Hedin Brønner, Ole Jørgen Brønner, Jon Banafato, Spiros Boosalis, PanAeon, kiara and Kenichi Kamiya
Metadata
Metadata
Assignees
Labels
6.topic: GNOMEGNOME desktop environment and its underlying platform
Projects
- StatusShow more project fieldsDone
Activity
[-]Investigate wayland support[/-][+]Investigate GNOME wayland support[/+]hedning commentedon Feb 3, 2018
After some investigation I got Gnome 3.26 up and running from a tty without removing networkmanager support from the build:
Seems to run without any obvious issues.
Simply adding
XDG_SESSION_TYPE=waylandto the existing session script doesn't seem to work though.jtojnar commentedon Feb 3, 2018
Cool, this indeed works, I verified in the looking glass.
I have been trying to make it run in GDM (for now with the existing infrastructure), here is what I found:
First I tried to force the session type as you proposed:
Then there were crashes from missing
org.gnome.SessionManagerschemas, so I tried extending theXDG_DATA_DIRSlike this:But that did not seem to work, so I used the override, which fixed it for some reason:
The session still did not start, though. The journal also contained “GdmSession: checking if file 'gnome3.desktop' is wayland session: no”. As GDM detects the session type by file path, I changed that:
At this point I gave up for now. The session handling is weird and convoluted (see, for example, #34101) and will require more investigation.
jtojnar commentedon Feb 3, 2018
Hmm, found few more errors:
Fixed it using
Then the gsettings issue mentioned by @samdroid-apps:
Still does not work:
Log
samdroid-apps commentedon Feb 3, 2018
Looking through the Fedora
wayland-sessiondesktop files, they useType=Application. Currently, your patchset usesType=XSession.That gets it running, but then crashes due to a dbus service:
I'm on the following diff: release-17.09...samdroid-apps:wayland-wip (which is basically just all your patches applied and the XSession->Application change)
jtojnar commentedon Feb 3, 2018
@samdroid-apps I see this error in normal usage since 3.26 or 3.24 upgrade, it should not be a problem.
My branch: https://github.com/jtojnar/nixpkgs/tree/wayland-tryouts
hedning commentedon Feb 4, 2018
(Replying from irc): Found the manual startup on the arch wiki, but doesn't look like there's much else of interest there. Searching for «wayland» in the gnome-session source code also surfaced a reference to
XDG_SESSION_TYPE.hedning commentedon Feb 4, 2018
Tested out @samdroid-apps
Applicationchange (on top of thewayland-tryoutsbranch), which didn't work on the first try. So started gnome-shell up manually in wayland from a tty to get a better environment to debug from. Logging in through gdm then worked for some weird reason.Edit: did a reboot and managed to reproduce it, posting from wayland logged in through gdm with screenlock working :)
jtojnar commentedon Feb 4, 2018
If you want a better debuggability, you can create a simple configuration, for example:
Then you can run
nixos-rebuild build-vm -I nixpkgs=$HOME/Projects/nixpkgs -I nixos-config=gdm-test.nix --show-traceto build a virtual machine andenv QEMU_NET_OPTS="hostfwd=tcp::2222-:22" ./result/bin/run-*-vmto start it.Then you can run
ssh -p 2222 j@localhostto connect to the machine’s SSH, where you can executejournalctl -xafbto see the log.It is also nice to add
NoHostAuthenticationForLocalhost yesto your~/.ssh/configto be able to log in with different local computers without having to clean~/.ssh/known_hosts.hedning commentedon Feb 4, 2018
Ah, thanks, that's handy. I'll take a look and see if I can figure out why it works when a wayland session is already started.
samdroid-apps commentedon Feb 4, 2018
Doing some more debugging:
I saw
gdm-x-sessionin the logs a lot, and thought it might not be launching with wayland. I added debugging statements to see the program thatgdmwas running, and it does actually rungdm-wayland-session. I believe that the x session is gdm itself.Inside the qemu environment, there is the log message
Feb 04 20:50:10 nixos gnome-session-f[1238]: Cannot open display:- that could be interesting. I grepped mutter, gnome-shell and gdm; but I don't know where the message is coming from.jtojnar commentedon Feb 4, 2018
@samdroid-apps
Wayland=true?gnome-session-failedprogram fromgnome-session. Though the message itself might come from a different source (GTK?)hedning commentedon Feb 5, 2018
I'm getting some really weird behavior in vms. Tried reproduce manual startup from a VT, which seems to work if I use ZSH as a login shell, but not Bash which says that no schemas can be found.
After I got a manual session running I was able to login with GDM (you want to add
gnome3.gnome_sessionto system packages so you won't have to look it up in the store). Now I'm somehow stuck in a working state where GDM logs in successfully on the first try even in fresh VMs (ever after deleting the .qcow2 images). So yeah, weird.To switch VTs in qemu you can use
ctrl-alt-2to switch to the qemu console where you can usesendkey ctrl-alt-f1to switch VTs: askubuntu answerI'm basically using the configuration.nix that @jtojnar posted, but installed
gnome-sessionand couldn't use thememorything, (-m 1500when running the VMs worked though):hedning commentedon Feb 5, 2018
It might be worth trying to remove any lingering
/tmp/.X11-unix/X*sockets. After doing that I'm able to log in with GDM, though had to try 2-3 times. This is outside of a vm, using thewayland-tryoutsbranch with theTYPE=Applicationchange on top.colemickens commentedon May 22, 2018
What's the latest here? Is anyone using GNOME + Wayland as a daily driver?
hedning commentedon May 22, 2018
@colemickens the way we launch sessions from the display manager makes launching wayland sessions hard, so there's a few changes that needs to be made first, see eg. #39871
balsoft commentedon Jun 2, 2018
@colemickens I am running gnome+wayland, though not from GDM, but started manually like that:
[run_gnome_session.nixsh]
[.profile]
colemickens commentedon Jun 4, 2018
It only partially works for me. Somehow it breaks my shell (locale or something? I'll post a screenshot later). It also seems to break gpg-agent somehow (and it's not the usual gnome-keyring thing), maybe due to it not getting a valid loginctl session?
What needs to happen to NixOS to support Wayland sessions?
hedning commentedon Aug 5, 2018
There's WIP PR for gome wayland support now #44497 for people who want to test it out :)
jtojnar commentedon Dec 26, 2018
Thanks to great work by @hedning, GNOME now supports Wayland by default.
Just the following should be enough: