28

I installed Ubuntu 20.04 and then installed xrdp. Whenever i tried to connect, either from another Ubuntu 20.04 box using either xfreerdp or krdc, or from a Mac, a black screen would show up, and then immediately disconnect. i made sure i did not have any other sessions on the server going on at the same time.

After a while, i gave up and tried the script at: https://www.c-nergy.be/products.html it didn't make a difference

this is the only output from /var/log/xrdp.log

[20200529-18:17:16] [INFO ] Socket 12: AF_INET6 connection received from ::ffff:192.168.0.216 port 45006 
[20200529-18:17:16] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:192.168.0.199 port 3389) 
[20200529-18:17:16] [DEBUG] Closed socket 11 (AF_INET6 :: port 3389) 
[20200529-18:17:16] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem 
[20200529-18:17:16] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem 
[20200529-18:17:16] [DEBUG] TLSv1.3 enabled 
[20200529-18:17:16] [DEBUG] TLSv1.2 enabled 
[20200529-18:17:16] [DEBUG] Security layer: requested 3, selected 1 
[20200529-18:17:16] [INFO ] connected client computer name: coruscant 
[20200529-18:17:16] [INFO ] adding channel item name cliprdr chan_id 1004 flags 0xc0a00000 
[20200529-18:17:16] [INFO ] TLS connection established from ::ffff:192.168.0.216 port 45006: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 
[20200529-18:17:16] [DEBUG] xrdp_00000506_wm_login_mode_event_00000001 
[20200529-18:17:16] [INFO ] Loading keymap file /etc/xrdp/km-00000409.ini 
[20200529-18:17:16] [WARN ] local keymap file for 0x00000409 found and doesn't match built in keymap, using local keymap file 
[20200529-18:17:17] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:192.168.0.199 port 3389) 
[20200529-18:17:17] [DEBUG] xrdp_mm_module_cleanup

thank you very much

9 Answers9

24

I was able to solve this issue by logging out of the desktop session for the machine before trying RDP.

12

I'd faced the same issue in my local server Ubuntu 20.04 (Installed xubuntu-desktop) and I had fixed it by executing the following command.

# echo "startxfce4" > ~/.Xsession
# chmod +x ~/.Xsession
# sudo systemctl restart xrdp.service

If you get a Warning Message [Authentication is required to create a color managed device] while connecting to the Ubuntu server through Xrdp, you need to execute the following commands to ignore it:

# cd /usr/share/polkit-1/actions/

vi org.freedesktop.color.policy

Modify <allow_any> settings from auth_admin to yes.

<defaults> <allow_any>yes</allow_any> <allow_inactive>no</allow_inactive> <allow_active>yes</allow_active> </defaults>

reboot the system

g_uint
  • 103
10

It seems to be possible to allow multiple sessions so that you don't have to logout or end up in the blackscreen. Worked on my 20.04 LTS just by adding two lines into the startwm.sh.

nano /etc/xrdp/startwm.sh

Add in the very top:

unset DBUS_SESSION_BUS_ADDRESS
unset XDG_RUNTIME_DIR

then:

sudo systemctl restart xrdp

Credits to Peter Bennett @catch22cats, thanks!

MIT
  • 103
LP0
  • 151
5

After many tries and some fixes I was able to rdp but:

  1. Password was requested way to many times
  2. Side bar didn't fill up the whole screen

So I found this xRDP installation script that works perfectly! Credits to Griffon!!

Just download, unzip and run:

wget https://www.c-nergy.be/downloads/xrdp-installer-1.2.2.zip
unzip xrdp-installer-1.2.2.zip 
bash xrdp-installer-1.2.2.sh
LP0
  • 151
4

1. Remove previously installed xrdp:

$ sudo systemctl disable xrdp
$ sudo systemctl stop xrdp

$ sudo apt purge xrdp $ sudo apt purge xserver-xorg-core $ sudo apt purge xserver-xorg-input-all $ sudo apt purge xorgxrdp

