How to connect to CentOS 8 Desktop from Windows via RDP

XRDP is an open source implementation Microsoft Remote Desktop (RDP), which allows you to graphically control your system. Using RDP, you can log in to the remote computer the same way you logged in to the local computer. It uses port 3389 to connect. In this guide, we will look at how to set up a remote desktop connection in CentOS 8.

Desktop setup

For this tutorial, I will use the CentOS server, which does not yet have a desktop environment. So, the first step in my system is to set up a desktop environment. If your CentOS system already has the GNOME desktop installed, continue to the next chapter to install XRDP.

To install GNOME on a remote machine, open a terminal and run the following command:

# dnf groupinstall "Server with GUI"

Depending on your system, downloading and installing GNOME packages and dependencies may take some time.

Install XRDP RDP Server

XRDP is available in EPEL software repository. If EPEL is not enabled on your system, enable it by entering the following command:

# dnf install epel-release

How to connect to CentOS 8 Desktop from Windows via RDP

Now install the XRDP package.

# dnf install xrdp

Install XRDP

After installation is complete, enable and start the XRDP service.

# systemctl enable xrdp
# systemctl start xrdp

To verify that XRDP is running, enter the following command:

# systemctl status xrdp

If the XRDP service is running, the output should be as shown in the figure below:

RDP service is running

You can also check the status of the XRDP service with the following command:

# netstat –atnp | grep 3389

Check RDP Port

The port should listen as shown below:

XRDP is listening

XRDP setup

configuration file /etc/xrdp/xrdp.ini, By default, XRDP uses the Linux desktop, which in our case is called GNOME. To connect, you do not need to make any changes to the configuration file. This file is divided into different sections and allows you to set global configuration parameters, such as security address and listening address, and you can also create various XRDP login sessions.

Open configuration file /etc/xrdp/xrdp.ini and add the following line to the end of the file.

exec gnome-session

After adding the above line, restart the XRDP service using the following command:

# systemctl restart xrdp

Firewall setup

If your firewall is running Centos 8, just add a rule to allow the XRDP port / service to allow traffic for the XRDP connection.

# firewall-cmd --add-port = 3389/tcp -- permanent
# firewall-cmd –reload

Connect to XRDP with Windows Machine

Windows by default uses the remote desktop client. To connect through Centos 8 using the remote desktop type Remote Desktop Connection in the Windows search bar and press Enter.

How to connect to CentOS 8 Desktop from Windows via RDP

Enter the IP address of the remote computer and click Connect.

Remote Desktop Connection

It will tell you on the login screen for credentials. To come in username and password and click on Good,

XRDP login

After logging in, you will see the default GNOME desktop. Now you can start interacting with the remote machine.

If you are using Mac OS, install the Microsoft Remote Desktop application from the Mac App Store, while a Linux user can use RDP clients such as Remmina or Vinagre,

Conclusion

In this guide, we learned how to set up a remote desktop connection in CentOS 8 and access it using a Windows computer. Using XRDP allows you to manage and control your machine remotely from a local computer using a graphical interface.

How to connect to CentOS 8 Desktop from Windows via RDP

Sidebar