Prerequisites

1. First, install Gnome GUI on CentOS 7 / RHEL 7

2. xrdp is available in EPEL repository, so Install and configure EPEL repository.

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Install xrdp on CentOS 7

Use YUM command to install xrdp package on CentOS 7 / RHEL 7.

yum -y install xrdp tigervnc-server

Output:

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

* base: centos.excellmedia.net

* epel: del-mirrors.extreme-ix.org

* extras: centos.excellmedia.net

* updates: centos.excellmedia.net

Resolving Dependencies

–> Running transaction check

—> Package tigervnc-server.x86_64 0:1.8.0-2.el7_4 will be installed

—> Package xrdp.x86_64 1:0.9.5-1.el7 will be installed

–> Processing Dependency: xorgxrdp for package: 1:xrdp-0.9.5-1.el7.x86_64

–> Running transaction check

—> Package xorgxrdp.x86_64 0:0.2.5-3.el7 will be installed

–> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================

Package Arch Version Repository Size

=================================================================================================

Installing:

tigervnc-server x86_64 1.8.0-2.el7_4 updates 213 k

xrdp x86_64 1:0.9.5-1.el7 epel 413 k

Installing for dependencies:

xorgxrdp x86_64 0.2.5-3.el7 epel 61 k

Transaction Summary

=================================================================================================

Install 2 Packages (+1 Dependent package)

Total download size: 688 k

Installed size: 2.7 M

Downloading packages:

warning: /var/cache/yum/x86_64/7/epel/packages/xrdp-0.9.5-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY

Public key for xrdp-0.9.5-1.el7.x86_64.rpm is not installed

(1/3): xrdp-0.9.5-1.el7.x86_64.rpm | 413 kB 00:00:01

(2/3): tigervnc-server-1.8.0-2.el7_4.x86_64.rpm | 213 kB 00:00:01

(3/3): xorgxrdp-0.2.5-3.el7.x86_64.rpm | 61 kB 00:00:01

————————————————————————————————-

Total 409 kB/s | 688 kB 00:00:01

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Importing GPG key 0x352C64E5:

Userid : “Fedora EPEL (7) <epel@fedoraproject.org>”

Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5

Package : epel-release-7-11.noarch (installed)

From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

Warning: RPMDB altered outside of yum.

Installing : xorgxrdp-0.2.5-3.el7.x86_64 1/3

Installing : 1:xrdp-0.9.5-1.el7.x86_64 2/3

Installing : tigervnc-server-1.8.0-2.el7_4.x86_64 3/3

Verifying : xorgxrdp-0.2.5-3.el7.x86_64 1/3

Verifying : tigervnc-server-1.8.0-2.el7_4.x86_64 2/3

Verifying : 1:xrdp-0.9.5-1.el7.x86_64 3/3

Installed:

tigervnc-server.x86_64 0:1.8.0-2.el7_4 xrdp.x86_64 1:0.9.5-1.el7

Dependency Installed:

xorgxrdp.x86_64 0:0.2.5-3.el7

Complete!

</epel@fedoraproject.org>

Once xrdp is installed, start the xrdp service using the following command.

systemctl start xrdp

xrdp should now be listening on 3389. You can confirm this by using netstat command.

netstat -antup | grep xrdp

Output:

tcp 0 0 0.0.0.0:3389 0.0.0.0:* LISTEN 1508/xrdp

tcp 0 0 127.0.0.1:3350 0.0.0.0:* LISTEN 1507/xrdp-sesman

READnetstat command not found on CentOS 7 / RHEL 7 – Quick Fix

By default, xrdp service won’t start automatically after a system reboot. Run the following command in the terminal to enable the service at system startup.

systemctl enable xrdp

Firewall

Configure the firewall to allow RDP connection from external machines. The following command will add the exception for RDP port (3389).

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

firewall-cmd –reload

SELinux

Configure SELinux

chcon –type=bin_t /usr/sbin/xrdp

chcon –type=bin_t /usr/sbin/xrdp-sesman

Test xrdp Remote Connectivity

Now take RDP from any windows machine using Remote Desktop Connection. Enter the ip address of Linux server in the computer field and then click on connect.

Install xrdp on CentOS 7 - Enter IP Address in Remote Desktop Connecton Window

Install xrdp on CentOS 7 – Enter IP Address in Remote Desktop Connection Window

You may need to ignore the warning of RDP certificate name mismatch.

Install xrdp on CentOS 7 - Accept the Certificate

Install xrdp on CentOS 7 – Accept the Certificate

You would be asked to enter the username and password. You can either use root or any user that you have on the system. Make sure you use the module “Xvnc“.

Install xrdp on CentOS 7 - xrdp Login Page

Install xrdp on CentOS 7 – xrdp Login Page

If you click ok, you will see the processing. In less than a half minute, you will get a desktop.

Install xrdp on CentOS 7 - xrdp CentOS Desktop

Install xrdp on CentOS 7 – xrdp CentOS Desktop

That’s All. You have successfully configured xRDP on CentOS 7 / RHEL 7.

Add Users

useradd -m testuser

passwd testuser

optimize XRDP (If Needed)

If the connection does not work now, open /etc/xrdp/xrpd.ini and change the following values:

bitmap_compression=false

 

[Xvnc]

name=Xvnc

lib=libvnc.so

username=ask

password=ask

ip=127.0.0.1

port=-1

#xserverbpp=24

delay_ms=5000

Now restart XRDP.

By Rayhan

My name is Rayhan and I'm an IT professional with over 10 years of experience in the field. I'm passionate about all things tech, and I love helping people solve their IT problems. In my free time, I enjoy tinkering with new gadgets and software, and I'm always on the lookout for the latest tech trends. I believe that technology has the power to make our lives easier and more enjoyable, and I'm excited to be a part of this ever-evolving field. Thank you for taking the time to visit my page.

Leave a Reply

Your email address will not be published. Required fields are marked *