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

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.

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

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

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.

2. Install xrdp and tiger VNC server.

3. Setup SELINUX security using the following commands.

4. Start and enable the xrdp service.

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

READ  Linux VI Editor Shortcuts, Tips and Productivity Hacks For Beginners

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

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.

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.

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.

READ  How To Setup Ansible Dynamic Inventory For Google Cloud

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

      • PTG Reply

        I was having the same issue but i get rid by upgrading the Instance type from T2 micro to T2 medium. Hope, it may also work for you.

  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.

  13. Francis Reply

    I’m stuck on this part. I already changed the root password but it won’t accept it.

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

  14. Denmark Reply

    I’m using macos. What remote client should I be using? I tried macOs RDP and VNC viewer client but it doesn’t work

  15. pratap Reply

    I’m stuck on 7 root password for cloud user. I already changed the root password but it is not accepting.

  16. Abhishek Mittal Reply

    I have followed all steps to configure GUI on Amazon EC2 instance of type RHEL7.
    I am able to enable 3389 port too.
    When I did RDP from Windows machine, it connects to remote screen but BLACK screen appears and then I am stuck. There are no errors reported.
    Please suggest.

    • Susan Flynn Reply

      I had the same issue. The screen was black. I waited a few minutes it came alive. Now it is hanging. Any suggestions. I am hard wired in with a 50MB download and 10MG upload speed.

      • devopscube Post authorReply

        Hi Abhishek,
        You can try increasing the system RAM and CPU with a different instance type. It might help.

  17. arjan Reply

    I did all the steps. But then when i try to use RDP on my windows machine. It states that it can’t connect. Any ideas where to look for?

  18. Pierre Reply

    When I tried to login an the credentials didn’t work I rebooted my server and then it worked.

  19. Tonny Parada Reply

    I went through these great steps which worked beautifully, I RDP successfully but only issue is that the Authentication Required for cloud user keeps popping up even after entering the password correctly.

  20. Simon Reply

    Hi, I have the same problem: despite setting the root password as mentioned in step 7 I still cannot authenticate when the popup requests a “Cloud User” password.
    Could you advise on the matter please?
    Thanks a lot!

  21. Gilles Reply

    @Simon @Tonny if using CentOs change the password of the “centos” user instead of the “ec2-user”
    sudo passwd centos
    and use that password

  22. Haris Reply

    I am using RedHat 7 on aws and I followed all the steps from this tutorial. Everything went smoothly until I connected to instance, it just connects and after 1-2 seconds I lose connection, window is closed. I didn’t saw any errors anywhere, it is pretty strange.
    Maybe there is some limitation for RAM or CPU to be able to run GUI on redhat is causing this issue?
    Any advice?


  23. BChen Reply

    Hi, Haris and all,

    I had the same problem and I was able to resolve it by doing the following:

    1: install epel-release
    2: yum update

    After that, the issue was resolved.

  24. Zeeshan Sadar Reply

    I am getting following error in windows RDP session:

    Remote Desktop cant connect to the remote computer for one of these reasons
    1) REmote access to the server is not enabled
    2) The remote computer is turned off
    3) the remte computer is not available on the network

    Make sure the remote computer is turned on and connected to the network & the remote access is enabled.

    Need your guidance.

  25. Ineedjava Reply

    This works, but why is anything to do with Java display nothing. The window pop up in rdp , but display nothing. while in mobaxterm it display.

    Eg trying to display java console in mobaxterm works, but via rdp , it pop up , but display nothing.

  26. sourav sarkar Reply

    I am using RedHat 7 on aws and I followed all the steps from this tutorial. Everything went smoothly until I connected to instance, it just connects and after 1-2 seconds I lose connection, window is closed. Can anyone help on this?

  27. Raj Reply

    I succesfully completed above steps and i connected to RDP …after entering credentials it shows desktop for 2 seconds and i got lost my connection. what might be the problem?

    • Kalyan Reply


      Try and follow the instructions at

      I am not sure enabling EPEL or changing the value for colour at RDP solved the problem but it worked for me. Before doing this, I had the same problem.

      On Windows, open the Remote Desktop Connection client (mstsc.exe) and modify the default value for Colors located under the Display tab. Change this value from “Highest Quality (32 bit)” to a different value such as “High Color (16 bit)”

  28. Ianto McGuckin Reply

    Same as many others here. After connecting via RDP the connection is lost after 1-2 seconds. I can’t see the solution here?

  29. SRINIVASA Reply

    any updates on the connection termination after few seconds ? I have no issues connecting to the instance with Microsoft RDP but the connection terminates immediately.

Leave a Reply

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