Xrdp is an open-source implementation of the Microsoft Remote Desktop Protocol (RDP) that allows you to graphically control a remote system.
With RDP, you can log in to a Raspberry Pi box from another computer running Windows, Linux or macOS, and create a real desktop session the same as if you had logged in to a local computer. The Pi and the client machine have to be connected to the same network or to the Internet.
This tutorial explains how to install and configure Xrdp server on Raspberry Pi 3 and 4.
We’re assuming that you have Raspbian installed on your Raspberry Pi.
Raspbian Buster comes in several different flavors. If you have Raspbian Lite, which does not have GUI, you’ll need to install a desktop environment that will act as a backend for Xrdp. Otherwise, skip this section.
There are several desktop environments (DE) available in Rabsbian repositories. We’ll be installing Pixel, which is the default desktop environment on Raspbian Desktop images. It is a fast, stable, and lightweight desktop environment, which makes it ideal for usage on a remote server.
Login to your Pi and run the following commands to install Pixel desktop:
sudo apt update
sudo apt-get install raspberrypi-ui-mods xinit xserver-xorg
Depending on your system, downloading and installing Pixel packages may take some time.
Once done, reboot the system for the changes to take effect:
Xrdp package is available in the default Raspbian Buster repositories. To install it, type:
sudo apt install xrdp
When the installation process is complete, the Xrdp service will automatically start. You can verify that Xrdp is running by typing:
systemctl show -p SubState --value xrdp
The command will print “running”.
By default Xrdp uses the
/etc/ssl/private/ssl-cert-snakeoil.key file which is readable only by users that are members of the “ssl-cert” group. You’ll need to add the user that runs the Xrdp server to the
Execute the following command to add the user to the group:
sudo adduser xrdp ssl-cert
That’s it. Xrdp has been installed on your Pi.
Connecting to Raspberry Pi
Now that you have set up the Xrdp server, it is time to open your Xrdp client and connect to the Pi.
If you are a Windows user, you can connect to your Pi using the default RDP client. Type “remote” in the Windows search bar and click on “Remote Desktop Connection”. This will open up the RDP client. In the computer field, enter the Raspberry Pi IP address and click “Connect”.
On the login screen, enter your Raspberry Pi username and password and click “OK”.
Once logged in, you should see the default Pixel desktop. It will look something like this:
From here, you start interacting with the remote Raspberry Pi desktop from your local machine using your keyboard and mouse.
If you are using macOS, you can install the Microsoft Remote Desktop application from the Mac App Store. Linux users can use an RDP client such as Remmina or Vinagre.
Installing an Xrdp server allows you to manage your Raspberry Pi server from your local desktop machine using an easy to use graphic interface.
If you have questions, feel free to leave a comment below.