Install and Configure XRDP on Debian 12 Bookworm

In this guide, we will show you to Install and Configure XRDP on Debian 12 Bookworm. XRDP is an open-source Microsoft Remote Desktop Protocol server. You can use XRDP to log in to your remote machine in a graphical interface. In this guide, we will use the Xfce desktop environment which is the default DE on Debian 12, and then install XRDP.

How To Install and Configure XRDP on Debian 12 Bookworm?

To complete this guide, you must have access to your server as a non-root user with sudo privileges and set up a basic firewall. To do this, you can follow this guide on Initial Server Setup with Debian 12 Bookworm.

Now follow the steps below to complete this guide.

Step 1 – Install Xfce Desktop Environment on Debian 12

Debian 12 ships with the Xfce 4. Here we use Xfce DE. Run the system update and install Xfce and its packages by using the commands below:

# sudo apt update
# sudo apt install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils
 -y

This will take some time to complete.

When your installation is completed, reboot your server:

sudo systemctl reboot

Step 2 – Install XRDP on Debian 12 Bookworm

The XRDP packages are available on the default Debian 12 repository. You can install it with the following command:

sudo apt install xrdp -y 

XRDP must be activated during the installation. Verify that the XRDP is active and running on Debian 12 with the following command:

sudo systemctl status xrdp 
Output
● xrdp.service - xrdp daemon
     Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; preset: enabled)
     Active: active (running) since Sat 2023-06-17 07:01:37 EDT; 25s ago
       Docs: man:xrdp(8)
             man:xrdp.ini(5)
    Process: 1275 ExecStartPre=/bin/sh /usr/share/xrdp/socksetup (code=exited, >
    Process: 1283 ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS (code=exited, status=0>
   Main PID: 1284 (xrdp)
      Tasks: 1 (limit: 4631)
     Memory: 992.0K
        CPU: 29ms
     CGroup: /system.slice/xrdp.service

Note: The installation process creates a user named xrdp in your system. The XRDP sessions use a certificate key file “/etc/ssl/private/ssl-cert-snakeoil.key”. This key file is owned by root and the group owner is “ssl-cert

So you need to allow xrdp users to access this key file. To do this, add the xrdp user to the “ssl-cert” group with the following command:

sudo adduser xrdp ssl-cert
Output
Adding user `xrdp' to group `ssl-cert' ...
Adding user xrdp to group ssl-cert
Done.

When you have XRDP active and running on Debian 12, let’s start to configure it.

Step 3 – Where is XRDP Configuration File?

For basic Xrdp connections, you do not need to make any changes to the configuration files. Xrdp will use the default X Window desktop, which in this case, is XFCE.

The main configuration file is named xrdp.ini. This file allows you to set global configuration settings such as security and listening addresses and create different xrdp login sessions.

Whenever you make any changes to the configuration file you need to restart the Xrdp service on Debian 12:

sudo systemctl restart xrdp

Xrdp uses startwm.sh file to launch the X session. To use another X Window desktop, edit this file.

Step 4 – Configure Firewall for XRDP on Debian 12

At this point, you need to adjust the firewall to access the XRDP on Debian 12. The Xrdp listens on port 3389.

You can use the following command to open port 3389 for the LAN network:

sudo ufw allow from 192.168.1.0/24 to any port 3389 

Note: If you want to allow access from anywhere you can use the following command:

sudo ufw allow 3389

To apply the new rules reload the firewall with the following command:

sudo ufw reload 

Now you can access the xrdp on Debian 12.

Step 5 – Access Debian 12 XRDP Remote Desktop

On your Windows client, open the RDP client and enter the IP address of the Debian system.

You can launch the RDP client by typing the “mstsc” in the Run window or command line.

RDP client

Then, enter the IP address of the Debian system.

Debian 12 XRDP

It will ask for a warning message that the remote system is unknown to your system.

Click the “Don’t ask me again for connection to this computer” and click Yes to continue.

remote connection to Debian 12

Now enter the login credentials of the remote Debian system to get remote desktop access:

Debian 12 login credentials

When you have logged in you will see your Debian 12 in a graphical interface:

Install and Configure XRDP on Debian 12 Bookworm xrdp deb5

You can now start interacting with the remote XFCE desktop from your local machine using your keyboard and mouse.

Note: 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.

Conclusion

At this point, you have learned to Install and Configure XRDP by using the Xfce Desktop Environment on Debian 12 Bookworm. Also, you have learned to access your remote machine from a Windows client.

Hope you enjoy it. You may be like these articles on the Orcacore website:

Install and Configure XRDP on AlmaLinux 9

Install and Configure XRDP on Ubuntu 22.04

How To Install XRDP on Centos 7

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!