news
Serverspace has added a new Rocky Linux OS
WB
November 26, 2019
Updated June 7, 2023

How to configure xRDP server on Ubuntu 18.04

Ubuntu

Using another OS?

Select the desired version or distribution.

This tutorial describes how to set up an xRDP server to connect to Ubuntu 18.04 with the lightweight graphical Xforce UI using the RDP protocol. This can be very handy when you need to connect to Linux operating systems with graphical interface from Windows using Remote Desktop.

What is xRDP?

xRDP is Microsoft's free and open-source implementation of RDP (Remote Desktop Protocol) which allows non-Microsoft Windows operating systems (such as Linux and BSD) to provide a fully functional RDP-compatible remote desktop.

Installation and Setup

Connect to your ubuntu server via SSH and perform a system update:

sudo apt-get update
sudo apt-get upgrade -y

Install and enable the xRDP utility:

sudo apt-get install xrdp
sudo systemctl enable xrdp
sudo systemctl restart xrdp
xrdp-service
Xrdp service running

Install the xfce environment:

sudo apt-get install xfce4 xfce4-terminal

Open RDP port to be able to connect remotely:

sudo ufw allow 3389/tcp

Reboot the xRDP server for the changes to take effect:

sudo /etc/init.d/xrdp restart

Connecting to an Ubuntu Server via RDP

If you don't know the IP address of the Ubuntu server, you can check it by entering the command:

ifconfig -a
ifconfig
ifconfig output

In our test case it is 10.0.0.2. To connect open the Windows Remote Desktop Connection (mstsc.exe). Enter the IP address of the server and click Connect:

rdp
RDP window

A security warning will appear. Click Yes:

rdp cert
RDP certificate warning

In the opened window, select Xorg as the session, enter the username and password for the user and click OK:
Attention: If you are connecting via xRDP, you need to specify a password and root user name. If you are connecting via SSH, you will need the key or password that was configured during the creation of the server in the cloud.

Xorg
Xrdp authentication window

This will connect to the xforce desktop.

xforce
Xforce desktop

If it shows a black screen when connecting to xrdp you need to go into the /etc/xrdp folder, and make changes to the startwm.sh file.

sudo nano /etc/xrdp/startwm.sh

We need to add:

unset DBUS_SESSION_BUS_ADDRESS

unset XDG_RUNTIME_DIR

Before the line:

test -x /etc/X11/Xsession && exec /etc/X11/Xsession

srartwm.sh
startwm.sh settings

After making the changes you have to restart the XRDP service:

sudo systemctl restart xrdp

Now you can run mstsc.exe again and connect to our ubuntu server.

Vote:
4 out of 5
Аverage rating : 4.4
Rated by: 18
1101 CT Amsterdam The Netherlands, Herikerbergweg 292
+31 20 262-58-98
700 300
ITGLOBAL.COM NL
700 300
We use cookies to make your experience on the Serverspace better. By continuing to browse our website, you agree to our
Use of Cookies and Privacy Policy.