11

I've installed mate and xrdp on Ubuntu 18.04. Now I try to connect to this PC from another Ubuntu with Remmina:

enter image description here

I press OK, login window disappears background is same,nothing happens. My ~/.xsession contains mate-session.

xrdp.log contains stuff like this:

[20190818-12:23:09] [DEBUG] Closed socket 17 (AF_UNIX)
[20190818-12:23:12] [DEBUG] Closed socket 17 (AF_UNIX)
[20190818-12:23:15] [DEBUG] xrdp_wm_log_msg: connection problem, giving up
[20190818-12:23:15] [DEBUG] Closed socket 17 (AF_UNIX)
[20190818-12:23:15] [DEBUG] xrdp_wm_log_msg: some problem
[20190818-12:23:15] [DEBUG] xrdp_mm_module_cleanup
[20190818-12:23:15] [DEBUG] Closed socket 16 (AF_INET6 ::1 port 59402)
[20190818-12:24:11] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
[20190818-12:24:11] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20190818-12:24:11] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
[20190818-12:24:11] [DEBUG] return value from xrdp_mm_connect 0
[20190818-12:24:12] [INFO ] xrdp_wm_log_msg: login successful for display 10
[20190818-12:24:12] [DEBUG] xrdp_wm_log_msg: started connecting
[20190818-12:24:15] [DEBUG] Closed socket 17 (AF_UNIX)
[20190818-12:24:19] [DEBUG] Closed socket 17 (AF_UNIX)
[20190818-12:24:22] [DEBUG] Closed socket 17 (AF_UNIX)
[20190818-12:24:26] [DEBUG] Closed socket 17 (AF_UNIX)
[20190818-12:24:29] [DEBUG] Closed socket 17 (AF_UNIX)
[20190818-12:24:33] [DEBUG] Closed socket 17 (AF_UNIX)
[20190818-12:24:36] [DEBUG] Closed socket 17 (AF_UNIX)
[20190818-12:30:30] [INFO ] calling auth_start_session from pid 6502
[20190818-12:30:30] [DEBUG] Closed socket 7 (AF_INET6 ::1 port 3350)
[20190818-12:30:30] [DEBUG] Closed socket 8 (AF_INET6 ::1 port 3350)
[20190818-12:30:30] [INFO ] /usr/lib/xorg/Xorg :10 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log  
[20190818-12:30:40] [ERROR] X server for display 10 startup timeout
[20190818-12:30:40] [CORE ] waiting for window manager (pid 6503) to exit
[20190818-12:30:40] [ERROR] X server for display 10 startup timeout
[20190818-12:30:40] [ERROR] another Xserver might already be active on display 10 - see log
[20190818-12:30:40] [DEBUG] aborting connection...
[20190818-12:30:40] [CORE ] window manager (pid 6503) did exit, cleaning up session
[20190818-12:30:40] [INFO ] calling auth_stop_session and auth_end from pid 6502
[20190818-12:30:40] [DEBUG] cleanup_sockets:
[20190818-12:30:40] [DEBUG] cleanup_sockets: deleting /var/run/xrdp/sockdir/xrdp_chansrv_socket_10
[20190818-12:30:40] [DEBUG] cleanup_sockets: deleting /var/run/xrdp/sockdir/xrdpapi_10
[20190818-12:30:40] [DEBUG] cleanup_sockets: failed to delete /var/run/xrdp/sockdir/xrdpapi_10
[20190818-12:30:40] [INFO ] ++ terminated session:  username someuser, display :10.0, session_pid 6502, ip ::ffff:192.115.120.210:44136 - socket: 12

How do I fix or diagnose this brilliant piece of software?

2

4 Answers 4

11

You do not specify exactly which version of Ubuntu 18.04 you are running. If you have doe all the updates, you should be running Ubuntu 18.04.3.... You can check this by running the following command:

lsb_release -sd

If you are running Ubuntu 18.04.3, there is a known issue with xrdp package provided by Canonical. The xrdp package cannot install the xorgxrdp package because of failed dependencies. This is why you cannot connect remotely to your Ubuntu.

Best option - Install the new xorgxrdp-hwe-18.04 package

Install the new xorgxrdp package by issuing the following command:

sudo apt-get install xorgxrdp-hwe-18.04

This should fix your issue .

Dirty Quick Fix - Downgrade the xorgxserver package

We assume that you have already installed xRDP package and you want to fix it

sudo apt-get install xserver-xorg-core
sudo apt-get -y install xserver-xorg-input-all

More info on http://c-nergy.be/blog/?p=13390.

