xrdp is an Open Source Remote desktop Protocol server, which allows you to RDP to your Linux server from Windows machine; it is capable of accepting connections from rdesktop, freerdp, and remote desktop clients. This how to will help you to setup xrdp server on CentOS 6 / RHEL 6.
Prerequisites:
Install EPEL repository on CentOS 6.
32 Bit
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
64 Bit
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Installation:
Issue the following command to install xrdp
# yum -y install xrdp tigervnc-server
You will get the following output, make sure you are getting package from the newly created repository.
Installed: tigervnc-server.x86_64 0:1.1.0-8.el6_5 xrdp.x86_64 0:0.5.0-0.13.el6 Dependency Installed: libXmu.x86_64 0:1.1.1-2.el6 xorg-x11-fonts-misc.noarch 0:7.2-9.1.el6 xorg-x11-xauth.x86_64 1:1.0.2-7.1.el6
Once it is installed, lets start the xrdp service.
# service xrdp start
xrdp will listen on 3389, lets confirm this by issuing following command.
# netstat -antup | grep xrdp tcp 0 0 127.0.0.1:3350 0.0.0.0:* LISTEN 11299/xrdp-sesman tcp 0 0 0.0.0.0:3389 0.0.0.0:* LISTEN 11295/xrdp
By default, services wont auto start after system reboot. Issue the following command to enable the service at system start up.
# chkconfig xrdp on # chkconfig vncserver on
Test:
Now take rdp from any windows machine using Remote Desktop Connection, enter ip address of Linux server in computer field and click on connect.
You would be asked to enter the user name and password, you can either use root or any user that you have it on system. Make sure you use module “sesman-Xvnc”.
If you click ok, you will see the processing. In less than a half min, you will get a desktop.
That’s All, you have successfully configured xRDP on CentOS 6 / RHEL 6. We welcome your comments.
nice guide! Installation went smooth but when I logged in, All I have is a blank black screen. I don’t know what I’m missing here. pls help..
Hi,
Make sure you have GUI installed.
How to install GUI on Centos 6 VPS please reply?
You can install in the same way that is mentioned in tutorial, at last install vnc viewer for taking graphical view
Question for CentOS 7. I have installed according to the guide, but used systemctl for enabling autostart. Question is, I have gnome and xfce installed and I want the rdp to default to xfce. how would this be done?
I searched high and low, for two days, trying to find a article that actually gave me some useful advice on how to get this xrdp up and working on RHEL6. After I found you post, it took about 20 minutes. (just because I went slow)
You have my respect for actually posting something on a Linux topic that is actually directly helpful and useful.
If there’s a Metal of Honor for Linux post, you have my nomination.
Thanks again,
Bryan
Clear and concise explanation of a quite difficult task.
Thanks for putting up this page!
Hi,
Great article but this does not work for RHEL 7. for 7 we need to write unit files for most of the service.
refer RHEL official doc for more info https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/ch-TigerVNC.html
Hi Bibin,
Check out this article
https://www.itzgeek.com/how-tos/linux/centos-how-tos/install-xrdp-on-centos-7-rhel-7.html
Quite nice article in which you may add a bullet for firewall config check about tcp/3389 like in CentOS7…
I installed it a long time ago and got a problem recently. The vncserver triggered some attacks to random destination regularly in port 22. I’m not sure what is the main function of this vncserver, but since that case I completely shutdown the vncserver service.
How do you change the default rdp port to a custom port?
Hi Victor,
Modify /etc/xrdp/xrdp.ini
and change port=-1 to port=5192 for customized port
Trying to get this work on Centos 6.6 but with no luck.
Installation of XRDP goes well however when it comes to connecting to it via windows RDC it comes up with a RDC error “Remote desktop can’t connect to the remote computer for one of these reasons…..”
I tried with the ip address on its own, with both those ports too with no luck. I know for sure the ip is correct and the system is up and running. I can successfully connect to it via putty or from another centos machine to get to the terminal.
Any tips? 🙂
I installed on an AWS ec2 instance (CentOS 6.4). The login screen appears, but when I try to log in, I’m getting an error. I’ve opened ports 3350, 3389 and 5910 in my firewall.
You need to install a Xwindows client on your server you are trying to connect to. I had the same problem earlier today
Hi Anthony,
Could you please tell me the procedure for installing Xwindows client in Redhat Linux 6.6
I had to run these two commands to get it working in CentOS 6.8:
$ sudo iptables -I INPUT -p tcp -m tcp –dport 3389 -j ACCEPT
$ sudo service iptables save
i have installed chromium browser with this guide to centos 6.6 machine. But when i xrdp to it and click on chromium browser , nothing shows up.
Also when i fire “chromium-browser” command in the commandline – it says successfully opened a new window.
Can you please help !!
thanks,
poorva
bhandaripoorva@gmail.com
its easy for centos 6.x, first u need to configure exact port with your vncserver setting, for example, nano -w /etc/sysconfig/vncservers and this is my example; VNCSERVERS=”2:user”
VNCSERVERARGS[2]=”-geometry 800×600 -nolisten tcp -localhost” , 2:user means your port will be 5902 in /etc/xrdp/xrdp.ini and so on, and please follow how to add user in vncserver etc etc… if u set 1:user means your xrdp.ini port will be 5901. and user is username in your box. you can use remote desktop for it, after apply all change and make vnc passwd on each user dir with properly setting, restart xrdp and vncserver then you rock.