AMP AMP

How to Install Xrdp Server (Remote Desktop) on CentOS 8.3

To Install Remote Desktop Server on CentOS 8.3

Introduction:

Xrdp is an open-source application of the Microsoft Remote Desktop Protocol (RDP) that enables us to graphically manage a remote system. With RDP, we can log in to the remote machine and build a real desktop session the same as if you had logged in to a local machine. This tutorial explains how to install and configure Xrdp server on CentOS 8.3.

Installation Procedure:

Gnome is the default desktop environment in CentOS 8. To install Gnome on your remote machine, run the following command

[root@linuxhelp ~]# sudo dnf groupinstall "Server with GUI"
Last metadata expiration check: 2:23:15 ago on Saturday 02 January 2021 03:16:41 PM IST.
Dependencies resolved.
===============================================================================================
 Package                         Arch     Version                            Repository   Size
===============================================================================================
Upgrading:
 firefox                         x86_64   78.5.0-1.el8_3                     appstream   102 M
 microcode_ctl                   x86_64   4:20200609-2.20201027.1.el8_3      baseos      4.5 M
Installing group/module packages:
 alsa-sof-firmware               noarch   1.5-2.el8                          baseos      417 k
 gtk2-immodule-xim               x86_64   2.24.32-4.el8                      appstream    21 k
 Running scriptlet: ibus-libpinyin-1.10.0-1.el8.x86_64                                  25/33 
  Upgrading        : microcode_ctl-4:20200609-2.20201027.1.el8_3.x86_64                  26/33 
  Running scriptlet: microcode_ctl-4:20200609-2.20201027.1.el8_3.x86_64                  26/33 

Upgraded:
  firefox-78.5.0-1.el8_3.x86_64       microcode_ctl-4:20200609-2.20201027.1.el8_3.x86_64      
 python3-enchant-2.0.0-3.el8.noarch                                                           
  skkdic-20170102-4.T1100.el8.noarch                                                           
  unicode-ucd-11.0.0-1.el8.noarch                                                              
Complete!

Xrdp is available in the EPEL software repository. If EPEL is not enabled on your system, enable it by typing:

[root@linuxhelp ~]# sudo dnf install epel-release
Last metadata expiration check: 1:00:25 ago on Saturday 02 January 2021 03:16:41 PM IST.
Package epel-release-8-9.el8.noarch is already installed.
Dependencies resolved.
================================================================================
 Package               Architecture    Version              Repository     Size
================================================================================
Upgrading:
 epel-release          noarch          8-10.el8             epel           22 k

Transaction Summary
================================================================================
Upgrade  1 Package
Total download size: 22 k
Is this ok [y/N]: y
Downloading Packages:
epel-release-8-10.el8.noarch.rpm                 43 kB/s |  22 kB     00:00    
--------------------------------------------------------------------------------
Total                                            15 kB/s |  22 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Running scriptlet: epel-release-8-10.el8.noarch                           1/1 
  Upgrading        : epel-release-8-10.el8.noarch                           1/2 
  Cleanup          : epel-release-8-9.el8.noarch                            2/2 
  Running scriptlet: epel-release-8-9.el8.noarch                            2/2 
  Verifying        : epel-release-8-10.el8.noarch                           1/2 
  Verifying        : epel-release-8-9.el8.noarch                            2/2 
Installed products updated.

Upgraded:
  epel-release-8-10.el8.noarch                                                  

Complete!

Install the Xrdp package:

[root@linuxhelp ~]# sudo dnf install xrdp 
Last metadata expiration check: 1:02:24 ago on Saturday 02 January 2021 03:16:41 PM IST.
Dependencies resolved.
Installing:
 xrdp                 x86_64         1:0.9.14-3.el8          epel         448 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): xrdp-selinux-0.9.14-3.el8.x86_64.rpm      24 kB/s |  22 kB     00:00    
(2/2): xrdp-0.9.14-3.el8.x86_64.rpm             219 kB/s | 448 kB     00:02    
--------------------------------------------------------------------------------
Total                                           156 kB/s | 470 kB     00:03     
Running transaction check
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Installing       : xrdp-selinux-1:0.9.14-3.el8.x86_64                     1/2 
  Verifying        : xrdp-1:0.9.14-3.el8.x86_64                             1/2 
  Verifying        : xrdp-selinux-1:0.9.14-3.el8.x86_64                     2/2 
Installed products updated.
Installed:
  xrdp-1:0.9.14-3.el8.x86_64         xrdp-selinux-1:0.9.14-3.el8.x86_64        
Complete!

When the installation process is complete, start the Xrdp service and enable it at boot:

[root@linuxhelp ~]# sudo systemctl enable xrdp --now
Created symlink /etc/systemd/system/multi-user.target.wants/xrdp.service ? /usr/lib/systemd/system/xrdp.service.
You can verify that Xrdp is running by typing:
 [root@linuxhelp ~]# sudo systemctl status xrdp
