In this guide, we’ll show you how to install an RDP Server on CentOS 7 computer and how to connect to it through a remote desktop connection. We will install and configure an RDP server, set up different desktop environments (Xfce, MATE, and GNOME), and configure the default graphical interface.
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 for RDP Server on CentOS
Before proceeding, ensure that you have:
- A CentOS 7 system with root or sudo privileges.
- A stable internet connection.
- Firewall access to port 3389 (default RDP port).
Step 1: Update the System
Update your system packages to ensure all dependencies are up to date:
1 |
sudo yum update -y |
Step 2: Install Xrdp
Xrdp is an open-source implementation of the RDP server. Install it using:
1 2 |
sudo yum install epel-release -y sudo yum install xrdp -y |
Enable and start the xrdp service:
1 2 |
sudo systemctl enable xrdp sudo systemctl start xrdp |
Step 3: Install a Desktop Environment
CentOS 7 does not come with a pre-installed GUI. You can choose one of the following desktop environments:
Install Xfce
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:
1 |
sudo yum groupinstall "Xfce" -y |
Set Xfce as the default session for xrdp:
1 2 |
echo "xfce4-session" > ~/.Xclients chmod a+x ~/.Xclients |
Install MATE
To install MATE, run the following commands:
1 |
sudo yum groupinstall "MATE Desktop" -y |
Set MATE as the default session:
1 2 |
echo "mate-session" > ~/.Xclients chmod a+x ~/.Xclients |
Install GNOME
Now try installing GNOME 3. To do this, we need to install the GNOME Desktop package group, which will install all the packages necessary for installation with a graphical interface:
1 |
sudo yum groupinstall "GNOME DESKTOP" -y |
Set GNOME as the default session:
1 2 |
echo "gnome-session" > ~/.Xclients chmod +x ~/.Xclients |
Step 4: Configure Firewall
Allow RDP traffic through the firewall:
1 2 |
sudo firewall-cmd --permanent --add-port=3389/tcp sudo firewall-cmd --reload |
Step 5: Start and Enable Graphical Interface
Set the default graphical target to enable GUI at startup:
1 2 |
sudo systemctl set-default graphical.target sudo systemctl isolate graphical.target |
Step 6: Uninstall a Desktop Environment
To remove a specific desktop environment:
Uninstall Xfce
1 |
sudo yum groupremove "Xfce" -y |
Uninstall MATE
1 |
sudo yum groupremove "MATE Desktop" -y |
Uninstall GNOME
1 |
sudo yum groupremove "GNOME Desktop" -y |
Step 7: Connect to the RDP Server
Connect from Windows
To connect to your server from Microsoft Windows, just search and launch the Remote Desktop Connection application and input your hostname or IP. If this is your first time connecting, then you’ll receive some security warnings. Assuming this is your server and it is secure then just go ahead and confirm them.
Connect from Linux
To connect from a Linux machine, a great option for using remote desktop connection is Remmina. Remmina is a wonderful free and open-source remote desktop client that supports Remote Desktop Protocol, VNC, NX, XDMCP, SPICE and SSH protocols.
Connect from OSX
To connect from your Mac, you’ll first have to download the Microsoft Remote Desktop App from the App Store. After launching the app for the first time, you’ll first want to create a new connection. To do this click on the + in the top left corner of the app window. The essential information you need here is for PC Name, User name and Password.
Just fill in the info for the 3 mentioned fields as follows:
- PC Name – The IP or Host name of your remote machine. Most likely you’ll want to use your IP.
- User name – The username you used when installing xRDP and the desktop environment on your remote machine. Either root or your sudo user.
- Password – Your CentOS user’s login password.
After which the connection should be saved and you should be able to start the connection to the remote machine.
Conclusion
Setting up an RDP server on CentOS 7 with your preferred desktop environment is simple with xrdp. By following this guide, you can install, configure, and switch between Xfce, MATE, and GNOME seamlessly. Happy remote computing!
Leave a Comment