{"id":723,"date":"2021-02-17T01:52:00","date_gmt":"2021-02-17T01:52:00","guid":{"rendered":"https:\/\/blog.ngocha.biz\/?p=723"},"modified":"2021-02-17T01:52:00","modified_gmt":"2021-02-17T01:52:00","slug":"how-to-setup-gui-for-amazon-ec2-rhel-7-instance","status":"publish","type":"post","link":"https:\/\/blog.ngocha.biz\/?p=723","title":{"rendered":"How To Install and Configure GUI for Amazon EC2 RHEL 7\u00a0&#038; 8"},"content":{"rendered":"<p>In this tutorial, I have explained the easy steps to configure GUI for the RedHat 7 &amp; 8 EC2 instance and connect to it using RDP clients.<\/p>\n<div class=\"kg-card kg-callout-card kg-callout-card-grey\">\n<div class=\"kg-callout-text\"><b><strong style=\"white-space: pre-wrap;\">Note:<\/strong><\/b>&nbsp;For RHEL 6 follow this tutorial.&nbsp;<a href=\"https:\/\/devopscube.com\/setup-gui-for-amazon-ec2-linux\/\" target=\"_blank\" rel=\"noreferrer\"><b><strong style=\"white-space: pre-wrap;\">Setting up GUI on RHEL6<\/strong><\/b><\/a><\/div>\n<\/div>\n<h2 id=\"gui-for-amazon-ec2-rhel-7-rhel-8\">GUI for Amazon EC2 RHEL 7 &amp; RHEL 8<\/h2>\n<p>There are three sections involved in the whole setup. Follow all the three sections explained below to successfully configure the GUI.<\/p>\n<div class=\"kg-card kg-callout-card kg-callout-card-grey\">\n<div class=\"kg-callout-text\"><b><strong style=\"white-space: pre-wrap;\">Note:<\/strong><\/b> This tutorial is tested on both RHEL 7 and RHEL 8 ec2 instances.<\/div>\n<\/div>\n<h2 id=\"prerequisites\">Prerequisites<\/h2>\n<ol>\n<li>RHEL 7 or 8 ec2 instance with <strong>minimum instance type of t2.medium<\/strong>. The GUI won&#8217;t load on smaller instance types.<\/li>\n<li>ec2 instance security group should have an <strong>inbound connection to 3389 port<\/strong>.<\/li>\n<\/ol>\n<h2 id=\"installing-gui-components\">Installing GUI Components<\/h2>\n<p>1. Update the server using the following command.<\/p>\n<pre><code>sudo yum -y update<\/code><\/pre>\n<p>2. Install the gnome GUI components using the following command.<\/p>\n<pre><code>sudo yum groupinstall -y \"Server with GUI\"<\/code><\/pre>\n<p>3. Issue the following commands to start the GUI during boot.<\/p>\n<pre><code>sudo systemctl set-default graphical.target\nsudo systemctl default<\/code><\/pre>\n<p>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.<\/p>\n<div class=\"kg-card kg-callout-card kg-callout-card-grey\">\n<div class=\"kg-callout-text\"><b><strong style=\"white-space: pre-wrap;\">Recommended:<\/strong><\/b> <a href=\"http:\/\/crunchadeal.com\/coupon\/93-off-coupon-learn-linux-in-5-days-and-level-up-your-career\/?ref=devopscube.com\">Learn Linux in 5 Days and Level Up Your Career Udemy Course<\/a><\/div>\n<\/div>\n<h2 id=\"setting-up-xrdp\">Setting up XRDP<\/h2>\n<p>1. Add the xrdp repository to your instance using the following command.<\/p>\n<pre><code>sudo rpm -Uvh http:\/\/li.nux.ro\/download\/nux\/dextop\/el7\/x86_64\/nux-dextop-release-0-1.el7.nux.noarch.rpm<\/code><\/pre>\n<p>2. Install xrdp and tiger VNC server.<\/p>\n<pre><code>sudo yum install -y xrdp tigervnc-server<\/code><\/pre>\n<p>3. Setup SELINUX security using the following commands.<\/p>\n<pre><code>chcon --type=bin_t \/usr\/sbin\/xrdp \nchcon --type=bin_t \/usr\/sbin\/xrdp-sesman<\/code><\/pre>\n<p>4. Start and enable the xrdp service.<\/p>\n<pre><code>sudo systemctl start xrdp \nsudo systemctl enable xrdp<\/code><\/pre>\n<p>5. Enable RDP port on the instance using the following firewall commands.<\/p>\n<pre><code>sudo firewall-cmd --permanent --add-port=3389\/tcp \nsudo firewall-cmd --reload<\/code><\/pre>\n<p>6. Set a password for ec2-user . This password will be used to connect to the RDP session.<\/p>\n<pre><code>sudo passwd ec2-user<\/code><\/pre>\n<p>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.<\/p>\n<pre><code>sudo su \npasswd<\/code><\/pre>\n<p>Now we have the xdrp components and all instance-level settings in the right place. Now let&#8217;s test out the RDP connection from an RDP client.<\/p>\n<p>In this tutorial, I am using a windows RDP client.<\/p>\n<p>If you are using MAC, you can use the Microsoft Remote Desktop app to connect.<\/p>\n<h2 id=\"connecting-the-instance-using-rdp\">Connecting the Instance Using RDP<\/h2>\n<div class=\"kg-card kg-callout-card kg-callout-card-grey\">\n<div class=\"kg-callout-text\"><b><strong style=\"white-space: pre-wrap;\">Note:<\/strong><\/b> Make sure you have added the inbound RDP port (3389) in your instance security group.<\/div>\n<\/div>\n<p>1. Open RDP client and type in the public IP of your instance and click connect.<\/p>\n<p>2. If you get a warning message about remote identity, just click yes.<\/p>\n<p>3. Now you will get a xrdp authentication window, enter the credentials and click ok.<\/p>\n<div class=\"kg-card kg-callout-card kg-callout-card-grey\">\n<div class=\"kg-callout-text\"><b><strong style=\"white-space: pre-wrap;\">Note: <\/strong><\/b>The username is &#8220;ec2-user&#8221; and the password is the password you set for ec2-user in step 6.<\/div>\n<\/div>\n<p>4. You will be prompted to enter the password again. Provide the password and proceed to the steps to configure the initial desktop.<\/p>\n<p>5. If it prompts for &#8220;cloud user password&#8221; provide the root user password you set in step 7.<\/p>\n<p>6. That&#8217;s it, you will get a GUI session as shown below. If you face any errors do let me know in the comment session.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/rhel-7-ec2-gui-3.png\" class=\"kg-image\" alt=\"amazon ec2 rhel 7 gui\" loading=\"lazy\" width=\"1310\" height=\"603\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/rhel-7-ec2-gui-3.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/03\/rhel-7-ec2-gui-3.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/rhel-7-ec2-gui-3.png 1310w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<hr>\n<p><strong>Ngu\u1ed3n:<\/strong> <a href=\"https:\/\/devopscube.com\/how-to-setup-gui-for-amazon-ec2-rhel-7-instance\/\" target=\"_blank\" rel=\"noopener noreferrer\">How To Install and Configure GUI for Amazon EC2 RHEL 7\u00a0&amp; 8 \u2014 DevOpsCube<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Source: https:\/\/devopscube.com\/how-to-setup-gui-for-amazon-ec2-rhel-7-instance\/<\/p>\n","protected":false},"author":1,"featured_media":724,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-723","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/723","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=723"}],"version-history":[{"count":0,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/723\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/media\/724"}],"wp:attachment":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}