I am facing an issue with XRDP where in the session immediately terminates after entering the correct username password. I have seen so many occurences of the issue on the forum but none of the solutions have helped. Can you please suggest some next steps?

Here's the xrdp.log

[20210116-16:01:40] [INFO ] Socket 12: AF_INET6 connection received from ::ffff: port 54568
[20210116-16:01:40] [DEBUG] Closed socket 12 (AF_INET6 ::ffff: port 3389)
[20210116-16:01:40] [DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
[20210116-16:01:40] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20210116-16:01:40] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20210116-16:01:40] [DEBUG] TLSv1.3 enabled
[20210116-16:01:40] [DEBUG] TLSv1.2 enabled
[20210116-16:01:40] [DEBUG] Security layer: requested 11, selected 1
[20210116-16:01:50] [INFO ] connected client computer name: abhsha-m-23zs
[20210116-16:01:50] [INFO ] adding channel item name rdpdr chan_id 1004 flags 0x80800000
[20210116-16:01:50] [INFO ] adding channel item name rdpsnd chan_id 1005 flags 0xc0000000
[20210116-16:01:50] [INFO ] adding channel item name cliprdr chan_id 1006 flags 0xc0a00000
[20210116-16:01:50] [INFO ] adding channel item name drdynvc chan_id 1007 flags 0xc0800000
[20210116-16:01:50] [INFO ] TLS connection established from ::ffff: port 54568: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384
[20210116-16:01:50] [DEBUG] xrdp_000005c9_wm_login_mode_event_00000001
[20210116-16:01:50] [INFO ] Cannot find keymap file /etc/xrdp/km-00000000.ini
[20210116-16:01:50] [INFO ] Cannot find keymap file /etc/xrdp/km-00000000.ini
[20210116-16:01:50] [INFO ] Loading keymap file /etc/xrdp/km-00000409.ini
[20210116-16:01:50] [WARN ] local keymap file for 0x00000000 found and doesn't match built in keymap, using local keymap file
[20210116-16:01:50] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip port 3350
[20210116-16:01:50] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20210116-16:01:50] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
[20210116-16:01:50] [DEBUG] return value from xrdp_mm_connect 0
[20210116-16:01:50] [INFO ] xrdp_wm_log_msg: login successful for display 10
[20210116-16:01:50] [DEBUG] xrdp_wm_log_msg: started connecting
[20210116-16:01:50] [INFO ] lib_mod_log_peer: xrdp_pid=1481 connected to X11rdp_pid=1484 X11rdp_uid=1000 X11rdp_gid=1000 client_ip=::ffff: client_port=54568
[20210116-16:01:50] [DEBUG] xrdp_wm_log_msg: connected ok
[20210116-16:01:50] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
[20210116-16:01:50] [DEBUG] Closed socket 18 (AF_INET6 ::1 port 41282)
[20210116-16:01:51] [DEBUG] Closed socket 12 (AF_INET6 ::ffff: port 3389)
[20210116-16:01:51] [DEBUG] xrdp_mm_module_cleanup
[20210116-16:01:51] [DEBUG] Closed socket 19 (AF_UNIX)
[20210116-16:01:51] [DEBUG] Closed socket 20 (AF_UNIX)

here's the xrdp-sesman.log

[20210116-16:01:50] [INFO ] A connection received from ::1 port 41282
[20210116-16:01:50] [INFO ] ++ created session (access granted): username kali, ip ::ffff: - socket: 12
[20210116-16:01:50] [INFO ] starting Xorg session...
[20210116-16:01:50] [DEBUG] Closed socket 9 (AF_INET6 :: port 5910)
[20210116-16:01:50] [DEBUG] Closed socket 9 (AF_INET6 :: port 6010)
[20210116-16:01:50] [DEBUG] Closed socket 9 (AF_INET6 :: port 6210)
[20210116-16:01:50] [DEBUG] Closed socket 8 (AF_INET6 ::1 port 3350)
[20210116-16:01:50] [INFO ] calling auth_start_session from pid 1482
[20210116-16:01:50] [DEBUG] Closed socket 7 (AF_INET6 ::1 port 3350)
[20210116-16:01:50] [DEBUG] Closed socket 8 (AF_INET6 ::1 port 3350)
[20210116-16:01:50] [INFO ] /usr/lib/xorg/Xorg :10 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log
[20210116-16:01:50] [CORE ] waiting for window manager (pid 1483) to exit
[20210116-16:01:51] [CORE ] window manager (pid 1483) did exit, cleaning up session
[20210116-16:01:51] [INFO ] calling auth_stop_session and auth_end from pid 1482
[20210116-16:01:51] [DEBUG] cleanup_sockets:
[20210116-16:01:51] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdp_chansrv_audio_out_socket_10
[20210116-16:01:51] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdp_chansrv_audio_in_socket_10
[20210116-16:01:51] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdpapi_10
[20210116-16:01:51] [INFO ] ++ terminated session:  username kali, display :10.0, session_pid 1482, ip ::ffff: - socket: 12

I have tried the following:

  • Firewall allows for port 3389
  • I have added the following -> xfce4-session on /etc/.xsession
  • I had also tried to comment out the following lines on startwm.sh
test -x /etc/X11/Xsession && exec /etc/X11/Xsession
exec /bin/sh /etc/X11/Xsession
  • Installed tigervnc packages
  • Ran sudo adduser xrdp ssl-cert
  • Restarted the services at ever step

Despite all of this, I can't get XRDP to work.


3 Answers 3


Based on your description of the problem, this could be due to the fact that you are already logged in into your Ubuntu and you are trying to use the same user account to make your remote desktop connection.

It's not possible (with xRDP software) to use the same user account and login at the same time on Ubuntu locally and perform a remote connection...

To assess if this could be the problem, please ensure that the user account performing the remote connection is not logged already on your Ubuntu machine....

Hope this helps Till next time See ya

  • I was looking for a way to get this out... ie, work in the local machine, letting others login with the same login credentials in xRDP. Is there a way out ? I am using ubuntu 20.04
    – maan81
    Aug 29, 2021 at 11:50
  • edit: I found the link which appears ok.. c-nergy.be/blog/?p=16698 -- the 2nd option. What do you say ?
    – maan81
    Aug 29, 2021 at 12:50
  • Hello, probably the third option would be the best at this stage...it seems that there might be a better way but we still needs to test and investigate to see if this is the ase
    – Griffon
    Sep 15, 2021 at 17:04
  • This was the problem, thanks. Jan 18, 2022 at 17:39
  • excellent answer. save me hours
    – akokani
    Nov 11 at 17:50

For future reference, I had the same issue, and without diving too deep into why it was happening I simply installed another desktop environment (xfce4) and it worked fine. It seems to be a problem with GNOME.

To install:

sudo apt install xfce4

and then to switch to it:

sudo update-alternatives --config x-session-manager 

I had the same issue, but I'm running Ubuntu 18.04 LTS on an old mid-2009 MacBook Pro, and I had gone into Software & Updates, Additional Drivers tab, and changed the default graphics driver from X.Org X server to the proprietary NVIDIA binary driver. Once I changed it back to the more vanilla X.Org X server, it allowed me to login via XRDP without disconnecting me afterwards.


You must log in to answer this question.

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