? xrdp.service - xrdp daemon
   Loaded: loaded (/usr/lib/systemd/system/xrdp.service; enabled; vendor preset>
   Active: active (running) since Sat 2021-01-02 16:20:23 IST; 18s ago
     Docs: man:xrdp(8)
           man:xrdp.ini(5)
 Main PID: 12660 (xrdp)
    Tasks: 1 (limit: 23388)
   Memory: 1.3M
   CGroup: /system.slice/xrdp.service
           +-12660 /usr/sbin/xrdp --nodaemon
Jan 02 16:20:23 linuxhelp systemd[1]: Started xrdp daemon.
Jan 02 16:20:24 linuxhelp xrdp[12660]: (12660)(140241703958720)[INFO ] starting>
Jan 02 16:20:24 linuxhelp xrdp[12660]: (12660)(140241703958720)[INFO ] address >
Jan 02 16:20:24 linuxhelp xrdp[12660]: (12660)(140241703958720)[INFO ] listenin>
Jan 02 16:20:24 linuxhelp xrdp[12660]: (12660)(140241703958720)[INFO ] xrdp_lis>

Whenever you make any changes to the configuration file you need to restart the Xrdp service:

[root@linuxhelp ~]# sudo systemctl restart xrdp
By default, Xrdp listens on port 3389 on all interfaces. So now I am going to check the firewall status
[root@linuxhelp ~]# systemctl status firewalld
? firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor p>
   Active: active (running) since Sat 2020-12-19 10:05:44 IST; 2 weeks 0 days a>
     Docs: man:firewalld(1)
 CGroup: /system.slice/firewalld.service
           +-1052 /usr/libexec/platform-python -s /usr/sbin/firewalld --nofork >
Dec 19 10:05:41 linuxhelp systemd[1]: Starting firewalld - dynamic firewall dae>
Dec 19 10:05:44 linuxhelp systemd[1]: Started firewalld - dynamic firewall daem>
Dec 19 10:05:45 linuxhelp firewalld[1052]: WARNING: AllowZoneDrifting is enable>![snap1](https://assets.linuxhelp.com/scr/9f2ba38ed61c81c3dbac9c9b45405001.png)

Stop the firewall to allow all the port to access through it

[root@linuxhelp ~]# systemctl stop firewalld

Check the status for xrdp

[root@linuxhelp ~]# systemctl status xrdp
? xrdp.service - xrdp daemon
   Loaded: loaded (/usr/lib/systemd/system/xrdp.service; enabled; vendor preset>
   Active: active (running) since Sat 2021-01-02 16:21:48 IST; 1min 37s ago
     Docs: man:xrdp(8)
           man:xrdp.ini(5)
 Main PID: 41422 (xrdp)
    Tasks: 1 (limit: 23388)
   Memory: 956.0K
   CGroup: /system.slice/xrdp.service
           +-41422 /usr/sbin/xrdp --nodaemon

Jan 02 16:21:48 linuxhelp xrdp[41422]: (41422)(140606742780096)[INFO ] starting>
Jan 02 16:21:48 linuxhelp systemd[1]: Started xrdp daemon.
Jan 02 16:21:48 linuxhelp xrdp[41422]: (41422)(140606742780096)[INFO ] address >
Jan 02 16:21:48 linuxhelp xrdp[41422]: (41422)(140606742780096)[INFO ] listenin>
Jan 02 16:21:48 linuxhelp xrdp[41422]: (41422)(140606742780096)[INFO ] xrdp_lis>

Now that the Xrdp server is configured, it is time to open your local Xrdp client and connect to the remote CentOS 8 system. Windows users can use the default RDP client. Type “remote” in the Windows search bar and click on “Remote Desktop Connection”. This will open up the RDP client. In the “Computer” field, type the remote server IP address and click “Connect”. On the login screen, enter your username and password and click “OK”. Once logged in, you should see the default Gnome desktop. It should look something like this:

With this method the installation of Remote Desktop server on CentOS 8.3 comes to an end.

Tag : XRDP RDP
FAQ
Q
Do I use Multiple Users Connect via XRDP?
A
Yes, multiple users can connect via the XRDP software solutions. For each user that needs to connect, you will need to configure the .xsession file. You can either manually create this file or you can use the following procedure to automate the creation of the .xsession file
Q
Is there any workaround to connect to Unity via XRDP?
A
There is indeed a quick and dirty way to connect to an Ubuntu machine and connect to the Unity Desktop. As mentioned, this is a workaround where you use the xrdp interface to basically perform a vnc connection
Q
How do I change my XRDP port?
A
When assigning port numbers, you can just start at the default port 3389 and go on: 3390, 3391, and so on. To change the default port of xrdp, open the /etc/xrdp/xrdp.ini file as root, edit the port entry in the Global section
Q
Do I have performed a standard installation of xRDP but when I try to perform a remote connection, I have a blank or grey screen. How can I fix this?
A
Since Ubuntu 12.10, the Unity Desktop is not supported with Xrdp. You will need to install an alternate desktop environment and tell your Ubuntu system to use this alternate desktop session.
Q
How do I open an XRDP file in Ubuntu?
A
Install the XRDP Package from Ubuntu Repository
Click on the terminal icon and the Terminal console will open. ...
You will be then informed about the package size. ...
Wait for the completion. ...
You might be prompted for a password. Enter the password and press enter