Error when installing and running XRDP (Remote Desktop) with Gnome Ubuntu: I encounter a Black Screen

31.5k Views Asked by At

I'm trying to connect to a remote desktop (Gnome Ubuntu) using XRDP (Remote Desktop Protocol). However, when I connect with either Apache's Guacamole or Microsofts Remote Desktop, I encounter a black screen with a cursor.

I can verify that my Ubuntu server is running healthily through logs as well as ssh'ing in and running a test (proxmox interface).

Interestingly, when I use xfce4 instead of gnome, I am able to connect. However, I can't get the terminal to work properly for some reason. If I am logged into gnome using the proxmox interface I can see the terminal popping up in my gnome session when I start it in my xfce xrdp session.

Possible issues:

Possible issues may include my startup/installation script:

# placeholder for script
4

There are 4 best solutions below

4
On

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             # display current xrdp service state
...
active
$ sudo systemctl enable xrdp           # start xrdp on system startup

3. Reboot system:

$ sudo reboot

4. Firewall configuration (optional):

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 startup
$ sudo systemctl disable xrdp          # disable xrdp on system startup
6
On

I got the same problem and after many tries I solved it by:

1) Removing xrdp

$sudo apt-get remove xrdp

2) Reinstall xrdp

$sudo apt-get install xrdp

3) Very Important Add this lines after install:

$echo gnome-session > ~/.xsession

$chmod +x ~/.xsession

0
On

I have found an alternative solution:

apt-get install x2goserver

This will install x2go, which is opensource remote desktop (RDP) server for Linux with x2goclient available both for Linux and Windows.

But I personally use chrome remote desktop. As the install was straightforward and I have never had any driver/config/software issues with it so far.

2
On

This worked perfectly for me in Ubutu 20.04.1 LTS

echo gnome-session > ~/.xsession
chmod +x ~/.xsession
sudo reboot