How to easily switch between multiple desktop environments?

Is there an easy way to switch between multiple desktop environments - e.g. to have Gnome/XFCE/etc all installed and select a session from the login screen? Setting the desktop manager in the configuration file seems to equate to having one. I know I’m almost certainly wrong about that but can’t find an obvious way to set it up.

It depends on the login screen but should already work! I have lightdm and can select between xmonad and xterm (a fallback I’m glad I kept!) on the top right…
I think it even caches my last selection :thinking:

Yeah, I don’t know what’s going on. I’ve managed to get Gnome and Xfce on the menu (which is what I was trying to do) but for some reason Xfce refuses to start, and if I switch out gdm for lightdm then my xserver refuses to start on boot. Peculiar.

Share your configuration! Also the logs from journalctl --boot -t xsession after you try xfce, assuming you have services.xserver.displayManager.job.logToJournal set to its default.

Ok so this happened …
I decided to forget about DEs for a while and went to play with FreeBSD in Gnome boxes. However it got stuck in a loop and wouldn’t boot so I decided to clone the VM and delete the old one. At that point my entire desktop crashed and kicked me to tty. I tried to reboot but couldn’t get past the login screen and previous generations gave me a kernel panic on boot. I managed to remove all references to virtualization software in my config file and that worked, and it ALSO fixed my earlier problem of being unable to login to XFCE :joy:
But … now I can’t start a Wayland session on Gnome unless I log in / out of an X-session first. So that’s broken.
Does anyone have a clue what might have happened?

My config is really vanilla - just some NVidia drivers that I’ve also experimented with removing, to no effect.

journalctl might, also your rather vanilla settings might have a clue :wink:

Virtualization causing problems, coupled with your apparent confusion about driver configuration, make my configuration mistake senses tingle. Kernel panics for old generations seem incredibly suspicious too.

Here are some bits from the journalctl -b

FIRST LOGIN

Sep 05 14:42:53 nixos .gnome-shell-wr[1211]: Running GNOME Shell (using mutter 44.3) as a Wayland display server
Sep 05 14:42:53 nixos .gnome-shell-wr[1211]: Device '/dev/dri/card1' prefers shadow buffer
Sep 05 14:42:53 nixos .gnome-shell-wr[1211]: Added device '/dev/dri/card1' (i915) using atomic mode setting.
Sep 05 14:42:53 nixos .gnome-shell-wr[1211]: Device '/dev/dri/card0' prefers shadow buffer
Sep 05 14:42:53 nixos .gnome-shell-wr[1211]: Added device '/dev/dri/card0' (nouveau) using non-atomic mode setting.
Sep 05 14:42:53 nixos .gnome-shell-wr[1211]: Created gbm renderer for '/dev/dri/card1'
Sep 05 14:42:53 nixos .gnome-shell-wr[1211]: Created gbm renderer for '/dev/dri/card0'
Sep 05 14:42:53 nixos .gnome-shell-wr[1211]: Boot VGA GPU /dev/dri/card1 selected as primary
Sep 05 14:42:53 nixos .gnome-shell-wr[1211]: Obtained a high priority EGL context
Sep 05 14:42:53 nixos .gnome-shell-wr[1211]: Obtained a high priority EGL context
Sep 05 14:42:54 nixos /nix/store/rljsllp6pw3xijxr2ix0li5dzyxbc3za-gdm-44.1/libexec/gdm-wayland-session[1196]: dbus-daemon[1196]: [session uid=132 pid>
Sep 05 14:42:54 nixos /nix/store/rljsllp6pw3xijxr2ix0li5dzyxbc3za-gdm-44.1/libexec/gdm-wayland-session[1196]: dbus-daemon[1196]: [session uid=132 pid>
Sep 05 14:42:54 nixos .gnome-shell-wr[1211]: Using public X11 display :1024, (using :1025 for managed services)
Sep 05 14:42:54 nixos .gnome-shell-wr[1211]: Using Wayland display name 'wayland-0'
Sep 05 14:42:54 nixos .gnome-shell-wr[1211]: Unset XDG_SESSION_ID, getCurrentSessionProxy() called outside a user session. Asking logind directly.
Sep 05 14:42:54 nixos .gnome-shell-wr[1211]: Will monitor session c1

LOGGING IN AFTER LOGGING IN/OUT OF XORG SESSION

Sep 05 15:11:11 nixos .gnome-shell-wr[5356]: GNOME Shell started at Tue Sep 05 2023 15:11:09 GMT+0100 (British Summer Time)
Sep 05 15:11:11 nixos .gnome-shell-wr[5356]: Registering session with GDM
Sep 05 15:11:11 nixos .gnome-shell-wr[4934]: Connection to xwayland lost
Sep 05 15:11:11 nixos .gnome-shell-wr[4934]: Xwayland terminated, exiting since it was mandatory
Sep 05 15:11:11 nixos .gnome-shell-wr[4934]: (../src/core/meta-context.c:501):meta_context_terminate: runtime check failed: (g_main_loop_is_running (priv->main_loop))
Sep 05 15:11:11 nixos org.gnome.Shell.desktop[4934]: GNOME Shell terminated with an error: Xwayland exited unexpectedly
Sep 05 15:11:11 nixos .gnome-shell-wr[4934]: Shutting down GNOME Shell

I tried a backup config file from a couple of days ago, when life was rosy, and the xserver wouldn’t even start. Things are odd.

Ok, I’ve narrowed it down to something in my user configs. I went back to a barebones system config with no dice. Then created a new user and their login works perfectly! Question now is, what the hell got borked?

Hum, looks like xwayland almost instantly crashes, or isn’t properly launched in the first place. I don’t think the gnome wayland session runs any xinitrc or xsession files or anything, so not the usual suspects.

Do you run any X applications on login? My gnome-foo isn’t great, so I have few pointers on gnome config that might break X.

Syncthing was the only thing running on login. I disabled it and completely reset Gnome and it was still broke. In the end I just moved across to my new user account. I’m fairly low use so it didn’t take long (although I’m now looking at home manager … ) Thanks for all the help!