How to RDP (Remote Desktop) into CentOS 7

Hi There,

In this tutorial I will show you how to RDP into your CentOS 7 Server. This tutorial will also work on a Redhat 7 server. In order to follow this tutorial you will need to be sure that you have CentOS 7 installed with the GNOME Desktop. If you haven’t done this yet be sure to follow this tutorial to get up to speed.

The first thing that we need to do is to add two repos to our CentOS server. The two commands that you need to run are:

  1. sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
  2. sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm

Next we will install the xrdp software package and then start it as a service. The commands to do this are:

  1. sudo yum -y install xrdp tigervnc-server
  2. Sudo systemctl start xrdp.service

Now we need to allow the ports for xrdp through the firewall. After that we’ll need to restart the firewall service. This can be done by running these commands.

  1. sudo firewall-cmd –permanent –zone=public –add-port=3389/tcp
  2. sudo firewall-cmd –reload

Finally we need to configure SELinux. To do so run these two commands:

  1. sudo chcon –type=bin_t /usr/sbin/xrdp
  2. sudo chcon –type=bin_t /usr/sbin/xrdp-sesman

We can now try to RDP to our CentOS 7 server.

First open RDP and type in the IP address of you CentOS 7 Server.

If you get certificate warnings click yes to continue.

Now enter your CentOS username and password

You will now be brought to your CentOS Desktop.

 

 A full video of this tutorial can be seen here:

This entry was posted in CentOS, linux and tagged , , , , , , . Bookmark the permalink.

14 Responses to How to RDP (Remote Desktop) into CentOS 7

  1. Douglas Hodges says:

    Nice write up.
    Note:
    The web editor’s auto-correct changed his commands.
    The commands that have flags with — are showing up as –.
    Update command:
    sudo firewall-cmd –permanent –zone=public –add-port=3389/tcp
    sudo firewall-cmd –reload
    sudo chcon –type=bin_t /usr/sbin/xrdp
    sudo chcon –type=bin_t /usr/sbin/xrdp-sesman

  2. Douglas Hodges says:

    Need to add:
    yum groupinstall “server with gui”

  3. Roy says:

    Hello, when i am trying to install xrdp tigervnc-server i get the following error. Any help please?

    Loaded plugins: fastestmirror, langpacks
    Loading mirror speeds from cached hostfile
    * base: http://ftp.ntua.gr
    * epel: http://ftp.ntua.gr
    * extras: http://ftp.ntua.gr
    * nux-dextop: mirror.li.nux.ro
    * updates: http://ftp.ntua.gr
    Resolving Dependencies
    –> Running transaction check
    —> Package tigervnc-server.x86_64 0:1.8.0-5.el7 will be installed
    —> Package xrdp.x86_64 1:0.9.8-1.el7 will be installed
    –> Processing Dependency: xorgxrdp for package: 1:xrdp-0.9.8-1.el7.x86_64
    –> Running transaction check
    —> Package xorgxrdp.x86_64 0:0.2.8-3.el7 will be installed
    –> Processing Dependency: xorg-x11-server-Xorg(x86-64) = 1.20.1 for package: xorgxrdp-0.2.8-3.el7.x86_64
    –> Finished Dependency Resolution
    Error: Package: xorgxrdp-0.2.8-3.el7.x86_64 (epel)
    Requires: xorg-x11-server-Xorg(x86-64) = 1.20.1
    Installed: xorg-x11-server-Xorg-1.19.5-5.1.el7_5.0.1.x86_64 (@updates)
    xorg-x11-server-Xorg(x86-64) = 1.19.5-5.1.el7_5.0.1
    Available: xorg-x11-server-Xorg-1.19.5-5.el7.x86_64 (base)
    xorg-x11-server-Xorg(x86-64) = 1.19.5-5.el7
    Available: xorg-x11-server-Xorg-1.19.5-5.1.el7_5.x86_64 (updates)
    xorg-x11-server-Xorg(x86-64) = 1.19.5-5.1.el7_5
    You could try using –skip-broken to work around the problem
    You could try running: rpm -Va –nofiles –nodigest

    • Riles says:

      Hey Roy,
      A mirror / package update is currently taking place. Some few mirrors already show xorg-x11-server-Xorg(x86-64) = 1.20.1
      I did this to get around it:
      yum install xrdp –enablerepo=cr

      for now as the xorg-x11-server-Xorg(x86-64) = 1.20.1 packages should be available in the continuous release repo.

  4. Rory says:

    I have done this and it worked brilliantly but then I reboot the machine it boots right up until I get to select user and then just black screens. The caps lock light is unresponsive but I can still ping the machine and webmin into it. So odd, I am an absolute novice when it comes to linux but willing to try. Would you have any idea what I am doing wrong? I have rebuilt the machine twice now. I changed the graphics card on the last build to a nvidea K2000 with not luck. Thank you in advance for any help.

  5. ven says:

    i have done this but when i connect i have only black screen and my mouse pointer please help

  6. Pingback: How To RDP into CentOS 7 from Windows | Host your Website

  7. Pingback: How To RDP into CentOS 7 from Windows – My blog

  8. nize says:

    this works until the remote centos 7 gnome desktop is displayed and then RDP automatically closes the window/disconnects. any idea how to fix this? thanks.

  9. Hi, trust all is well. Must say, great tutorial. But I get a black screen when connected, do you maybe know the reason?

Leave a Reply to Douglas Hodges Cancel reply

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