Tonight I started to review the learning material for Red Hat System Administration III to prepare for RHCSE exam. I need a machine with GUI, and all my CentOS 7 VMs are headless. So let’s install the GUI on it, shall I?

First install epel repo, if it’s not yet installed:

# yum install epel-release -y

Then install the 2 groups:

# yum groupinstall "X Window system" -y
# yum groupinstall "MATE Desktop" -y

Tip, if “I” can’t remember the names of the groups, I can run this command to list all available groups:

# yum group list

The last step is optional. But if I want the machine to boot up into the graphical login, I need to ensure that the default target is graphical.target. Usually, the default target is multi-user.target.

# systemctl set-default graphical.target

I think I can also switch to the graphical.target without rebooting by running:

# systemctl isolate graphical.target

Note, I didn’t test the above last command though, so it may just not work.

References: