Xrdp on Ubuntu 20.04
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: 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_cleanupthank you very much
18 Answers
I was able to solve this issue by logging out of the desktop session for the machine before trying RDP.
6I'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.serviceIf 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 4 After many tries and some fixes I was able to rdp but:
- Password was requested way to many times
- 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
unzip xrdp-installer-1.2.2.zip
bash xrdp-installer-1.2.2.sh 2 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.shAdd in the very top:
unset DBUS_SESSION_BUS_ADDRESS
unset XDG_RUNTIME_DIRthen:
sudo systemctl restart xrdpCredits to Peter Bennett @catch22cats, thanks!
31. 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 xorgxrdp2. 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 xorgxrdpYou 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 start3. Reboot system:
$ sudo reboot4. Firewall configuration:
You need to open access on port 3389.
$ sudo ufw allow 3389It 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 3389The 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 2 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.
1Install Xrdp Server again.
root@ubuntu:~# apt -y install xrdp tigervnc-standalone-server
Start Xrdp Server.
root@ubuntu:~# systemctl enable xrdp
Connect from other clients.
1Try to install xrdp package by using sudo instead of root user. This works perfectly fine & tested on MAC (Microsoft Remote Desktop) & Window 10.
Link:
1