In this article, you will learn how to install GUI on Red Hat Enterprise Linux 7 & 8 deployed on Azure and access the server via the GUI environment.
UNDERSTANDING THE SUBJECT MATTER
For a long time I have been administering Microsoft Azure and Linux servers hosted on Azure, I did not think one day about GUI on Linux, or rather didn’t occur to me that I may want to access the server via the GUI until one morning, I got an email from a customer that he needed to configure a printer and he requested that he access his server via GUI. Yours may be for another reason or whatsoever, hence why I have decided to give a tutorial on this subject matter.
Yes, Red Hat has a GUI if you install the “Server with GUI” package group, but Red Hat Enterprise Linux servers deployed on Azure by default comes with minimal installation and not with GUI. There are two ways to verify this.
One of the ways is to use the command,
yum grouplist
The output of the command will show that the “Server with GUI” group package is among the “available environmental group” and not in the “installed environment group”
Another way to verify is from Boot Diagnostics on the Azure portal.
From the Azure portal, navigate to virtual machine > Boot diagnostics
When you click on Boot diagnostics, this is what you will see.
You can see that there is no GUI console available compared to when it is available when we install it in the “ACTION TIME” section.
More so, installing the package group is not enough, after installation, there is still a need to access the server via the GUI. Therefore, there will be a need for a tool that can do that. In this tutorial, we will be using the xrdp, tigervnc and the xterm tool.
Now, let’s start the configuration.
ACTION TIME
[root@lab02 ~]# yum grouplist
Updating Subscription Management repositories.
Last metadata expiration check: 0:04:44 ago on Fri 31 Jan 2020 06:20:10 PM UTC.
Available Environment Groups:
Server with GUI
Server
Minimal Install
Workstation
Virtualization Host
Custom Operating System
Available Groups:
RPM Development Tools
Container Management
.NET Core Development
System Tools
Network Servers
Development Tools
Legacy UNIX Compatibility
Security Tools
Graphical Administration Tools
Smart Card Support
Scientific Support
Headless Management
[root@lab02 ~]#
[root@Linuxserver ~]# yum groupinstall “Server with GUI”
[root@Linuxserver ~]# yum grouplist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
: manager
Installed Environment Groups:
Server with GUI
Available Environment Groups:
Minimal Install
Infrastructure Server
File and Print Server
Basic Web Server
Virtualization Host
[root@Linuxserver ~]# runlevel
N 3
[root@Linuxserver ~]# systemctl set-default graphical.target
Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/graphical.target.
[root@Linuxserver ~]#
[root@Linuxserver ~]# runlevel
N 3
[root@Linuxserver ~]# systemctl status graphical.target
● graphical.target – Graphical Interface
Loaded: loaded (/usr/lib/systemd/system/graphical.target; enabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:systemd.special(7)
[root@Linuxserver ~]# systemctl start graphical.target
[root@Linuxserver ~]# systemctl status graphical.target
● graphical.target – Graphical Interface
Loaded: loaded (/usr/lib/systemd/system/graphical.target; enabled; vendor preset: disabled)
Active: active since Sat 2020-02-01 12:01:42 UTC; 18s ago
Docs: man:systemd.special(7)
Feb 01 12:01:42 Linuxserver systemd[1]: Reached target Graphical Interface.
[root@Linuxserver ~]# runlevel
3 5
[root@Linuxserver ~]#
Now that you have the GUI installed, we need a GUI console. I usually use Xming for my KVM vm’s and RDP for Azure VM’s anytime I need to use the GUI.
[root@Linuxserver ~]# firewall-cmd – -add-port=3389/tcp – -permanent
success
[root@Linuxserver ~]# firewall-cmd – -reload
success
NOTE: The XRDP package is not in the default Red Hat Repositories, the reason you will need to add an extra repository.
[root@Linuxserver ~]# yum install
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
epel-release-latest-7.noarch.rpm | 15 kB 00:00:00
Examining /var/tmp/yum-root-9pjCLI/epel-release-latest-7.noarch.rpm: epel-release-7-12.noarch
Marking /var/tmp/yum-root-9pjCLI/epel-release-latest-7.noarch.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package epel-release.noarch 0:7-12 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
========================
Package Arch Version Repository Size
========================
Installing:
epel-release noarch 7-12 /epel-release-latest-7.noarch 24 k
Transaction Summary
=========================
Install 1 Package
Total size: 24 k
Installed size: 24 k
Is this ok [y/d/N]:
[root@Linuxserver media]# yum install xrdp
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
: manager
epel/x86_64/metalink | 27 kB 00:00
epel | 5.3 kB 00:00
rhui-microsoft-azure-rhel7 | 2.1 kB 00:00
rhui-rhel-7-server-dotnet-rhui-debug-rpms | 2.1 kB 00:00
rhui-rhel-7-server-dotnet-rhui-rpms | 2.3 kB 00:00
Total download size: 426 k
Installed size: 2.1 M
Is this ok [y/d/N]:
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
Userid : “Fedora EPEL (7)
Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
Package : epel-release-7-12.noarch (@/epel-release-latest-7.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:xrdp-0.9.12-1.el7.x86_64 1/1
Verifying : 1:xrdp-0.9.12-1.el7.x86_64 1/1
Installed:
xrdp.x86_64 1:0.9.12-1.el7
Complete!
[root@Linuxserver media]#
[root@Linuxserver ~]# yum install tigervnc xterm
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
: manager
Resolving Dependencies
–> Running transaction check
—> Package tigervnc.x86_64 0:1.8.0-17.el7 will be installed
–> Processing Dependency: tigervnc-icons for package: tigervnc-1.8.0-17.el7.x86_64
–> Processing Dependency: libfltk.so.1.3()(64bit) for package: tigervnc-1.8.0-17.el7.x86_64
–> Processing Dependency: libfltk_images.so.1.3()(64bit) for package: tigervnc-1.8.0-17.el7.x86_64
–> Running transaction check
—> Package fltk.x86_64 0:1.3.4-1.el7 will be installed
–> Processing Dependency: libGLU.so.1()(64bit) for package: fltk-1.3.4-1.el7.x86_64
[root@Linuxserver ~]# systemctl start xrdp
[root@Linuxserver ~]# systemctl enable xrdp
Created symlink from /etc/systemd/system/multi-user.target.wants/xrdp.service to /usr/lib/systemd/system/xrdp.service.
[root@Linuxserver ~]#
[root@Linuxserver ~]# systemctl status xrdp
● xrdp.service – xrdp daemon
Loaded: loaded (/usr/lib/systemd/system/xrdp.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2020-02-01 20:36:40 UTC; 3min 53s ago
Docs: man:xrdp(8)
man:xrdp.ini(5)
Main PID: 56092 (xrdp)
Tasks: 1
CGroup: /system.slice/xrdp.service
└─56092 /usr/sbin/xrdp –nodaemon
Feb 01 20:36:40 Linuxserver systemd[1]: Started xrdp daemon.
Feb 01 20:36:40 Linuxserver xrdp[56092]: (56092)(140210146920896)[INFO ] sta…2
Feb 01 20:36:40 Linuxserver xrdp[56092]: (56092)(140210146920896)[INFO ] add…1
Feb 01 20:36:40 Linuxserver xrdp[56092]: (56092)(140210146920896)[INFO ] lis…0
Feb 01 20:36:40 Linuxserver xrdp[56092]: (56092)(140210146920896)[INFO ] xrd…e
Hint: Some lines were ellipsized, use -l to show in full.
[root@Linuxserver ~]#
NOTE: You may need to restart the server before you can RDP. If it doesn’t allow you RDP, do a restart.
For those who are using RHEL 8 and have trouble with yum or dnf
sudo sed -i ‘s/$releasever/8/g’ /etc/yum.repos.d/epel*.repo