How to configure XRDP to start cinnamon as default desktop session

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.


Solution 1:

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

KDE:

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

MATE:

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

Cinnamon:

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

Xfce4:

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

Solution 2:

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:

#!/bin/sh
if [ -r /etc/default/locale ]; then
  . /etc/default/locale
  export LANG LANGUAGE
fi

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

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

# xfce
startxfce4

exit(0)

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)