The desktop environment comes by default in most Linux distributions and is a favourite among the Linux community. It is the default desktop environment for CentOS, Debian, Fedora, Ubuntu and others. While the server-side of Linux, the administrators mostly use the terminal to carry out their work.
However, sometimes there can be exceptions, who prefer the graphical user interface. The default CentOS distribution comes with a minimal server installation that does not contain a GUI, and in this tutorial, we will add a graphical user interface on top of the minimal server.
This quick guide will cover how to install the GNOME 3 desktop on CentOS 7, which will provide a GUI for working with the Linux system.
Step 1: Installing GUI in CentOS
While there are many different graphical user interfaces for Linux, we will be using GNOME. Let’s go ahead and install the Gnome desktop package group using the following command.
Note: this might take some time as it comes together with hundreds of more packages. When we installed the GUI, it was downloading almost 1GB of data.
yum groupinstall "GNOME Desktop" –y
On RHEL 7:
yum groupinstall "Server with GUI"
Step 2: Starting the GUI
Once the installation is finished, it will not automatically be loaded during startup. This means that even if you reboot your system, it will not load the GUI.
First check for the default target by entering:
The output will be multi-user.target. The target is similar to the old run levels, in this case, multi-user.target is equivalent to run level 3. We instead set the default to the graphical.target which is equivalent to run level 5.
To do that enter the following command:
systemctl set-default graphical.target
Now let’s verify if the default target was changed by entering the following command:
You will see that the output will have graphical.target.
Once this is done reboot the system.
Once the reboot is done, all future boots will be booted to the graphical target by default.
Note that to access the server’s graphical user interface, you will need to have a VNC client installed in both server and the local computer. With 1Gbits, you can access the VNC client through our dashboard. If you’re not using 1Gbits, then we recommend to set-up VNC in order to access the GNOME desktop environment.
Removing the GUI
If you’ve installed the GUI on your CentOS server, but now you want to remove it, it’s quite simple. With just one command you can remove the GNOME GUI. However. Note that before removing the packages, ensure that the selected packages are okay to be removed.
yum groupremove "GNOME Desktop"
Throughout this short tutorial, we went through the process of adding the GNOME desktop environment to your CentOS 7 server. We covered the installation process and then went through some basic configurations so that the desktop environment will be booted up during startup.
We also accepted the license agreement so that there won’t be any pop-ups afterwards. We hope that this tutorial helped you and if so, we’re waiting for your feedback in the dedicated comment section below.