How to install XRDP in CentOS

To install XRDP in CentOS

Xrdp is a free-ware implementation of RDP (Remote Desktop Protocol), the protocol used with Windows Terminal Services for native Windows desktop connectivity. The xrdp package provides RDP functionality, along with an X server capable of accepting connections from rdesktop and Windows Terminal Server clients.

To install XRDP

Run the following command to install epel repository

[root@linuxhelp Desktop]# yum install epel-release 
Loaded plugins: fastestmirror, langpacks
.
.
.
Installing : epel-release-7-6.noarch                                                            1/1 
Verifying  : epel-release-7-6.noarch                                                            1/1 
Installed:
  epel-release.noarch 0:7-6                                                                           
Complete!


Next install NUX repository by running the following command.

[root@linuxhelp Desktop]# rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm 
Retrieving http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
warning: /var/tmp/rpm-tmp.RzwKEg: Header V4 RSA/SHA1 Signature, key ID 85c6cd8a: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:nux-dextop-release-0-1.el7.nux   ################################# [100%]


Create the repo file inside yum.repos.d directory and add the following statements into it.

[root@linuxhelp Desktop]# vim /etc/yum.repos.d/xrdp.repo 
[xrdp]
name=xrdp
baseurl=http://li.nux.ro/download/nux/dextop/el7/x86_64/
enabled=1
gpgcheck=0


After creating the repos start installing xrdp.

[root@linuxhelp Desktop]# yum install xrdp tigervnc-server 
Loaded plugins: fastestmirror, langpacks
http://epel.mirror.net.in/epel/7/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
.
.
.
Installed:
  tigervnc-server.x86_64 0:1.3.1-4.el7_2                   xrdp.x86_64 1:0.9.0-4.el7                  
Complete!


Run the following command to start and enable the xrdp service

[root@linuxhelp Desktop]# systemctl start xrdp.service
[root@linuxhelp Desktop]# systemctl enable xrdp.service 
ln -s ' /usr/lib/systemd/system/xrdp.service'  ' /etc/systemd/system/multi-user.target.wants/xrdp.service' 


Then check the status of xrdp by using the following command.

[root@linuxhelp Desktop]# systemctl status xrdp.service 
xrdp.service - xrdp daemon
   Loaded: loaded (/usr/lib/systemd/system/xrdp.service  enabled)
   Active: active (running) since Tue 2016-09-20 14:41:13 IST  23s ago
 Main PID: 12192 (xrdp)
   CGroup: /system.slice/xrdp.service
           ??12192 /usr/sbin/xrdp --nodaemon
Sep 20 14:41:13 linuxhelp systemd[1]: Starting xrdp daemon...
Sep 20 14:41:13 linuxhelp systemd[1]: Started xrdp daemon.


Verify the XRDP listening port with the help of the following command.

[root@linuxhelp Desktop]# netstat -antup | grep xrdp 
tcp        0      0 0.0.0.0:3389            0.0.0.0:*               LISTEN      12192/xrdp          
tcp        0      0 127.0.0.1:3350          0.0.0.0:*               LISTEN      12190/xrdp-sesman


Add the listen port into iptables and reload the firewall.

[root@linuxhelp Desktop]# firewall-cmd --permanent --zone=public --add-port=3389/tcp 
success
[root@linuxhelp Desktop]# firewall-cmd --reload  
Success


Run the following command to configure Selinux for xrdp.

[root@linuxhelp Desktop]# chcon --type=bin_t /usr/sbin/xrdp
[root@linuxhelp Desktop]# chcon --type=bin_t /usr/sbin/xrdp-sesman 

Open the Remote Desktop Connection wizard and enter the ip for Linux machine.

Login to the XRDP and click OK.

Now we have successfully logged in to the remote desktop.

You can start using the remote desktop.

Tag : XRDP
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 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 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
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 Ubunut 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 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