Better fix - use unofficial xrdp packages working with Ubuntu 18.04.3

Note: To use this option, please remove the xrdp package you have installed

sudo add-apt-repository ppa:martinx/xrdp-hwe-18.04
sudo apt-get update
sudo apt-get install xrdp xorgxrdp

More info at http://c-nergy.be/blog/?p=13455.

Other option - use a script to perform the installation for you

Note: To use this option, please remove the xrdp package you have installed.

To use Ubuntu repository xrdp packages, read instructions and download the script at http://c-nergy.be/blog/?p=13933.

To compile from source (easy way), read instructions and download the script at http://c-nergy.be/blog/?p=13663.

2
  • After doing this, I'm seeing crashes... Ubuntu version: Ubuntu 18.04.5 LTS Aug 6, 2021 at 6:30
  • please provide more info about what you did ? have you used option 1, or scripted install. For scripted install, please always check for latest version of the script..the current latest version can be found at c-nergy.be/blog/?p=16817 Hope this help
    – Griffon
    Sep 15, 2021 at 17:07
9

I have found an alternative solution:

apt-get install x2goserver

This will install x2go, which is opensource remote desktop server for Linux with x2goclient available both for Linux and Windows. Please note this software is way better then xrdp, but is also buggy. To use it, install for example mate desktop instead of linux default, default doesn't work with it yet:

sudo apt install tasksel
sudo tasksel install ubuntu-mate-desktop

When you create a connection with this windows client, you will need to set MATE desktop here:

enter image description here

It can work with some other desktops, but for default Ubuntu -- I was unable to make it work.

It has some bugs, which I can tolerate:

  • You might have issues with multiple keyboard layouts, to walk around this, you have to connect when EN layout is enabled on Windows, later you can switch to your national keyboard.

  • Clipboard is buggy and suddenly stops working. You solve it by reconnect.

  • Sometimes randomly it has keyboard glitches, but this doesn't happen very often, I can easily tolerate this.

  • If you use high DPI fonts on Windows, you may need to set this option to avoid your fonts look too big:

enter image description here

  • If you need it to connect automatically you will need ssh key, it can't store password. System is a bit buggy in that aspect, but I've found reliable solution: you install https://cygwin.com/, generate (ssh-keygen) and deploy (ssh-copy-id myself@myserver) key and then specify key in the connection settings (see pic above).

  • Sometimes, super rarely Windows client EXEcutable might give you crazy system errors, I can't remember the error message. But this message is somehow connected with Windows binaries compatibility. Super unobvious solution is to ...reboot Windows once.

3
  • 1
    The xrdp status is so poor, that this answer should be advertised everywhere. I've lost a lot of hair chasing xrdp issues, when x2go just worked. It doesn't even show up on Google when searching related terms, what a shame.
    – Marcus
    Jan 3, 2020 at 22:11
  • Novice question: If I install x2go, should I uninstall what it is replacing xorg, xrdp, or xorgxrdp? I'm assuming its replacing these things. Jan 10, 2021 at 15:35
  • I am not sure. For x2go you will need mate desktop. Probably its good to remove this xorg/xrdp stuff.
    – stiv
    Jan 11, 2021 at 7:49
3

The following worked for me on 20.04 (I think it applies to 18.04 too):

In /etc/xrdp/startwm.sh change #!/bin/sh to #!/bin/bash

I found this fix in this comment. A few more details from that comment:

My issue was caused by custom scripts in /etc/profile.d with syntax that /bin/sh doesn't like (e.g. function function_name { some; commands; }).

This comment was from a known issue on the bug.

There was another comment there mentioning another fix that did not apply to my situation:

This post seemed to fix it for me: http://catch22cats.blogspot.com/2018/05/xrdp-blank-screen-with-ubuntu-1804.html

unset DBUS_SESSION_BUS_ADDRESS
unset XDG_RUNTIME_DIR
. $HOME/.profile

By adding the above lines just before the test and exec in /etc/xrdp/startwm.sh, I also added the #!/bin/bash to the top of the file - also doing a chmod after you've changed the file is what some users might be forgetting.

0

After trying a dozen different fixes that didn't work I found my issue was having no home directory for the user(s) attempting to RDP in.

From an unrelated post: https://askubuntu.com/a/392149/1570220

If the user has no home directory specified in /etc/passwd :

Run mkhomedir_helper to create the home directory. mkhomedir_helper will >create the user home directory and copy the stuff in /etc/skel as well.

If the user already has a home directory specified in /etc/passwd :

Such as via usermod -d /some/directory , mkhomedir_helper will not work. The only >way is to manually create the home directory for the affected user.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.