Solution – XRDP works multiple RDP sessions without vncserver involvement!
The Need:
I am helping a local genealogy society set up their research center. They want three workstations and a single data server. The genealogy program of choice was GRAMPS, which I have used for years – a Wonderful program! No data is going to be input on the workstations – the users are simply researching existing data on the server.
Since several RDP-based Wyse thin client units were available for free as were monitors and keyboards, the decision was quickly made to use an RDP based client/server system. Using VNC was unacceptable due to its speed and latency issues, plus, it isn't supported by the Wyse thin client units – ONLY RDP and Cytrix.
Using Microsoft's server OS and Terminal Server package was far, far beyond the society's budget. We briefly considered equipping a Windows XP box with a copy ThinSoft's RDP server package, WinConnect Server XP, but its $300 price tag was still too much for the society.
The decision was to use Linux for the server. At first we considered LTSP but it is oriented towards PXE net boots and, while this may have worked, its complexity scared us off and we opted for what, we initially thought, was a much simpler solution – XRDP.
We were right and wrong at the same time. It is simple to set up – very simple, but the lack of documentation places many pitfalls in front of you, PLUS the solution is distribution dependent.
I spent many hours on this issue. There are numerous sources on the web citing solutions to running XRDP. Unfortunately, they all involve running vncserver against the destination logins. This is NOT what we desired. We wanted to be able to boot up the host system but not login at all, yet still be able to connect to a session via RDP. I tried numerous distributions and eventually spending a lot of time going through the xrdp source code and planting out my own debug messages in /etc/xrdp/startsm.sh to output to a file in /tmp. Putting in “ps -eS >> /tmp/xrdp.txt” was particularly useful because it showed that xrdp/sesman DID launch an Xvnc, meaning that it was unnecessary to pre-launch vncserver, as most pundits recommend. The solution was figuring out how to connect to the Xvnc session created by sesman.
I discovered the solution somewhat by accident. It seems that the files created in the destination user's .vnc folder by vncserver were interfering with xrdp/sesman. Here is what worked.
- 1.Starting with a nearly virgin install of Ubuntu 10.04 beta 1, installed two users intended to be accessed for remote login via RDP. That is ALL that I did – I never even logged into them.
- 2.My first entry xrdp.ini was unmodified except that “ask” was deleted from “username=”. Everything was unmodified.
- 3.Using tsclient on another machine, with the desired username, that was NOT logged in, and password pre-filled, I connected and received a nice Gnome desktop.
- 4.The session was on 5910.
- 5.While keeping this session active, I logged into the next login created for remote access and received my second nice Gnome sesktop on port 5911 – automatically. Xrdp-sesman DOES automatically launch Xvnc in a useful way!
Ok, everything isn't roses. I can ONLY get this to work on Ubuntu version 10.04 e/w Gnome. It fails on CentOS 5.2, Xubuntu 9.10, SuperOS 9.10 and Lubuntu 10.04. In all cases xrdp was version 4.1.1, so the issue is not with xrdp/sesman – it lies within the OS – what, I do not know. I did not test KDE at all.
---------------
Code:The system is running Ubuntu 10.04 LTS beta - the Lucid Lynx, amd64: uname -a Linux ubu910 2.6.32-16-generic #25-Ubuntu SMP Tue Mar 9 16:33:12 UTC 2010 x86_64 GNU/Linux --------------------------------- Contents of /etc/xrdp/sesman.ini: --------------------------------- [Globals] ListenAddress=127.0.0.1 ListenPort=3350 EnableUserWindowManager=1 UserWindowManager=/etc/xrdp/startwm.sh DefaultWindowManager=/etc/xrdp/startwm.sh [Security] AllowRootLogin=1 MaxLoginRetry=4 TerminalServerUsers=tsusers TerminalServerAdmins=tsadmins [Sessions] MaxSessions=10 KillDisconnected=0 IdleTimeLimit=0 DisconnectedTimeLimit=0 [Logging] LogFile=/var/log/sesman.log LogLevel=DEBUG EnableSyslog=0 SyslogLevel=DEBUG [X11rdp] param1=-bs param2=-ac [Xvnc] param1=-bs param2=-ac ---------------------------- Contents of /etc/xrdp/startwm.sh: ---------------------------- #!/bin/sh if [ -r /etc/default/locale ]; then . /etc/default/locale export LANG LANGUAGE fi . /etc/X11/Xsession ---------------------------- Contents of /etc/xrdp/xrdp.ini: ---------------------------- [globals] bitmap_cache=yes bitmap_compression=yes port=3389 crypt_level=low channel_code=1 [xrdp1] name=remote lib=libvnc.so username= password=ask ip=127.0.0.1 port=-1 --------------------------------- The user "remoc1" contains a .vnc folder that was created by sesman NOT vncserver. It only contains one file "sesman_passwd".
Bookmarks