How To Install and Configure GUI for Amazon EC2 RHEL 7 Instance

amazon ec2 rhel 7 gui

In this tutorial, I have explained the easy steps to configure GUI for RedHat7 EC2 instance and connect to it using RDP clients.

Note: For RHEL 6 follow this tutorial. Setting up GUI on RHEL6

GUI for Amazon EC2 RHEL 7

There are three sections involved in the whole setup. Follow all the three sections explained below to successfully configure the GUI.

Installing GUI Components

1. Update the server using the following command.

sudo yum -y update

2. Install the gnome GUI components using the following command.

sudo yum groupinstall -y "Server with GUI"

3. Issue the following commands to start the GUI during boot.

sudo systemctl set-default
sudo systemctl default

Now we have all the essential GUI components installed on the server. In the next section, we will install the xrdp components to enable remote desktop connections.

Recommended: Learn Linux in 5 Days and Level Up Your Career Udemy Course

Setting up XRDP

1. Add the xrdp repository to your instance using the following command.

sudo rpm -Uvh

2. Install xrdp and tiger VNC server.

sudo yum install -y xrdp tigervnc-server

3. Setup SELINUX security using the following commands.

chcon --type=bin_t /usr/sbin/xrdp
chcon --type=bin_t /usr/sbin/xrdp-sesman

4. Start and enable the xrdp service.

sudo systemctl start xrdp
sudo systemctl enable xrdp

5. Enable RDP port on the instance using the following firewall commands.

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

6. Set a password for ec2-user . This password will be used to connect to the RDP session.

sudo passwd ec2-user

7. Set password for root as you will be prompted for cloud user password for network proxy and color. Login as root and set the password.

sudo su

Now we have the xdrp components and all instance level settings in the right place. Now let’s test out the RDP connection from an RDP client. In this tutorial, i am using windows RDP client.

READ  How To Setup AWS Logs Agent on Ubuntu 16.04 Instance

Connecting the Instance Using RDP

Note: Make sure you have opened RDP port in your instance security group.

1. Open RDP client and type in the public IP of your instance and click connect.

2. If you get a warning message about remote identity, just click yes.

3. Now you will get a xrdp authentication window, enter the credentials and click ok.

Note: The username is “ec2-user” and the password is the password you set for ec2-user in step 6.

4. You will be prompted to enter the password again. Provide the password and proceed to the steps to configure the initial desktop.

5. If it prompts for “cloud user password” provide the root user password you set in step 7.

6. That it, you will get a GUI session as shown below. If you face any errors do let me know in the comment session.

amazon ec2 rhel 7 gui

Free DevOps Resources

Get DevOps news, tutorials and resources in your inbox. A perfect way If you want to get started with devops. Like you, we dont like spam.


  1. george leblanc Reply

    I tried the first steps and got:

    [[email protected] ec2-user]# yum -y update

    Loaded plugins: priorities, update-motd, upgrade-helper

    23 packages excluded due to repository priority protections

    No packages marked for update

    [[email protected] ec2-user]# yum groupinstall -y “Server with GUI”

    Loaded plugins: priorities, update-motd, upgrade-helper

    There is no installed groups file.

    Maybe run: yum groups mark convert (see man yum)

    23 packages excluded due to repository priority protections

    Warning: group Server with GUI does not exist.

    Maybe run: yum groups mark install (see man yum)

    Error: No packages in any requested group available to install or update

    [[email protected] ec2-user]#

  2. Larry Frazier Reply

    I get to the last step of entering the password a second time and it won’t let me log in.

  3. Jon H Reply

    Everything seems to have gone smoothly up until I try to access the box. I’m using TigerVNC viewer on Windows, and it times out and fails to connect. Should I be appending the port to the public IP of the box? x.x.x.x:3394? Would another RDP program be better? I’ve also opened the port in the Amazon AWS security profile, so I don’t think that’s the issue.

    Thanks for your guide!

    Edit: The issue was apparently TigerVNC. Windows RDP is working fine.

  4. satish Reply

    I have tried till prompted to enter the password again
    its not allowing me to log in asking again cloud user password

    • Katrine Skeby Reply

      Hi. Did you actually figure out how to fix this? I have the same problem. Thanks.

      • Devopscube Reply

        Hi katrine,

        The issue will get fixed if you set the root password and use it when asked for cloud user password. I have tested it and updated the article. Thanks for the comment!!

  5. Joshua Edwards Reply

    Hi there!

    I have followed all steps exactly on a freshly installed EC2 image of RHEL 7.2. When I try to connect with MobaXtem I receive the following error.

    The client could not connect to the remote computer.
    Remote conenctions might not be enabled or the computer might be to busy to accept new connections.
    It is also possible network problems are preventing you from our connection. Please try again later.
    If the problem persists please contact your Admin.

    Any Ideas?

  6. Jennifer Shawster Reply

    Hi! Thanks for putting up this resource 🙂

    connecting to seaman ip port 3350
    sesame connect ok
    sending login info to session manager, please wait….
    xrdp_mm_process_login_response:login successful for display
    started connecting
    connecting to 5910
    error – problem connecting

    any idea on how to deal with this error?

  7. Korash Hernandez Reply

    Stuck on “sending login information to session manager, please wait…”, just hangs there. Not sure what else to do to fix this

  8. Scott Reply

    I had the same problem as Jennifer Shawster. The solution was to open this file:


    And add this at the top:

    exit 0

    Probably everything after the exit 0 can be deleted.

  9. ajftek Reply

    Works great. Initial login said “Authentication required to set Network Proxy” as you mentioned in the article. I put in the root password and it took it, but then it went right back to the “Authentication required to set Network Proxy” screen and asked for it again. It asked me about 20 times before it finally went away. Afte that I was on the desktop and all was good.
    FYI , if any one else runs into this , it easier to just hit CTRL-ALT-ESC 20 times, instead of typing in the root password. Eventually the Authentication screen will go away and you will get to the desktop.

  10. Aby Reply

    Everything went well and i could connect with using the credentials. But there started all surprises. what i can see is a black screen on remmina on ubuntu

    • arnaud Reply

      Hello, thanks for the great post.
      I’m almost there, I’m on RHEL 7, I am passing authentication and then all I get is a black screen, did someone manage to fix it?


    • abc Reply

      what did you do after u saw a black screen ? because i am facing the same issue for rad hat linux instance

  11. sjt Reply

    This is incredible! I searched online for a week to find out how to do this. You guys won’t like me much cuz I’m a Windows guy and HATE Linix! (:-) . Not really, but I’m horrible at it……never learned it. But I’m a big AWS fan and certified, so now i have to learn some Linux. Anyway, this tutorial was absolutely perfect! Worked first time! Thanks DEVOPSCUBE. Great site here! Now at least i feel a little more at home with this GUI! 🙂

  12. Giridhar Reply

    Excellent! I just followed the steps outlined and no issues.
    Very nicely explained.

Leave a Reply

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