Linux – How to preserve xrdp session on ubuntu 14.04

linuxrdpUbuntu

I installed xrdp on my ubuntu 14.04 machine using the below commands. I can now remote desktop from my windows machine easily into my ubuntu machine.

However, what I notice is when I close the remote desktop connection and login again with same credentials, it would start a fresh new session. I was expecting to see the screen where I left. Is there anything specific I need to do to preserve the session?

sudo apt-get install xrdp
sudo apt-get update
sudo apt-get install xfce4
echo xfce4-session >~/.xsession
sudo service xrdp restart

Best Answer

There is a post at http://c-nergy.be/blog/?p=5305 that gives a couple of options e.g.

edit /etc/xrdp/xrdp.ini

sudo gedit /etc/xrdp/xrdp.ini

Locate the section [xrdp1]

Replace the following line:

port=-1

With:

port=ask-1

Save the file.

Restart xrdp:

sudo service xrdp restart.

When you login enter a port number e.g. 1234 and then just use the same port number each time.