How do I set the default desktop environment on 18.04 (Bionic)?

I've installed Gnome Flashback and can select it on the log in screen: enter image description here

Unfortunately, every time I restart I'm automatically logged into the original "Ubuntu" (Gnome 3) environment again. The solutions in these related questions don't work anymore:

how to set default session in Ubuntu 14.04 LTS?

How do I change the default session for when using auto-logins?

Specifically, setting user-session to gnome-flashback-metacity in /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf has no effect.

How do I fix this?


Solution 1:

$ sudo update-alternatives --config x-session-manager

(you can also add other DM via

sudo update-alternatives --install /usr/bin/x-session-manager x-session-manager /usr/bin/gnome-session-classic 60 

[assuming the new session manager is /usr/bin/gnome-session-classic :-]

Solution 2:

You could reconfigure your default display manager using these steps in the terminal. I am assuming that your default is gdm3 and you want to move to lightdm

$ sudo dpkg-reconfigure gdm3
<OK>
lightdm

Solution 3:

You can change the default Desktop environment file in user Account file.

cd /var/lib/AccountsService/users

Select the specific user file

Here change the "xsession" value to "GNOME Flahsback (Metacity)"

Solution 4:

Found a workaround. Install LightDM (which IMHO looks much better than the default GDM):

sudo apt-get install lightdm

Then disable and re-enable autologin (if needed). This creates a working configuration that remembers your selected desktop environment.