How To Start GUI In CentOS 7 Linux

By default a full installation of CentOS 7 will have the graphical user interface (GUI) installed and it will load up at boot, however it is possible that the system has been configured to not boot into the GUI.

In this quick guide we will show you how to swap to the GUI and enable it to start up by default on system boot.

Start GUI In CentOS

In this example I have installed CentOS 7 but we are not currently using the GUI. With the systemctl command, we can list the default target that the system is configured to boot into.

[[email protected] ~]# systemctl get-default
multi-user.target

The multi-user.target is similar to the well known run level 3, which is essentially console only with networking enabled.

We can start the GUI right now (as long as there is a GUI installed) by running ‘systemctl isolate graphical.target’.

[[email protected] ~]# systemctl isolate graphical.target

While this will start the graphical user interface by moving us into the graphical target (similar to run level 5), if we perform a reboot we will not be presented with the GUI. To do this, we must first set the graphical target to become the default.

[[email protected] ~]# systemctl set-default graphical.target
Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/graphical.target.

Now if we reboot the system we will automatically boot into the GUI, which ever version you may have installed. If you’re interested in changing things up, check out our posts on installing different GUIs in CentOS.

Summary

We have seen that we can easily change the current target to the graphical target at run time, and to set the system to boot to the graphical target automatically.

  1. Stupid question perhaps, but how on earth do you stop gnome and return to the console? I mean I do not want gnome to be my permanent user interface, so I can use “systemctl isolate graphical.target” to start it whenever I want, bubt how on earth do I exit from it?!?!

    • You’d want to do the opposite to this, so “systemctl set-default multi-user.target”.

      • I want the default target to be multi-user , but also want to be able to switch between the graphical desktop and the console as needed…without needing root access.

        ie.
        Boot system to console
        Login as non-root user
        Start the gnome desktop to complete a task that requires it
        Return to console.

        Can this be done?

        • Exactly! I am not even interested in set-default graphical.target. Jusst start gnome, do whatever I need to do in it and exit to the console again.

          I think I could do it in Centos 6, but I no longer remember how I did it!!!

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>