Updated April 4, 2023
Introduction to Linux XRDP
The following article provides an outline for Linux XRDP. XRDP is defined as an open-source implementation for the Desktop Protocol, also known as Microsoft Remote Desktop Protocol, enabling users to graphically control the remote system. Any user can log in to the remote machine, and after login, a real desktop session is created, which gives a feeling that one has logged into their own local machine or environment. XRDP protocol enables the operating system apart from Microsoft Windows to provide a seamless and fully functional RDP compatible remote desktop experience. The main principle of working with XRDP is bridging graphics from the X Windows system, and then the controls are relayed back from the client to the X windows system.
How does Linux XRDP work?
- We saw that XRDP is a version of RDP (Remote Desktop Protocol) that allows users in an operating system other than Windows to remotely connect to another computer. In the working of RDP, different types of network technologies are used for a successful and seamless interaction. In the process, different types of data are communicated securely over the network through multiple yet separate channels.
- Through port 3389 (by default) RDP protocol provides remote access to the users. Using the port, the application and service packages (which are RDP enabled) are transmitted, allowing the Microsoft communication service to direct the data to an RDP channel. The operating system then encrypts the RDP data, which allows it to get added to the frame for transmitting. Now it is the Terminal Service Device Redirector (TSDR) task to handle the RDP protocol activities.
- TSDR enables handling of user interfaces, transfers, compression, encryption and framing, and making itself responsible for packaging the protocol so that the transfer over TCP/IP network is allowed. In a similar way, the relay back also occurs, completing the entire circle of the process.
How to Use Linux XRDP?
In order to use Linux XRDP, one needs to have XRDP in the system. In the recent Linux distributions, it is often seen that XRDP comes as a package in the distribution itself. This XRDP, which is accompanied in the distribution, is generally the latest release of XRDP. Also, it one needs to also have xorgxrdp package for the best experience. Now let us look at the use of Linux XRDP.
1. Install XRDP
At first, we would need to perform a sudo apt-get update if the apt-get package is not in its latest version. The reason for performing a sudo is to have a superuser or admin access to perform the installation or updating process. Once the apt-get is in its latest version, we would need to perform sudo apt-get install xrdp. This command will enable finding the repository for XRDP and install the package in succession. Be watchful of the fact that the sudo command will ask for the admin password.
2. Install XFCE4
XFCE is a desktop environment which is lightweight for the UNIX operating systems. This environment is aimed at being fast but in other front low on system resource. Having all these qualities, it doesn’t stop it to be visually appealing.
3. Configuring the XRDP
Now that we have installed XFCE4, we would need to modify 2 files so as to be sure that XRDP uses xfce4. This xfce4 is the environment we installed in the previous step. It is preferable to use the nano command to make changes to the file .xsession, although a simple echo statement would also do the job. The next file which we need to change is the startup file for XRDP (startwm.sh). Necessary changes need to be made to start XFCE4.
4. Allow RDP port in Firewall
After the configuration mentioned above, we would need to allow the port in the firewall, which is by default closed by executing the command sudo ufw allow <port number>/tcp making sure to replace the <port number> with the actual port number.
5. Restarting XRDP
In order to make the changes effective, one would need to restart the xRDP by executing the command sudo service xrdp restart.
6. Testing the XRDP Connection
Now to test out the XRDP connect, one can run the standard remote desktop client, which comes with the Windows distribution. You would be then required to enter the IP address of the machine where XRDP is running. Depending on the capabilities of the RDP client, one might not see the login page, but in case one sees that, enter the ubuntu username and password and then press ok.
Advantages and Disadvantages
Given below are the advantages and disadvantages of Linux XRDP:
- Monitoring, control, and maintenance of the devices can be easily done through RDP.
- Enables quick troubleshooting using remote access.
- Access to files on the connected devices, servers, or network is easily possible.
- Enables lower cost of operation through the remote framework capability.
- In some instances, the clipboard is not synchronized and hence copy-paste between machine struggle to work perfectly.
- Network dependency happens to be a necessary evil in cases of XRDP.
- In some instances, depending on the host system’s resource power, bottlenecks might be caused, reducing the performance considerably.
- Some rare instances, though real ones, restrict the system to be available for use again till some vital fixes are not done.
There are a lot of features available for XRDP, majorly bucketed into 2 categories.
1. Remote Desktop Access
- Enabling connection to Linux Desktop form anywhere in the world. This connection would require xorgxrdp Xorg module.
- Any existing session can be reconnected.
- Resizing of the session is possible.
- Use of proxy of another server viz. RDP/VNC for connection (via xrdp).
2. Access to Remote Resources
- Transfer of clipboard is possible, and that too even two-way transfer. These clipboards can include text, bitmap or file.
- Redirection of audio is possible through the building of additional modules.
- Redirection of the drive is possible through mounting of client drives on the remote machine.
With the different aspects being touched upon by this article, we by now have a clear picture of XRDP and important aspects of the capability. As a further task, one should try out XRDP for remote connection purposes and encourage shared resource utility.
This is a guide to Linux XRDP. Here we discuss the introduction; how does Linux XRDP work? uses, advantages, disadvantages and features, respectively. You may also have a look at the following articles to learn more –