How to Install and Set Up xRDP on CentOS 7 for Remote Desktop Access
In this comprehensive guide, you’ll learn how to install and configure xRDP on a remote CentOS 7 server, enabling you to access it through a graphical Remote Desktop Connection (RDP) from a Windows or Linux machine. We’ll also walk you through setting up popular desktop environments — such as GNOME or XFCE — to ensure a smooth and user-friendly remote experience on your CentOS 7 system.
xRDP is a free, open-source Remote Desktop Protocol server that allows non-Windows operating systems to provide full-featured remote desktop capabilities.
xRDP is fully compatible with rdesktop, FreeRDP, and even with Microsoft Remote Desktop Client (mstsc.exe).
Requirements:
- Although this is not a requirement, we recommend acting as a non-root user when making any major changes to your system.
- A machine running CentOS 7 with at least 2 GB of RAM.
Update the packages installed on the system:
Then install the necessary packages:
If you are using FirewallD, open port 3389/TCP for RDP:
Set your preferred desktop environment
Now we can set the desktop environment that we will use. In this guide, we will try out Xfce, MATE, and GNOME.
Note: if you cannot connect via Remote Desktop Connection after installing the desktop environment, open port 3389/TCP using the firewall-cmd command mentioned above.
Install the XFCE Workspace
Xfce is one of the lightest desktop environments. It is fast, consumes little system resources, but remains visually attractive. Also, she has a very active community, so many customization options are available.
To install Xfce, run the following commands:
Then create the file.Xclients in the user directory with which the connection will be made:
Now you can connect to the server using Remote Desktop Connection. This is what Xfce looks like:
Xfce Removal
To remove Xfce from your CentOS 7, run the following commands:
Install MATE Desktop Environment
To install MATE, run the following commands:
Then create the file.Xclients in the directory of the user you are connecting to:
Now you can connect to the server using Remote Desktop Connection. This is what MATE looks like:
Removing the MATE
To remove MATE from CentOS 7, run the following commands:
Install GNOME Desktop Environment
Next, let’s install the GNOME 3 desktop environment. This requires installing the GNOME Desktop package group, which automatically pulls in all the essential components needed to enable a full graphical user interface on CentOS 7:
This could take some time. On the minimum configuration of the CentOS 7 distribution, about 1000 packages will be installed.
Launch the graphical interface
Although we installed the GNOME Desktop package group, the GUI will not load by default upon reboot. We can verify this by running:
Conclusions:
If the default value is multi-user.target, this means that the GUI will not load. Change the default value to graphical.target. To do this, run the following commands:
Conclusions:
Created symlink from /etc/systemd/system/default.target to usr / lib / systemd / system / graphical.target.
After that, run the following command to immediately switch to the graphical interface:
Now you can connect via xRDP to your CentOS 7 using GNOME.
This is what GNOME 3 looks like when you first connect after installation. Just follow the initial setup steps to complete the setup:
Note: If you used Xfce or MATE Desktop to connect to CentOS 7 before installing the GNOME Desktop graphical shell, run the following command:
Removing of GNOME
To remove GNOME from your CentOS 7, run the following commands:
Connect to a computer using Remote Desktop Connection
After installing xRDP and the desktop environment, you can connect from the local computer to the remote.
Connection from Windows
To connect to the server from Microsoft Windows, simply find and launch the Remote Desktop Connection application (mstsc.exe) and enter your hostname or IP:
If this is your first time connecting, you will receive several security warnings. Assuming this is your server and it is secure, just accept these warnings:
FAQ: xRDP Installation and Remote Desktop Setup on CentOS 7
- Q: What is xRDP, and how does it work on CentOS 7?
xRDP is an open-source implementation of the Microsoft RDP (Remote Desktop Protocol) server that enables you to connect to a Linux system using standard RDP clients like mstsc.exe from Windows. It bridges the Linux graphical interface with the RDP protocol for remote access. - Q: Which desktop environment should I choose — Xfce, MATE, or GNOME?
Xfce is the lightest and fastest, ideal for systems with limited resources. MATE offers a balance between performance and features, while GNOME provides a modern look but consumes more system resources. Choose based on your hardware and preferences. - Q: I installed the desktop environment, but RDP still doesn’t work. What should I check?
Make sure port 3389/TCP is open in your firewall and that the .Xclients file in your user's home directory correctly references the session type (e.g., xfce4-session, mate-session, or gnome-session). Also, restart the xrdp service after making changes. - Q: Is it safe to use xRDP over the internet?
By default, xRDP is not encrypted end-to-end. For secure access over public networks, consider tunneling RDP through SSH or setting up a VPN connection to the server. - Q: Can I switch between desktop environments after installation?
Yes, but you may need to edit or remove the .Xclients file in your home directory to change sessions. Also, removing previous environments helps prevent conflicts and saves system resources.