Ubuntu 13.04 is no longer supported for that I'm giving you solution for Ubuntu 12.04 and then I'll add the 14.04 solution later.
For Ubuntu 12.04
Use a tricky hack(obligate the xrdp to use the ubuntu-2d session always without searching for other sessions)
Install xrdp:
sudo apt-get install xrdp
Now Edit the file startwm.sh
:
sudo gedit /etc/xrdp/startwm.sh
In the end of the script you can find these three lines calling functions above:
pre_start
wm_start
post_start
All you have is to comment the wm_start
function by inserting leading # then add the line for needed session.
pre_start
#wm_start
gnome-session --session=ubuntu-2d
post_start
The wm_start
function which is responsible for starting the window manager.
Now save and exit, then restart xdrp:
sudo service xrdp restart
This should works smoothly. I'm using it since three years ago.
For Ubuntu 14.04 and later
Install xrdp same as above
Install XFCE4 or any other supported
sudo apt-get install xfce4
Edit our .xsession
file in your home:
echo xfce4-session >~/.xsession
Edit startwm.sh
file:
sudo gedit /etc/xrdp/startwm.sh
In the wm_start()
Add the line startxfce4
just directly under:
if [ -r /etc/default/locale ]; then
. /etc/default/locale
export LANG LANGUAGE
fi
so the function looks like:
wm_start()
{
if [ -r /etc/default/locale ]; then
. /etc/default/locale
export LANG LANGUAGE
fi
startxfce4
# debian
if [ -r /etc/X11/Xsession ]; then
. /etc/X11/Xsession
exit 0
fi
.....
}
Now save and exit then restart xrdp.
sudo service xrdp restart