News
Faster Speeds: Bandwidth for vStack Servers in Kazakhstan Increased to 200 Mbps
WB
November 26 2019
Updated June 27 2025

How to Set Up xRDP on Ubuntu 18.04 with Xfce for Remote Desktop Access from Windows

Ubuntu

Using another OS?

Select the desired version or distribution.

This tutorial explains how to set up an xRDP server on Ubuntu 18.04 using the lightweight Xfce desktop environment, allowing remote access from Windows via the RDP protocol. It’s a practical solution for anyone who needs to connect to a Linux system with a graphical interface 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.

FAQ: What should I do if I see a black screen after connecting via xRDP?

A black screen on connection usually means the desktop environment isn't launching properly. To fix this, edit the startwm.sh file located in /etc/xrdp/ by adding the following lines before the exec call:

unset DBUS_SESSION_BUS_ADDRESS
unset XDG_RUNTIME_DIR

These lines help ensure proper environment variables are set when starting the session. After making changes, restart the xRDP service:

sudo systemctl restart xrdp

This should resolve the black screen issue and allow you to load the Xfce desktop environment successfully.

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

You might also like...

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.