5

I have setup my Ubuntu server so that I can connect and login to XRDP from Windows remote desktop.

My problem is that after logging in, no window-manager is started. It only displays a single gnome-terminal with no border and gray meshed background.

It seems that /usr/sbin/xrdp-sesman itself is running (from observation of ps and /var/run/xrdp/xrdp-sesman.pid).

I put debugging line like touch /home/myname/aaaaa into ~/startwm.sh or /etc/xrdp/startwm.sh, but the file aaaaa did not generated after logging in, so these scripts have not been executed. (Both of them have chmod +x permission.)

Am I missing some configuration file, or is there any way of further inspection?

Any help is appreciated. Thanks.

Contents of /etc/xrdp/sesman.ini

[Globals]
ListenAddress=127.0.0.1
ListenPort=3350
EnableUserWindowManager=0 # or 1
UserWindowManager=startwm.sh
DefaultWindowManager=startwm.sh # or commented-out

[Security]
AllowRootLogin=1
MaxLoginRetry=4
TerminalServerUsers=tsusers
TerminalServerAdmins=tsadmins

[Sessions]
MaxSessions=10
KillDisconnected=0
IdleTimeLimit=0
DisconnectedTimeLimit=0

[Logging]
LogFile=/var/log/xrdp-sesman.log
LogLevel=DEBUG
EnableSyslog=0
SyslogLevel=DEBUG

[X11rdp]
param1=-bs
param2=-ac
param3=-nolisten
param4=tcp

[Xvnc]
param1=-bs
param2=-ac
param3=-nolisten
param4=tcp

Contents of /var/log/xrdp-sesman.log after logging in:

[20120402-21:29:34] [CORE ] starting sesman with pid 11064
[20120402-21:29:34] [INFO ] listening...
[20120402-21:29:39] [INFO ] scp thread on sck 7 started successfully
[20120402-21:29:39] [INFO ] granted TS access to user myname
[20120402-21:29:39] [INFO ] starting Xvnc session...
[20120402-21:29:40] [INFO ] starting xrdp-sessvc - xpid=11074 - wmpid=11073
[20120402-21:29:49] [INFO ] session 11072 - user myname- terminated

Process tree

Below is a part of ps aufx output during xrdp session:

xrdp     12344  0.0  0.4  22856  8732 ?        Sl   Apr02   0:01 /usr/sbin/xrdp
root     12346  0.0  0.0  15672  2000 ?        S    Apr02   0:00 /usr/sbin/xrdp-sesman
root     24346  0.0  0.0   3780   872 ?        S    00:00   0:00  \_ /usr/sbin/xrdp-sessvc 24348 24347
myname   24347  0.4  0.6  76468 13700 ?        Sl   00:00   0:14      \_ gnome-terminal
myname   24362  0.0  0.0   2220   716 ?        S    00:00   0:00      |   \_ gnome-pty-helper
myname   24363  0.0  0.2   6912  5268 pts/13   Ss   00:00   0:00      |   \_ bash
myname   27902  0.0  0.0   2824  1096 pts/13   R+   00:53   0:00      |       \_ ps aufx
myname   24348  0.0  0.9  24984 19216 ?        S    00:00   0:01      \_ Xvnc :18 -geometry 1920x1080 -depth 24 -rfbauth /home/myname/.vnc/sesman_myname_passwd -bs -ac -nolisten tcp
root     24349  0.0  0.0  16596  1304 ?        Sl   00:00   0:00      \_ xrdp-chansrv

Environment

  • Ubuntu 11.10 Oneiric
  • xrdp version: 0.5.0~20100303cvs-6ubuntu2

2 Answers 2

2

Check file ~/Xclients or /etc/X11/xinit/Xclients for a line similar to the following, for your desktop environment.

exec /usr/bin/gnome-session
# or
exec /usr/bin/startxfce

Make sure the file is executable, i.e. chmod +x.

My references include

0

So I see this is pretty old, but I have just run across a situation that matches your symptoms -- I had set up xrdp on a Debian 12 system, and when connecting, I could log in, but the user session would immediately close.

I did the same thing you did, adding echo-debug statements to /etc/xrdp/startwm.sh, and having them not appear.

The problem in my case turned out to be that the /etc/xrdp/startwm.sh script is executed with /bin/sh (it starts with #!/bin/sh), and it later sources /etc/profile and ~/.profile. On my system, /etc/profile had a number of bash-isms, so it turns out the script was bombing on what should have been a very benign source operation, and it was not getting to my echo-debug lines.

My solution was to change /etc/init.d/startwm.sh's hashbang to #!/bin/bash, after which things started to work.

I suppose the really-right solution is to audit the start-up files so that they are /bin/sh-compatible? I've searched, but not found documentation that says that's a requirement, so you could perhaps make a case that this is a bug in the Debian-packaged xrdp.

Note that other distros than Debian may not have this issue -- Debian switched the system default shell to "dash" a long time ago, so that the system default shell and the normal log-in shell are not the same. I think most Debian derivatives followed suit, but other distros may not have.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .