How to Enable XRDP for Remote Desktop Access on Raspberry Pi

How to Enable XRDP for Remote Desktop Access on Raspberry Pi

The Raspberry Pi is capable of running a complete operating system on a compact computer. A lesser-known feature is the ability to set up Remote Desktop Access using xrdp, allowing users to connect to their Raspberry Pi from a Windows device.

What is xrdp?

xrdp serves as an open-source adaptation of Microsoft’s Remote Desktop Protocol (RDP), facilitating connections to Linux systems much like remote desktop functionality in Windows. The xrdp architecture consists of two primary elements: the xrdp server installed on the Raspberry Pi and a Remote Desktop client on the device used for connection. Users on Windows often already have the necessary client software, while users on other operating systems can find various third-party clients. xrdp utilizes TLS (Transport Layer Security) encryption to safeguard your sessions, ensuring that mouse movements, file transfers, and clipboard activities remain protected. Although VNC (Virtual Network Computing) is another alternative available on Raspberry Pi OS, I have observed that using RDP generally yields a smoother experience with much less lag during activities like web browsing or system configuration.

Steps to Enable Remote Desktop Access with XRDP on Raspberry Pi

To configure Remote Desktop Access using xrdp on Raspberry Pi, follow the steps outlined below:

  1. Install xrdp on the Raspberry Pi
  2. Establish a remote desktop connection

Let’s delve into each step in detail.

1] Installing xrdp on Raspberry Pi

Start by powering on your Raspberry Pi and ensuring that it is fully updated. To accomplish this, open the Terminal and execute the following commands sequentially:

sudo apt update sudo apt upgrade

Once your Raspberry Pi is up-to-date, proceed to install xrdp with the command below:

sudo apt install xrdp

If you’re unfamiliar with Unix, you may encounter an error message stating that the “Username” is not part of the sudoers file.

To fix this, enter the terminal command su root and then edit the sudoers file by typing nano /etc/sudoers. Add user_name ALL=(ALL) ALL just below the line that allows members of the group sudo to execute commands, as shown in the provided screenshot.

Now that the xrdp server has been installed, there’s no need to alter its default settings, as it comes pre-configured for immediate use. However, you’ll need to create a user account for remote desktop access, since the default account will not suffice. Execute the following command in the terminal to set this up:

sudo adduser <USERNAME>

Note: Substitute <USERNAME> with your desired username.

Next, enter hostname -I to obtain and note the local IP address of your Raspberry Pi.

2] Establishing a remote desktop connection

With xrdp configured on your Raspberry Pi, it’s time to connect to it from your computer. If you’re using Windows, simply utilize the preinstalled Remote Desktop Connection app. If it’s not available, you can download Microsoft Remote Desktop from the Microsoft Store. Additionally, the Windows app is accessible on macOS, Android, and iOS devices for connecting to any RDP-compliant server.

To initiate the connection, launch the application, input the IP address of your Raspberry Pi, and click on Connect. This will locate the server and establish connection.

How to Utilize xrdp on Raspberry Pi?

Before you can use xrdp on your Raspberry Pi, you need to ensure it is installed on your device. Run sudo apt install xrdp, then retrieve the corresponding IP address necessary for remote connection. Once you have this information, simply connect to the machine using the Remote Desktop tool.

Leave a Reply

Your email address will not be published. Required fields are marked *