Debian

How to Install and Use XRDP Server On Debian 12

Connecting to any of the systems remotely and carrying out necessary tasks on that system can be pretty helpful when it comes to either system monitoring or fixing any bug in the system. Microsoft has developed a remote desktop protocol that is preinstalled on the Windows operating system. However, now operating systems other than Windows like Debian can also be accessed remotely using XRDP which is a similar implementation of Windows remote desktop protocol.

Outline:

How to Install XRDP Server On Debian 12

XRDP is an open-source tool that is designed for connecting the Windows operating system with Linux systems. To install XRDP on Debian there are a number are steps to be followed which include installing some prerequisites and configurations steps:

Step 1: Installing XFCE on Debian 12

To make Debian run smoothly when accessed remotely it is advisable to install a comparatively lightweight and customizable desktop environment as it will run more efficiently and will require fewer resources. So, to install XRDP on Debian 12 I have installed XFCE and some other utilities by executing:

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

Here, in the above command, xfce4 is the main package for the XFCE desktop environment. The

xfce4-goodies is a package that contains some extra plugins and themes for XFCE, such as a weather applet, a CPU monitor, and a dark theme. The xorg is the package that provides the X Window System, which is the graphical interface for Linux systems and dbus-x11 is a package that provides the D-Bus message bus system, which is used for communication between applications and the desktop environment. The x11-xserver-utils is a package that contains some utilities for the X server, such as xrandr, xset, and xprop.

Step 2: Install XDRP

Once you have installed the XFCE environment reboot the system and afterward install the XRDP using the default package manager by executing:

sudo apt install xrdp -y

Once the remote desktop protocol is installed check its service status to confirm if it is active and for that execute:

sudo systemctl status xrdp

If by any means it is not up and running then first enable it and then start it by executing the following commands:

systemctl enable xrdp

systemctl start xrdp

Step 3: Create XRDP User

The ssl-cert is a group that is responsible for protecting the secure socket layers as these keys are used to establish communication between the client and the server. So, it is necessary to add XRDP to this ssl-cert group and for that just execute:

sudo adduser xrdp ssl-cert

Once the user is added successfully, now restart the remote desktop protocol to apply the changes and for the systemtcl restart command:

sudo systemctl restart xrdp

Configuring XRDP on Debian 12

Now to activate XFCE environment upon receiving a remote desktop connection is necessary to disable the X session that is the default. So, for that open up the starttwm.sh file and comment these two lines of code given below:

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

<strong>exec /bin/sh /etc/X11/Xsession

Once you have commented the desired line of code then add the command for starting the XFCE environment:

startxfce4

After you are done with changes then just save the file and close it, afterward restart the XRDP to apply the changes using the restart command:

sudo systemctl restart xrdp

The 3389 is the default port through which the remote desktop protocol can communicate between the client and other devices, allowing it through the firewall means that the client can interact with any remote server. So, to allow it through the firewall you must have first installed it:

sudo ufw allow 3389/tcp

Once you have added the port in the firewall check the status of the firewall and if the rule is not present then just reload the firewall to apply the changes by executing:

sudo ufw reload

Accessing Debian 12 Remotely From Windows

Once you are completed with installing and configuring the XRDP now it is time to access the Debian system remotely from the Windows operations system. There are two ways to gain access to the Debian system remotely.

Access Debian 12 From Windows using XRDP

From the Windows system open up the RDP enter the IP address or computer name along with the username and click on Connect:

Once you click on connect the XRDP window will open and then just enter the password of the account that is used for its login and then click on connect:

After the credential verification and establishment of the connection between the host and the target system, a window will open displaying the desktop of Debian 12:

Alternative Method

Another way to access Debian 12 remotely is by turning on the remote Desktop feature in Debian 12, you can use this method if you are unable to remotely access Debian 12 using XRDP. Usually, if the remote desktop is not enabled by default and while connecting, you may get errors like this:

As in the image above the first reason states that remote access is not enabled on the computer that is being accessed so in that case it means that remote access is not enabled. For that navigate to Debian 12 settings and from there go to settings related to sharing and click on Remote Desktop:

 

Once you are in remote desktop settings, turn it on and afterward note down the username and the password that is given to access the system remotely:

Now after you have entered the computer name and the username you will get this pop-up once you click on the connect option in the Windows remote desktop application, here just enter the same password that was given in Debian sharing settings and click ok:

Once the connection is successful, you will have remote access to Debian 12:

Accessing Debian 12 on Windows can make your system a little bit laggy so in that case you can make some tweaks by clicking on the display tab on the Remote Desktop Connection application. From here you can choose the size of the display along with the color quality.

Connecting any System Remotely Using XRDP on Debian 12

Using the XRDP cannot only be used to access the Linux system, but it can also be used to access any other system from Debian. So, in that case you will need a remote desktop viewer along with XRDP, the remote desktop viewer is not installed by default, but you can install it from a software application in Debian 12. To remotely connect to another computer, you first need to know about the host’s internet protocol address so for that execute:

ip a

Once you have got the Debian IP address launch the Remote Desktop Viewer from the applications menu:

Now just click on connect and then first select the protocol that will be RDP and then enter the IP address of the host. Afterward, enter the username of the system that you want to access adjust the dimensions of the screen, and click on Connect:

Now just click on Connect on the prompt about the certificate verification to continue the process of accessing the computer remotely:

Now the XRDP window will open, just enter the username and password of the computer you want to access remotely and then click on connect:

Removing XRDP from Debian 12

To remove XRDP completely from Debian 12 then execute:

sudo apt remove --autoemove xrdp -y

Conclusion

To install XRDP on Debian 12 first install a lightweight and efficient desktop environment and then use the advanced packaging tool to install XRDP. Afterward, configure XRDP in Debian by allowing access to 3389 port from the firewall and then use the remote desktop viewer to access any other system remotely. To access your system remotely from Windows, open up the Remote Desktop Connection application installed on it, and from there enter the login details of your Debian system in XRDP window after entering your IP address.

 

Similar Posts