2. Re-install xrdp & required packages:

$ sudo apt install xrdp
$ sudo apt install xserver-xorg-core
$ sudo apt install xserver-xorg-input-all
$ sudo apt install xorgxrdp

You also need to grant access to the /etc/ssl/private/ssl-cert-snakeoil.key file for xrdp user. It is available to members of the ssl-cert group by default.

$ sudo adduser xrdp ssl-cert           # add xrdp into ssl-cert group
$ sudo systemctl start xrdp            # start xrdp service
$ systemctl is-active xrdp             # check xrdp state
...
active
$ sudo systemctl enable xrdp           # start xrdp on system start

3. Reboot system:

$ sudo reboot

4. Firewall configuration:

You need to open access on port 3389.

$ sudo ufw allow 3389

It is more secure to open it only for your IP address or network. For example:

$ sudo ufw allow from 10.5.5.0/24 to any port 3389

The best practice is to use an SSH tunnel to connect to the remote desktop and make xRDP listen only for local connections.

5. Setup your RDP-client

Please note that in some cases the user who will connect to xRDP must log out before doing so!

  • Connect to your server using any RDP client.
  • Enter the user credentials of your Ubuntu computer.
  • Now you can see the remote desktop initial screen.

Related commands:

$ sudo systemctl status xrdp           # display current xrdp status

$ sudo systemctl start xrdp # start xrdp service $ sudo systemctl stop xrdp # stop xrdp service $ sudo systemctl restart xrdp # restart xrdp service

$ sudo systemctl enable xrdp # enable xrdp on system start $ sudo systemctl disable xrdp # disable xrdp on system start

Ukr
  • 141
0

This is a big problem to many useres. I found out an error on my systems. I am using 2 Odroid C2 computers. I had the same issues. I installed from scratch and everything was ok. Then i did something not related to Remotedesktop and after that i could not log anymore. The last time i had the system working fine and i changed the IP adress from xxx.xxx.xxx.094 to xxx.xxx.xxx.096 I could not log in via Remotedesktop. I had the second system running good, so i startet to compare files in my case the /etc/xrdp/startwm.sh had a complete different content. It looked like it was copied over with a different text. Unfortunetly i got not further in it. I restored this file and now it is working fine again. There are so many tips for this problem, so just check that file.

Deali
  • 11
0

Install Xrdp Server again.

root@ubuntu:~# apt -y install xrdp tigervnc-standalone-server

Start Xrdp Server.

root@ubuntu:~# systemctl enable xrdp

Connect from other clients.

0

My simple solution. This works for me since Ubuntu 18.X. The answer to this funny thing maybe simpler than you think.

It is a password complexity and language problem. Around 2019-2020 the rules for password authentication for user accounts are pushed up. I think in Debian other than Ubuntu. But anyway the XORG stuff is pretty old and maintenance rare, it seems to me that leads into some issues and I assuming the following.

  1. XORG is Debian based. While processing the login to the guest
  2. XORG has no error handling for short and non complex passwords.
  3. XORG ignores the language of the host system.

This works for me.

  • 9 characters including numbers
  • And at least character of special characters i.e. !"§$%&/ etc. Since I changed my simple user password in ubuntu from: funnR301 to funnR301$ (this works for german keyboard layout. See hint below!) There were no more black screen issues!

There are some more traps for i.e. german users or other with non english keyboard layout. Because the Xorg authentication window always use the englisch layout. This leads to some restriction for your password because the most of the special characters (!"§&..) are at different positions on non englisch layout keyboards. Also Y and Z are reversed in german layouts.

Cheers

Hans
  • 1
  • 1
-3

Try to install xrdp package by using sudo instead of root user. This works perfectly fine & tested on MAC (Microsoft Remote Desktop) & Window 10.

Link: https://linuxconfig.org/ubuntu-20-04-remote-desktop-access-from-windows-10