Book Image

CentOS 7 Server Deployment Cookbook

By : Timothy Boronczyk, IRAKLI NADAREISHVILI
Book Image

CentOS 7 Server Deployment Cookbook

By: Timothy Boronczyk, IRAKLI NADAREISHVILI

Overview of this book

CentOS is derived from Red Hat Enterprise Linux (RHEL) sources and is widely used as a Linux server. This book will help you to better configure and manage Linux servers in varying scenarios and business requirements. Starting with installing CentOS, this book will walk you through the networking aspects of CentOS. You will then learn how to manage users and their permissions, software installs, disks, filesystems, and so on. You’ll then see how to secure connection to remotely access a desktop and work with databases. Toward the end, you will find out how to manage DNS, e-mails, web servers, and more. You will also learn to detect threats by monitoring network intrusion. Finally, the book will cover virtualization techniques that will help you make the most of CentOS.
Table of Contents (18 chapters)
CentOS 7 Server Deployment Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Installing the GNOME desktop


This recipe shows you how to install the GNOME desktop environment, which provides a graphical user interface (GUI) for working with your CentOS system. Usually, such environments aren't installed on server systems, but it can be convenient sometimes to have one available. For example, an administrator might feel more comfortable updating a system's configuration using graphical programs.

Note

GNOME isn't the only GUI environment available —other popular environments include KDE, XFCE, and Fluxbox. If GNOME isn't your cup of tea, the next recipe shows you how to install KDE.

Getting ready

This recipe requires a CentOS system with a working network connection. Administrative privileges are also required by logging in with the root account.

How to do it...

Follow these steps to install the GNOME desktop environment:

  1. Install the GNOME Desktop package group with yum groupinstall:

    yum groupinstall "GNOME Desktop"
    
  2. Manually start the desktop environment using startx:

    startx
    
  3. If more than one environment is installed, you'll need to specify the path to gnome-session:

    startx /usr/bin/gnome-session
    
  4. When you're done using GNOME and log out of the desktop, you'll be returned to the console.

  5. To configure the system to automatically start the graphical environment when it boots, set the default start up target to graphical.target:

    systemctl set-default graphical.target
    

How it works...

This recipe uses yum to install the GNOME desktop environment. All of the necessary components and dependencies are installed by the GNOME Desktop package group. Package groups saves us time and hassle because they let us install a collection of packages for a common task at the same time instead of individual packages one at a time.

yum groupinstall "GNOME Desktop"

Unlike Windows, where the graphical desktop is part of its operating system, Linux systems delegate basic graphics and input handling to a graphics server. This approach is one reason why there are several desktop environments to choose from —it abstracts many of the specifics and provides a common platform on top of which any number of environments can run, both locally and across a network. CentOS's default graphics server is X Window System.

If GNOME is the only desktop environment installed, it'll be run by default when we launch X with startx. However, if more than one desktop is installed, we need to tell X which one we want to run. For GNOME, we provide the path to gnome-session:

startx /usr/bin/gnome-session

The GNOME desktop provides a graphical interface for working with the system

The systemd service manager is responsible for starting various servers and processes when the system boots. The systemctl command is our interface to the service manager and can be used to set the default boot target. The default target dictates whether the system boots to a terminal or GUI-based login screen:

systemctl set-default graphical.target

When set to graphical, systemd starts X and the GNOME Display Manager when the system boots, which presents us with a graphical login to provide our account details. Once we're authenticated, the desktop session is initiated and we find ourselves at the GNOME desktop.

If you no longer want to boot to the graphical environment, you can set the default target back to multiuser and the system will boot to the terminal-based login screen again:

systemctl set-default multi-user.target

Note

You can choose which desktop environment you want to use if more than one environment is installed by selecting it from the gear button on the login screen:

You can select your preferred desktop from the login screen

See also

The following resources will provide you with more information about installing graphical desktop environments and using the GNOME desktop: