Shell – How to switch from GNOME Classic to GNOME Shell on CentOS 7 over RDP

centos-7gnomegnome-shellremote desktop

My situation is that I'm connecting to a CentOS 7 VM from a Windows machine using Remote Desktop Connection. I've followed the standard advice and installed xrdp and tigervnc, as well as the "GNOME Desktop" install group, which installed GNOME 3.22.2.

This is all working fine, I can log in with no problems, but when I log in I am presented with the GNOME Classic desktop. I prefer gnome-shell, and I'm not sure how to switch to it.

The instructions I've found seem to indicate that I either need to edit my ~/.xinitrc file (which I've done, but which doesn't seem to have any effect, probably because I'm using RDP rather than X forwarding) or else change the desktop environment at login time through the graphical login interface, as suggested in this answer.

I think I must be missing something. Have installed the wrong desktop environment? Am I missing a package? Do I need to somehow configure GNOME, xrdp, tigervnc, or Remote Desktop Connection? Do I need to run something after login? What's the step I'm missing here?

I can't seem to find any resources addressing how to set up GNOME Shell in my specific situation, though it seems to be fairly common based on how many articles exist explaining to to set it up.

Best Answer

After hours of searching, I finally found this askubuntu answer. Long story short, follow these steps (preferably via SSH instead of in a shell over RDP, so you don't kill your own connection when you restart xrdp.service) to enable GNOME Shell as your default desktop environment:

echo "gnome-session" > ~/.Xclients
chmod +x ~/.Xclients
sudo systemctl restart xrdp.service

Logged back in via RDP, and I got GNOME Shell! Huzzah!

The answer I linked has similar instructions for a range of desktop environments, but the general pattern is to do those same steps above, just replacing "gnome-session" with your favorite session type. Elsewhere in my research I found that if you want to see which sessions you currently have installed, they're all collected in one place:

$ ls /usr/share/xsessions/
gnome-classic.desktop  gnome-custom-session.desktop  gnome.desktop
Related Question