How to set a default desktop environment at system start?

You should be able to set this up by editing your $HOME/.dmrc file. The sessions available to your display manager (whichever one you use) are .desktop files normally located in /usr/share/xsessions. In my case, this directory contains:

$ ls /usr/share/xsessions
cinnamon2d.desktop  gnome-fallback.desktop  openbox-gnome.desktop  xfce.desktop
cinnamon.desktop    mate.desktop            openbox-kde.desktop
gnome.desktop       openbox.desktop         ssh.desktop

Any of those files is a possible session that my display manager can choose. Which one is controlled by the $HOME/.dmrc file. So, to make KDE the default, you would have to edit that file and make it look like this:

[Desktop]
Session=kde-plasma

That assumes that you have a kde.desktop file in the xsessions directory, I don't use KDE so I can't check but it works for me using cinnamon or xfce. Once you have made that change, you should be logged in to KDE by default every time.


In GNOME 2, the .dmrc file in the user home directory was used to create default sessions. This .dmrc file is no longer used.

To specify a default session for a user, update the user’s account service in the /var/lib/AccountsService/users/*username* file:

[User]
Language=
XSession=mate

Source


For RHEL/CentOS 7 you can set the file /etc/sysconfig/desktop to contain DESKTOP=KDE which will default it to KDE.

This also works for VNC.