There are 2 possible paths to resolve the issue:
- Method A: Install the desktop related package groups after system install (Recommended)
- 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:
# yum groupinstall gnome-desktop x11 fonts
For RHEL 7 Server you can target the “Server with GUI” group instead.
# yum groupinstall "Server with GUI"
# yum groupinstall Desktop "General Purpose Desktop" "Desktop Platform" "X Window System" "Internet Browser" "Graphical Administration Tools" Fonts
# yum groupinstall Desktop "X Window System" Fonts
# yum groupinstall gnome-desktop base-x graphical-internet admin-tools
# 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.
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.
Check to see what groups of packages are available from repository.
# 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:
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)