How do I set up xrdp session that reuses an existing session?
Have been trying to set up an 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 for this to work?
We had this same problem, and I just found an easy solution. I originally just installed xrdp using the standard procedure:
apt-get install xrdp
After that, its all about your xrdp.ini file, which is in this place:
/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 username=ask password=ask ip=127.0.0.1 port=-1
The critical 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 ever go back and connect to the same session. I changed mine, so it looks like this:
[xrdp1] name=customsessionname lib=libvnc.so username=myusername password=ask ip=127.0.0.1 port=5912
That’s it; I think you could get away with just changing the port=-1 to port=5912. My xrdp always re-connects to the existing session still using the same port.