Configuring X11 for Gnome

I would like to use X11 with Gnome. What I have in configuration:

# Enable the X11 windowing system.
  services.xserver.enable = true;
  
  # enable Gnome
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.desktopManager.gnome.enable = true;

This will result Gnome starting into Qayland and there is no dropdown or anything on log in to choose X. Tried removing gdm line but then X11 will fail to start and the startup fails. Couldn’t find any resources regarding this.

Any ideas? The reason for X11 over Wayland is that Teams screen sharing is not working too well on Wayland (otherwise I would prefer Wayland).

Thanks!

services.xserver.displayManager.gdm.wayland = false;

should do it.

3 Likes

Thanks for the response!

Adding that line results just an empty black screen with cursor blinking on the upper left corner on boot up (just before the graphical UI should start). Same happened when I tried to add following lines to /etc/gdm/custom.conf:

WaylandEnable=false
DefaultSession=gnome-xorg.desktop

Not sure how to debug this.

I’m on unstable.

What do the logs show (journalctl)?

Hi, sorry for the delayed answer.

Here is the complete boot up log when wayland is disabled with gdm+gnome: X11 / gnome+gdm fails with wayland disabled - Pastebin

Now I have a new problem: if I try to go switch back to KDE plasma from gnome the X11 fails on startup: KDE startup X11 failure - Pastebin.com

Not sure if I managed to break X11 somehow. Not sure what I can do besides a reinstall as KDE still works from previous generations, but it fails to start up if I switch to to the exact configuration I had earlier.

Ah btw the machine is Dell Precision 5560 and I think it has Mesa Intel® UHD Graphics (TGL GT1) card.

Looks like gdm is segfaulting:

May 14 20:04:34 nixos /nix/store/855dn1bi3fcsqh5xkqkh29bhb4c2zy97-gdm-42.0/libexec/gdm-x-session[2219]: Fatal server error:
May 14 20:04:34 nixos /nix/store/855dn1bi3fcsqh5xkqkh29bhb4c2zy97-gdm-42.0/libexec/gdm-x-session[2219]: (EE) Caught signal 11 (Segmentation fault). Server aborting

On the other hand, your new log shows this:

May 15 12:55:45 nixos kernel: nouveau 0000:01:00.0: gr: init failed, -110

That’s suspicious, that’s the open nvidia driver. Is this a laptop with mixed graphics? You may need to configure it to handle both correctly.

My guess is that the switch between Wayland/X triggered some funky path in the “which GPU is rendering my display” logic.

1 Like

Is this a laptop with mixed graphics?

Hmm, reading the specs from Dell website I thought that the Nvidia GPUs are something optional and cost extra.

BIOS device section lists

Video Controller: Intel UHD Graphics
dGPU Video Controller: NVIDIA T1200 Laptop GPU

so it seems that this machine has two gpu:s indeed.

Thanks! I need to dig into the Nixos manual if there is something how to configure these.

Configured Nvidia PRIME etc. according to Nvidia - NixOS Wiki and now I can boot into Gnome on X11 with services.xserver.displayManager.gdm.wayland = false;

Thanks everyone for the help!

3 Likes

Hello,

I think I encounter the same problem, but as I’m new to nixos, I want to be sure I’m not missing something.

Here is what I want:

  • I have a laptop with nvidia graphic card and I want to enable the nvidia graphic card ( for an external display )
  • I want to use X11 because I want to share screen on discord and it seems not to work correctly in wayland
  • I want to use gnome

Here is what I have:
I use this in my nixos configuration to always enable nvidia.

 hardware.nvidia.prime.sync.enable=true

I force not to use wayland

services.xserver.displayManager.gdm.wayland = false;

If I configure it like this, when I log in, I have a blackscreen.
If I understand correctly in this topic, it may come from the nvidia driver that has a problem with X, but what I don’t understand is if I try to use plasma with X and the nvidia driver it works correctly.

Any ideas or feedback?

Thx!

Can you create a new topic? This one is resolved, so few people will read it.

Also include the output of journalctl --boot in your post like OP did - without it it’s hard to tell what’s going wrong.

This can also be fixed, by the way. It’s not that screen sharing is broken, screen sharing your whole screen won’t work because of Wayland restricting X11 applications for security reasons.

The discord app, despite being a chrome browser with a theme, is not built with Wayland support, so it runs as an X11 application, and is therefore restricted.

Easiest way around this is to use firefox (not sure if chrome is correctly set up for Wayland yet, but firefox is as of NixOS 22.11) instead of the standalone app, that even saves resources because you don’t need to have a browser just dedicated to running discord!

That, or you just always screen share a specific window.