How To Setup A Desktop Environment in Cent OS 7
4 mins read

How To Setup A Desktop Environment in Cent OS 7

Description 

A default CentOS 7 instance comes with a graphical user interface (GUI) installed.

However, in case you have decided to skip the GUI installation, or are using a minimal distribution, you can always set up your visual environment later.

As CentOS is a distribution typically aimed for systems administrators, most users prefer working on their system over the terminal.

You can check with the centos plan details

#The most common desktop environments for Linux distributions

GNOME3
KDE Plasma 5
Cinnamon
MATE
Xfce

 

Step 1 : 

Check with the available group list using below command

[root@vps ~]# yum group list

 

Now we are going to look about installing of Gnome desktop

Step 2 : 

Execute the below command to install GNOME 3 desktop environment

[root@vps ~]# yum -y groupinstall “GNOME Desktop”

 

This will take some time to install.

Once this is done, execute the command- startx. This is used to start the GUI.

[root@vps ~]# startx

 

Step 3 : 

The GNOME desktop environment is now set up.

For the initial boot, you will have to configure the following

System Language
Keyboard type
Online accounts

 

Once you’ve entered your preferred settings for the items listed above, GNOME Desktop will have started in Classic mode.

You can check the default settings by using the below command

 

[root@vps ~]# systemctl get-default

 

This will return the default type- multi-user.target

 

[root@vps ~]# multi-user.target

 

Step 4 : 

We can change this setting to GNOME shell by using either of the two options detailed below

Option 1, If you use the startx command to start the service, you can then execute the following

 

[root@vps ~]# echo “exec gnome-session” >> ~/.xinitr
[root@vps ~]# startx

 

Option 2, use the command systemctl set-default graphical.target and reboot the system

[root@vps ~]# systemctl set-default graphical.target

After reboot, click the button next to Sign In.

Select GNOME from the list.

Click Sign in and you will have logged in with a GNOME shell.

Step 5 : 

Here is a list of systemd targets with the specific level defined.

By default, this is set to level 3 and in order to use a GUI we must change it to level 5.

 

RUN LEVEL TARGET UNITS DESCRIPTION
0 runlevel0.target, poweroff.target Shut down and power off the system
1 runlevel1.target, rescue.target Set up a rescue shell
2 runlevel2.target, multi-user.target Set up a non-graphical multi-user system
3 runlevel3.target, multi-user.target Set up a non-graphical multi-user system
4 runlevel4.target, multi-user.target Set up a non-graphical multi-user system
5 runlevel5.target, graphical.target Set up a graphical multi-user system
6 runlevel6.target, reboot.target Shut down and reboot the system

 

Step 6 : Installing KDE DESKTOP 

To install the KDE environment you can use the command- yum -y groupinstall “KDE”

[root@vps ~]# yum -y groupinstall “KDE”

 

This will take some time to complete. After the installation is complete, use the following commands to start in GUI mode

[root@vps ~]# startx

Reboot the system and you will be able see the KDE desktop environment up and running.

 

Step 7 : Installing CINNAMON DESKTOP

Before starting the Cinnamon installation, you will have to add the EPEL (Extra Packages for Enterprise Linux) repository to your system.

Use the  Link  to know about EPEL repository

Then use the command- yum install cinnamon -y to complete the installation.

[root@vps ~]# yum install cinnamon -y

Once the installation is complete, you can use following commands to start the GUI.

The Cinnamon desktop will be seen on reboot. As usual, the first time you use it you will have to set language preferences, among other things.

[root@vps ~]# echo "exec /usr/bin/cinnamon-session">> ~/.xinitrc
[root@vps ~]# startx

 

Step 8 : Installing MATE DESKTOP 

Similar to Cinnamon, you will have to first install the EPEL repository in case it is not already present, using the command- yum install epel-release -y.

Once this is done, you can install MATE desktop using the command – yum groupinstall “MATE Desktop”

[root@vps ~]# yum groupinstall “MATE Desktop”

You can now start the environment and reboot the system to make it effective

[root@vps ~]# echo "exec /usr/bin/cinnamon-session">> ~/.xinitrc
[root@vps ~]# startx

 

Step 9 : Installing XFCE DESKTOP

For our final desktop environment, first install the EPEL repository using the command- yum install epel-release -y.

Then, you may install Xfce using the command- yum groupinstall xfce -y

[root@vps ~]# yum groupinstall xfce -y

Once installed, you can execute the following commands to start Xfce.

[root@vps ~]# echo "exec /usr/bin/cinnamon-session">> ~/.xinitrc
[root@vps ~]# startx

 

We hope you’ve found this useful!

Leave a Reply

Your email address will not be published. Required fields are marked *