GNOME session no longer launch on Wayland

This is the output when it falls back to x11:

total 12
drwxrwxrwt 19 root root 4096 Feb 10 01:07 .
drwx-w-rwx 24 root root  323 Feb 10 01:06 ..
drwxrwxrwt  2 root root   30 Feb 10 01:06 .ICE-unix
drwxrwxrwt  2 root root   42 Feb 10 01:06 .X11-unix
-r--r--r--  1 gdm  gdm    11 Feb 10 01:06 .X1024-lock
-r--r--r--  1 gdm  gdm    11 Feb 10 01:06 .X1025-lock
drwxrwxrwt  2 root root    6 Jan 29 00:02 .XIM-unix
drwxrwxrwt  2 root root    6 Jan 29 00:02 .font-unix
drwx------  3 root root   17 Feb 10 01:06 systemd-private-456d638c961f466a940a70aa0feaae68-ModemManager.service-pmArQQ
drwx------  3 root root   17 Feb 10 01:06 systemd-private-456d638c961f466a940a70aa0feaae68-bluetooth.service-34SiNL
drwx------  3 root root   17 Feb 10 01:06 systemd-private-456d638c961f466a940a70aa0feaae68-bolt.service-oNMKG8
drwx------  3 root root   17 Feb 10 01:06 systemd-private-456d638c961f466a940a70aa0feaae68-colord.service-alVsnU
drwx------  3 root root   17 Feb 10 01:06 systemd-private-456d638c961f466a940a70aa0feaae68-dbus-broker.service-FKGXBc
drwx------  3 root root   17 Feb 10 01:06 systemd-private-456d638c961f466a940a70aa0feaae68-iio-sensor-proxy.service-MeAaNE
drwx------  3 root root   17 Feb 10 01:06 systemd-private-456d638c961f466a940a70aa0feaae68-nscd.service-uP9Tmx
drwx------  3 root root   17 Feb 10 01:06 systemd-private-456d638c961f466a940a70aa0feaae68-ollama.service-7mosva
drwx------  3 root root   17 Feb 10 01:06 systemd-private-456d638c961f466a940a70aa0feaae68-polkit.service-NJGEvG
drwx------  3 root root   17 Feb 10 01:06 systemd-private-456d638c961f466a940a70aa0feaae68-syncthing.service-wURDdw
drwx------  3 yes  yes    17 Feb 10 01:06 systemd-private-456d638c961f466a940a70aa0feaae68-systembus-notify.service-DCfqRQ
drwx------  3 root root   17 Feb 10 01:06 systemd-private-456d638c961f466a940a70aa0feaae68-systemd-logind.service-yajlAV
drwx------  3 root root   17 Feb 10 01:06 systemd-private-456d638c961f466a940a70aa0feaae68-upower.service-KV2LE0

Also the output of ls -la /tmp/.X11-unix:

total 4
drwxrwxrwt  2 root root   42 Feb 10 01:06 .
drwxrwxrwt 19 root root 4096 Feb 10 01:07 ..
srwxrwxrwx  1 yes  yes     0 Feb 10 01:06 X0
srwxr-xr-x  1 gdm  gdm     0 Feb 10 01:06 X1024
srwxr-xr-x  1 gdm  gdm     0 Feb 10 01:06 X1025

I made a change to set them in /etc/xonsh/xonshrc when it is wayland session, but forgot to remove them from environment.variables :rofl:

However, removing them still doesn’t help :melting_face:

Ok the privileges seem fine.
Can you disable this in you config:

  systemd.services = {
    "autovt@tty1".enable = false;
    "getty@tty1".enable = false;
  };

Also do you have any autologin configured?

Still no luck after commenting these out.

No, I don’t.

Ok
So the only two things I can think of you could try are following:
In your config:

  users = {
    groups.yes.gid = 1000;
    users.yes = {
      description = "Sam L. Yes";
      group = "yes";
      extraGroups = [
        "adbusers"
        "networkmanager"
        "wheel"
        "wireshark"
        "vboxusers"
      ];
      initialHashedPassword = "";
      isNormalUser = true;
      uid = 1000;
    };
  };

Comment the lines:

uid =1000;
initialHashedPassword = "";
group = "yes";
groups.yes.gid = 1000;

If this does not help try changing the user default shell to something like bash:

users.defaultUserShell = "/run/current-system/sw/bin/xonsh";

Maybe the xonsh config is causing this issue:

    xonsh = {
      enable = true;

      config = ''
        $LANG = "zh_CN.UTF-8"

        if __xonsh__.env.get("XDG_SESSION_TYPE") == "wayland":
            $GTK_IM_MODULE = ""
            $QT_IM_MODULE = ""
            $MOZ_ENABLE_WAYLAND = "1";
            $NIXOS_OZONE_WL = "1";
            $QT_QPA_PLATFORM = "wayland;xcb";
            $SDL_VIDEODRIVER = "wayland";

        # TODO: this shouldn't be necessary
        $SHELL_TYPE = "best"
      '';

So I would try it without this config or a different default user shell.
Because with the test user you are using bash shell and with you “normal user” you are using xonsh with this config.

Resolved by deleting /var/lib/AccountsService/users/yes. Unfortunately I didn’t properly back up the content of that file, but I clearly remember there’s x11 in it.

1 Like