I was wondering if there is a way to make Cinnamon 1.4 the default environment upon logging in to Ubuntu 12.04. I can install Cinnamon 1.4 without any problems, but I am trying to run XRDP to log in from a Windows machine and would like it to start "Cinnamon session" instead of a Unity session by default.

The question is, How can I tell XRDP to use Cinnamon instead of Unity upon logging in?

XRDP seems to work much better than any VNC based servers.

  • By the way, xrdp runs a VNC server. – Reinier Post Jun 16 '14 at 14:27

Found this on the net, on this url: http://sigkillit.com/tag/xrdp

Customize Desktop Environment for xRDP Session

If you do not want to use the default desktop environment, you can customize it by creating a .Xclients file (X is capital!!!) in your home directory to launch the desktop environment you want and making it executable. In order to do this, open a terminal and run one of the following commands

Gnome 3:

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

Gnome Fallback:

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


echo "startkde" > ~/.Xclients
chmod +x ~/.Xclients
sudo systemctl restart xrdp.service


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


echo "cinnamon" > ~/.Xclients
chmod +x ~/.Xclients
sudo systemctl restart xrdp.service


echo "startxfce4" > ~/.Xclients
chmod +x ~/.Xclients
sudo systemctl restart xrdp.service
  • Thanks! Even after messing with .xsession etc, none of it worked. I needed a .Xclients file it seems. This was on Fedora 19. – Alex Dec 13 '13 at 8:44
  • The .Xclients file is truly empty? Just created touch ~/.Xclients ? – Frank Nocke Feb 13 '16 at 18:20
  • This also works for me on CentOS 7. I've tried many other techniques with no success until this. – cfinley May 31 '17 at 16:56

You can start the environment you want only for xrdp (not for local login) in /etc/xrdp/startwm.sh

For example, to start xfce, I use:

if [ -r /etc/default/locale ]; then
  . /etc/default/locale

# default (= ubuntu)
#. /etc/X11/Xsession

# unity 2d
#echo "gnome-session --session=ubuntu-2d" > ~/.xsession
#. /etc/X11/Xsession

# xfce


Commented out, you can see the commands to start unity (ubuntu session) and unity 2d. You only need to comment out xfce command and add the command to start Cinnamon (I didn't give it because I don't know how to start it manually).

Obs: I agree with you xrdp works better than others remote desktop viewers I tried and it works very well with xfce. I use it from other linux machines too with Remmina client. To use it with xfce, you need to install xubuntu-desktop (sudo apt-get install xubuntu-desktop)

  • This seems to be perfect, however on CentOS 7.6 this file does not exist – Musa Jan 7 at 10:43

If you're using Lubuntu Desktop (tested on 12.04 LTS)

  1. For lx syntax discovery:

    ps aux | grep lx
  2. Implementing lx syntax:

    echo "lxsession -s Lubuntu -e LXDE" > ~/.xsession    
    sudo service xrdp restart


  1. Install lxde-common:

    sudo apt-get install lxde-common
  2. Make changes in /etc/xrdp/startwm.sh like this:

    if [ -r /etc/default/locale ]; then
      . /etc/default/locale
      export LANG LANGUAGE
    #. /etc/X11/Xsession

I must admit, I have no personal experince with XRDP. Although it might work if you followed these guidelines, to change your default desktop enviroment at login:


  • 1
    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Anwar Jul 15 '12 at 11:54
  • This will define the environment for every login (xrdp or local login) – laurent Aug 14 '12 at 12:26

The systemctl command is specific to Fedora. For Ubuntu, the command should be:

sudo service xrdp restart
  • Can you edit the answer and add it? – Braiam Dec 12 '13 at 22:55

This is all too confusing. All you have to do is put the text in a file called .Xclients in your home directory that will specify the default desktop. To see what's installed on your system and find out what they are called do:

ls /user/share/xessions

you will see files with an extension .desktop, for example mate.desktop

to make mate your default desktop you can then edit .Xclients in your home folder, if you have such a file, or create one with nothing in it except your chosen desktop type (without the .desktop extension) with a -session appended:

echo mate-session > ~/.Xclients 

should do this just fine. You can then log off and log back in, or if you are connected using xrdp you can restart xrdp, which will log you off and then you can log back in, (just log off and log back in, its stupid to get confused by restarting xrdp etc...)

Forget switchdesk - its broken in Fedora 23.

Forget most of what's on the web for prior Fedora versions, Ubuntu etc... None of it works.

  • ls /user/share/xessions should be ls /usr/share/xessions – PLA Jan 11 at 18:47

First you should have cinnamon on your system :)

Second issue the commands

echo "cinnamon" > ~/.xsession    
sudo service xrdp restart

OR if you like to do it hard:) do the following:

  1. Edit the file /etc/xrdp/startwm.sh

    sudo -H gedit /etc/xrdp/startwm.sh
  2. At the end of the file you will find the following lines:

  3. These are calls to functions above. So in order to make cinnamon the default just put # before wm_start to comment it (to stop calling the function which searches for the sessions)

  4. Add the following line in front of the above three lines gnome-session --session=cinnamon

  5. restart xrdp sudo service xrdp restart

  • Use "cinnamon-session" instead of "cinnamon" to be written to ~/.xsession. – Matthias W. Jun 10 '18 at 20:51

Restart xrdp:

sudo /etc/init.d/xrdp restart

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.