How to install a graphical user interface (GUI) for Red Hat Enterprise Linux?
Environment
- Red Hat Enterprise Linux 4
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Red Hat Enterprise Linux 10
- GNOME Desktop Environment
- K Desktop Environment(KDE)
- X Window System
Issue
- After installing Red Hat Enterprise Linux, the system does not boot to a GUI mode.
X Windows Systemwas not selected during the install, how can it be added post-install?- Getting error message:
Unable to import modules. Maybe you're not running under X? - Unable to boot to GUI mode
startxcommand is not working.- How to install K Desktop Environment ( KDE) post install on Red Hat Enterprise Linux 6/7?
- How to install the GNOME Desktop Environment from text mode on Red Hat Enterprise Linux 5/6/7?
- Which packages need to be installed on RHEL for starting the X11 server?
- Need help to get "X Windows" system started on RHEL.
- Which rpm packages are required for graphical display?
Resolution
- Make sure the required packages for GUI are installed on the system
- Minimum required components to get working the GUI screen on start-up are as below:
X server (Xorg)
Desktop environment (Gnome or KDE)
Display manager (gdm or kdm)
- Minimum required components to get working the GUI screen on start-up are as below:
There are 2 possible paths to resolve the issue:
- Resolution A: Install the desktop related package groups after system install (Recommended)
- Resolution B: Select "Desktop" mode (Server with a GUI in RHEL 7) as the default installation mode in Anaconda
- This method is only to be used if you intend to completely reinstall the operating system
Resolution A: Install the desktop related package groups after system install (Recommended)
Requires internet connection and valid registration & entitlement
The following package groups need to be installed to boot a RHEL system into a graphical desktop environment with a recommended feature set:
Red Hat Enterprise Linux 10
Recommended
# yum group install GNOME Fonts
or
# yum groupinstall "Server with GUI"
Red Hat Enterprise Linux 8 & 9
Recommended
# yum group install GNOME base-x Fonts
or
# yum groupinstall "Server with GUI"
Red Hat Enterprise Linux 7
Recommended
# yum groupinstall gnome-desktop x11 fonts
For RHEL 7 Server you can target the "Server with GUI" group instead
# yum groupinstall "Server with GUI"
Red Hat Enterprise Linux 6
Recommended
# yum groupinstall Desktop "General Purpose Desktop" "Desktop Platform" "X Window System" "Internet Browser" "Graphical Administration Tools" Fonts
Minimal
# yum groupinstall Desktop "X Window System" Fonts
Red Hat Enterprise Linux 5
Recommended
# yum groupinstall gnome-desktop base-x graphical-internet admin-tools
Minimal
# yum groupinstall gnome-desktop base-x
Red Hat Enterprise Linux 4
Recommended
# up2date "@X Window System" "@GNOME Desktop Environment" "@Graphical Internet"
Minimal
# up2date "@X Window System" "@GNOME Desktop Environment"
Note: Each package group should be enclosed with double-quotes
Set the system to boot directly into the GUI in RHEL7, RHEL8 & RHEL9:
- After installing the appropriate packages, change the default systemd boot target to
graphical.target. If you run into any errors, try updating the system first with 'yum update'.
# systemctl set-default graphical.target
- To immediately switch to the GUI login, start the graphical.target:
# systemctl isolate graphical.target
Set the system to boot directly into the GUI in RHEL 4, 5, and 6:
- After installing the appropriate packages, modify the default runlevel as defined in the
/etc/inittabfile. Run the following command to do so. This will change the system's default runlevel from runlevel 3 to runlevel 5, which will boot the system to the GUI login screen by default.
# sed -i 's,^id:.:initdefault:,id:5:initdefault:,' /etc/inittab
- Finally, switch the system to runlevel 5 by running the command
init 5 - If you wish to start the GUI in single-user mode, run the command
startxfrom runlevel 3
Resolution B: Select "Desktop" mode as the default installation mode in Anaconda. After installation, the system will boot into a graphical Desktop:
- Select Desktop mode as described in the Installation Guide - Package Group Selection
- Select "Server with a GUI" for RHEL 7
Additional Notes:
- For more detailed information, please review the following:
- How to register and subscribe a system to the Red Hat Customer Portal using Red Hat Subscription-Manager
- What is yum? How to use it?
- What is the difference between "Desktop" and "General Purpose Desktop" package groups in RHEL?
- How to install a group of packages with yum on Red Hat Enterprise Linux 5
- Why I can't use 'startx' command to start X Server on RHEL7 with "X window system" package group?
Root Cause
- Graphical interface not properly installed
- No graphical interface installed
- Default runlevel set incorrectly
Diagnostic Steps
-
Check to see what groups of packages are available from RHN (your system must already be registered with RHN in order to see the available and installed groups).
-
RHEL4
# up2date --show-groups -
RHEL5 and RHEL6
# yum grouplist
-
-
The Following is some example output from up2date (RHEL4) and yum (RHEL 5 & 6)
# up2date --show-groups Administration Tools Arabic Support Assamese Support Authoring and Publishing Base Bengali Support Brazilian Portuguese Support British Support Bulgarian Support Catalan Support Chinese Support# yum grouplist Loaded plugins: product-id, rhnplugin, security This system is receiving updates from RHN Classic or RHN Satellite. Setting up Group Process Installed Groups: Additional Development Base Console internet tools Debugging Tools Desktop Platform Directory Client E-mail server Available Groups: Backup Client Backup Server CIFS file server Client management tools Compatibility libraries Desktop Desktop Debugging and Performance Tools Desktop Platform Development Development tools Dial-up Networking Support Directory Server Eclipse Emacs
For graphical interface purposes, focus on "X Window System" and either "GNOME Desktop Environment" (just called "Desktop" in RHEL 6) or "KDE (K Desktop Environment)".
-
Check your default runlevel:
# grep ^id: /etc/inittab id:3:initdefault:
id:3:initdefault: = single user, no GUI at boot.(GUI can be started using the 'startx' command if a GUI is installed)
id:5:initdefault: = multi-user, GUI Support (GUI should already be started and running at boot)
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.