• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar

The Geek Diary

HowTos | Basics | Concepts

  • Solaris
    • Solaris 11
    • SVM
    • ZFS
    • Zones
    • LDOMs
    • Hardware
  • Linux
    • CentOS/RHEL 7
    • RHCSA notes
    • SuSE Linux Enterprise
    • Linux Services
  • VCS
    • VxVM
  • Interview Questions
  • oracle
    • ASM
    • mysql
    • RAC
    • oracle 12c
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Hadoop
    • Hortonworks HDP
      • HDPCA
    • Cloudera
      • CCA 131

How to Install GUI for CentOS/RHEL 5,6,7

By admin

There are 2 possible paths to resolve the issue:

  1. Method A: Install the desktop related package groups after system install (Recommended)
  2. Method B: Select “Desktop” mode (Server with a GUI in RHEL 7) as the default installation mode

Method A: Install the desktop related package groups after system install (Recommended)

The following package groups need to be installed to boot a RHEL system into a graphical desktop environment with a recommended feature set:

CentOS/RHEL 7

# yum groupinstall gnome-desktop x11 fonts

For RHEL 7 Server you can target the “Server with GUI” group instead.

# yum groupinstall "Server with GUI"

CentOS/RHEL 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

CentOS/RHEL 5

– Recommended:

# yum groupinstall gnome-desktop base-x graphical-internet admin-tools

– Minimal

# yum groupinstall gnome-desktop base-x

Set the system to boot directly into the GUI in CentOS/RHEL 7

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 start graphical.target

Set the system to boot directly into the GUI in CentOS/RHEL 5 and 6

After installing the appropriate packages, modify the default runlevel as defined in the /etc/inittab file. 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‘.

# init 5

If you wish to start the GUI in single-user mode, run the command startx from runlevel 3.

# startx

Method B: Select “Desktop” mode as the default installation mode

In this method you have to select Desktop mode while installing the operating system itself. So thie method is only valid if you have not installed the OS yet. Select “Server with a GUI” for RHEL 7 as shown in the diagram below.

RHEL 7 software selection

RHEL 7 server with GUI

Troubleshooting

Check to see what groups of packages are available from repository.

CentOS/RHEL 5,6

# yum grouplist

The Following is some example output from yum (RHEL 5 & 6)

# 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:

Here,
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)

CentOS / RHEL 7 : How to Install GUI

Filed Under: CentOS/RHEL 5, CentOS/RHEL 6, CentOS/RHEL 7, Fedora, Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 7 : How to set default target (default runlevel)
  2. Linux OS Service ‘vncserver’
  3. Linux OS Service ‘setroubleshoot’
  4. How to Configure Separate Port For SSH and SFTP On CentOS/RHEL
  5. CentOS / RHEL 7 : How to follow the mount order in /etc/fstab
  6. Linux OS Service ‘haldaemon’
  7. What are the Network Bonding Modes In CentOS / RHEL
  8. CentOS / RHEL : How to create and host yum repository over httpd
  9. Examples of creating command alias in different shells
  10. CentOS / RHEL 7 : How to disable Transparent Huge pages (THP)

You May Also Like

Primary Sidebar

Recent Posts

  • How to set the order to load certain modules in CentOS/RHEL 7 and 8
  • How to configure initrd / initramfs to including kernel modules in CentOS/RHEL
  • How to configure systemd.path to trigger an event when any changes made to a directory
  • Script to monitor RMAN Backup and Restore Operations
  • Oracle RMAN Backup Shell Script Example
  • Archives
  • Contact Us
  • Copyright

© 2019 · The Geek Diary