Ubuntu – How to set up xrdp session that reuses an existing session

lxderdpremote desktop

I have been trying to set up a RDP terminal server on precise using xrdp and have been having significant trouble getting a working configuration. When a user logs on, I need it to connect to that users existing session if it exists, otherwise starting a new session, and any started session must start LXDE. What changes to the default configuration do I need to make in order for this to work?

• I had this same problem, and I just found an easy solution. I originally just installed xrdp using the standard proceedure:

apt-get install xrdp


After that, its all about your xrdp.ini file, which is located here:

/etc/xrdp/xrdp.ini


To open and edit the xrdp's configuration file use:

sudo nano /etc/xrdp/xrdp.ini


by default the first xrdp session handling script looks like this:

[xrdp1]
name=sesman-vnc
lib=libvnc.so
ip=127.0.0.1
port=-1


The important line is port=-1, this makes xrdp always look for a free port to connect. If you set a fixed port here, the xrdp will always go back and connect to the same session. I changed mine so it looks like this:

[xrdp1]
name=customsessionname
lib=libvnc.so

Thats it, I think you could get away with just changing the port=-1 to port=5912. My xrdp always re-connects to existing session always using the same port.