INTRODUCTION

Enable Remote Desktop on Linux RHEL6/CentOS6

Our requirement is to enable remote desktop function in CentOS Linux machine which will allow us to access Linux box from windows machine using mstsc.exe (Remote Desktop).

What is XRDP?

XRDP is very handy package available on EPL repository, it supports Microsoft Remote Desktop Protocol. In order to access Linux machine from windows RDP client we will install and setup XRDP on linux.

`
  • Using RHEL7/CentOS7 ? Refer to below guide.
  • Don’t Miss: How To Remote Desktop from windows to Linux (RHEL7/CentOS7)

    SOLUTION

    We need some additional work to install XRDP on CentOS, as CentOS repositories does not contain the XRDP package. You need to download and add EPEL (Extra Packages Enterprise Linux).
    Let’s verify our correct OS architecture first.
    Using below command we can verify OS architecture.

    Step 1:

    # uname -r
    2.6.32-279.el6.i686

    If the output shows x86_64 at end then mean, you have a 64-bit install or if it shows i386 then your OS architecture is 32-bit.
    Our output is showing (2.6.32-279.el6.i686) it’s mean we have 32-bit operating system.
    After determining your architecture, install the correct EPEL repository with below command.

    Step 3:

    For RedHat or Centos 6.x 32-bit

     wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
     # rpm -ivh epel-release-6-8.noarch.rpm

    For RedHat or Centos 6.x 64-bit

    wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
     #rpm -ivh epel-release-6-8.noarch.rpm

    Step 4:

    Lets verify EPEL repository is installed correctly

    yum repolist -v | grep epel

    We can see EPEL repository is installed correctly.

    Step 5:

    Now we are ready to install XRDP package. It will install also some dependencies.

    yum install xrdp tigervnc-server

    Step 6:

    After instllation we need to configure display.
    Edit display file located at /etc/sysconfig/vncservers

    vim /etc/sysconfig/vncservers

    Find at last these lines

     VNCSERVERS="2:myusername"
    # VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

    Uncomment and change them into.

    VNCSERVERS="2:root"
    VNCSERVERARGS[2]="-geometry 800x600"

    I am using root user as my remote desktop user.
    Now save this file and exit.

    Step 7:

    Start VNC and XRDP services.

    service vncserver start
    service xrdp start

    Step 8:

    Make them available on next startup.

     chkconfig xrdp on
     chkconfig vncserver on

    That’s it all the packages are installed, now you should be able to access your linux box from any RDP Client.

    Step 9:

    Before we connect to our Linux box, make sure you allowed 3389 port in iptables rules see below.

    iptables -I INPUT -p tcp --dport 3389 -j ACCEPT
    service iptables save
    service iptables restart

    Step 10:

    Now we will access linux box from windows 7 machines .you can access your linux box from any rdp client such as mstsc from windows xp, windows 7 and windows 8.
    Open run box type mstsc and hit enter.

    1

    Step 11:

    You will see small rdp box will appear that will ask ip address or hostname of the target machine.
    I will enter my linux box ip address.

    2

    Step 12:

    Before we connect I will adjust my display size by clicking on options and then display. See blow.
    After modify display setting now click on connect.

    3

    Step 13:

    Enter Linux machine credential for authentication, i am using root user.

    4

    Finally we are able to access Linux box using Remote Desktop from Windows PC.

    5

    Thanks 🙂


    If you like this Post, please give us your valuable feedback by pressing Vote Up / Vote Down Button. Thanks.

    [thumbs-rating-buttons]


    Similar Posts