How to install GUI desktop on CentOS 7

Install GNOME desktop via the groups option of yum:

$ yum update
$ yum -y groups install "GNOME Desktop"

Inform the startx command which desktop env to run:

$ echo "exec gnome-session" >> ~/.xinitrc

Manually start the GUI desktop:

$ startx

Automaticlly start the GUI desktop after reboot:

$ systemctl set-default graphical.target
$ reboot