Linux for my son – How to install xRDP on CentOS

Voiced by Amazon Polly

This article will cover the process of installing xRDP on CentOS. The primary reason for myself was to enable my son to view the full desktop on a Wyse terminal. In normal cases however you can view GUI elements from a Linux box by connecting via ssh with the -Y or -X paramenters.

My first computer

I remember the time when I received my first computer in the 1980s. It was an IBM 30/286 computer with a 20 MB HDD, and a 3.5” Floppy drive. The OS was DOS, and my first game was Space Quest. It was the beginning of an incredible journey, and I still remember the learning process I went through using the command line. I believe learning from a CLI first helped me greatly in my computer skills and not being afraid to dig deeper. My introduction to DOS is more than likely why I enjoy working with Linux and Cisco using the CLI on both platforms. Now I do like using the GUI for certain things, however, if I can use the CLI for a task, I always lean that way.

Linux for my son

This brings me to the end of 2015 when I decided it was time to get my son who will be seven very soon, a computer in which he could experiment with. Instead of going with DOS or Windows I wanted him to use Linux for his first computer experience. I’m also teaching him how to use the CLI so he won’t be dependent on a GUI as many these days are.

WYSE thin client

What I had available was a WYSE thin client, which in itself didn’t have the specs to just install Linux on as the memory available was pretty low. It did, however, have an RDP client built in and I could tell the client to auto connect to an IP and remote into a virtual Linux box.

As I am working with CentOS recently I decided to build him a Virtual machine on CentOS that he could use himself. There was one thing I needed to resolve first, and that was getting CentOS to be able to accept Windows RDP sessions.

Once this is completed the WYSE terminal was able to remote into the VM of CentOS and he was able to begin using his new computer. Following are the required steps to install xRDP on CentOS and like Linux distros.

Installing xRDP

As you would expect, you’ll need to first issue the su – command to elevate your privileges during the process. The prompt will change from the $ sign to the # sign to show you are ready to go ahead.

Install EPEL and nux Desktop repository rpms.

# rpm -Uvh
# rpm -Uvh

Issue the  following command to install xrdp

# yum install xrdp tigervnc-server

Once it is installed, let us start the xrdp service.

# systemctl start xrdp

xRDP will listen on 3389, let us confirm this by issuing following command.

# netstat -antup | grep xrdp
tcp        0      0  *               LISTEN      1508/xrdp
tcp        0      0*               LISTEN      1507/xrdp-sesman

By default, services will not auto start after a system reboot. Issue the following command to enable the service at system start-up.

# systemctl enable xrdp

Next is to create a firewall rule to allow RDP connection from the external machines, the following command will add the exception for RDP port (3389)

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

Configure SELinux

# semanage fcontext -at bin_t '/usr/sbin/xrdp(/.*)?'
# semanage fcontext -at bin_t '/usr/sbin/xrdp-sesman(/.*)?'
# restorecon -vvFR /usr/sbin/{xrdp,xrdp-sesman}
# chcon --type=bin_t /usr/sbin/xrdp
# chcon --type=bin_t /usr/sbin/xrdp-sesman

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

You will be asked to enter the username and password, you can either use root or any other user that you have on the system. Make sure you use module “sesman-Xvnc”.

If you click ok, you will see the processing. In a short period of time, you will get a desktop.

What’s next

That’s all, you have successfully installed xRDP on CentOS 7 / RHEL 7.

He’s very happy with his computer and has his own email account set up so he can send emails to various family members. He explores the system and is starting to learn how to use Linux. I hope that this will give him a head start in a life with Computers and have a leg up on others that only have experience with Windows and a GUI environment.

* This post was re-posted to my new blog.  It was originally posted a few years back on a previous blog of mine, which is for the most part retired.

If you have any questions, feel free to let me know.


Ivan Windon

Ivan Windon is a Lead Engineer at Verizon Enterprise Solutions. Ivan is actively engaged in Cloud Technologies with AWS, Google, and Azure. Ivan has extensive experience with Linux and Windows administration, DNS, Networking, IDM, and Security. In his free time, he enjoys being with his wife and two children. The family enjoys hiking, and traveling when able. His favorite locations are Yosemite NPS, and San Francisco, California.

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: