How to boot CentOS 7 into Command Line or GUI Mode

- by

CentOS-LogoIn CentOS 7 we can use the systemctl command to select which mode the OS boots into. If you have a GUI like Gnome or KDE installed, it’s easy to boot directly into your preferred environment.

To find out what mode CentOS is currently using, use this:

systemctl get-default

This will give you one of two “targets”, either

  • (the command line), or
  • (the Windows-like GUI)

To change from one to the other, use one of these commands:

systemctl set-default
systemctl set-default

What happened to runlevels?

In previous versions of CentOS, switching boot modes was achieved through runlevels. Those were saved in /etc/inittab, but this file is no longer used by CentOS 7 and above. However, the file still exists and contains a little extra info this matter, including how to change boot modes:

# analogous to runlevel 3
# analogous to runlevel 5
# To view current default target, run:
# systemctl get-default
# To set a default target, run:
# systemctl set-default

If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site witout any pesky ads! More details here.

Add your voice!

This site uses Akismet to reduce spam. Learn how your comment data is processed.