How to Default to X11 but Keep Wayland Enabled on Rocky Linux 8?

Hello,

I’m working on configuring Rocky Linux 8 for newly imaged machines and would like to have X11 set as the default session, but still keep Wayland enabled for users who prefer it. The goal is to allow users to select Wayland or X11 from the login screen.

Currently, I have the following configuration in /etc/gdm/custom.conf:

# /etc/gdm/custom.conf

# GDM configuration storage

[daemon]
AutomaticLoginEnable=false
# Uncomment the line below to force the login screen to use Xorg
WaylandEnable=false

[security]

[xdmcp]

[chooser]

[debug]
# Uncomment the line below to turn on debugging
#Enable=true

However, when I set WaylandEnable=false, the cogwheel option to switch between Wayland and X11 disappears entirely at the login screen. If I set WaylandEnable=true, it automatically defaults to Wayland instead of X11, which is not what I want.

Is there a way to default to X11, but still allow users to switch to Wayland at the login screen?

Any suggestions or insights would be greatly appreciated!

Is there a way to default to X11, but still allow users to switch to Wayland at the login screen?

Any suggestions or insights would be greatly appreciated!

Perhaps: Chapter 8. Setting a default desktop session for all users | Red Hat Product Documentation

Heck yeah thank you! I was able to implement on my home laptop with Rocky 9. Newly created users on my laptop defaulted to x11 when I changed the value /etc/accountservice/user-templates/standard to session=gnome-xorg .

Now for preexisting users that have saved sessions using wayland. How do I force them to revert to the new default which is x11?

Already checked /home/<user>/.config/gnome-session/saved-session and it was empty.

Any suggestions?

That page describes “exceptions to default” being in /var/lib/AccountsService/users/
Perhaps you should remove those exceptions?

1 Like

You’re a wizard @jlehtone ! Thank you very much! Was able to implement everything you suggested successfully.

Didn’t realize it autogenerated user files on initial login in /var/lib/AccountService/users/
After deleting user file, then doing a quick sudo systemctl restart gdm it took the default.

Thanks again!