Compared with the version before 7, in the centos7 version, there is a change in setting the OS startup to enter the graphical interface or the text interface by default.
Check the current default settings
[root@rems2 ~]# systemctl get-default
graphical.target
graphical.target indicates that the boot will enter the graphical interface by default
Set boot into text interface
[root@rems2 ~]# systemctl set-default multi-user.target
Removed symlink /etc/systemd/system/default.target. Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/multi-user.target.
- 1
- 2
- 3
The reverse setting command is similar to [systemctl set-default graphical.target]
Read /etc/inittab, you can also find the following
[root@rems2 ~]# cat /etc/inittab
# inittab is no longer used when using systemd.
#
# ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target # # systemd uses 'targets' instead of runlevels. By default, there are two main targets: # # multi-user.target: analogous to runlevel 3 --->告诉我们multi-user.target相当于以前的runlevel 3 # graphical.target: analogous to runlevel 5 --->告诉我们graphical.target相当于以前的runlevel 5 # # To view current default target, run: # systemctl get-default # # To set a default target, run: # systemctl set-default TARGET.target