The switching between graphical and command-line interfaces in Linux systems can be divided into two types, temporary switching and permanent switching.
Temporary switching is only valid for this time after switching, the system restarts the interface or the default interface.
Permanent switching is the interface that the system will always be in after switching on.
Temporary switching method
Graphical interface Switch command line interface:
Open Control terminal, enter Init 3, and then enter
The command line interface toggles the graphical interface:
Enter Init 5, and then enter
Permanent Switching method
Open/etc/inittab File
# Inittab is a used by upstart for the default runlevel.## ADDING other CONFIGURATION here'll has NO EFFECT on YOUR system.## System Initialization is started by/etc/init/rcs.conf## individual runlevels are started by/etc/init/rc.conf## Ctrl-alt-delete is handled by/etc/init/control-alt-delete.conf## Terminal gettys be handled by/etc/init/tty.conf and/ etc/init/serial.conf,# with the configuration in/etc/sysconfig/init.## for information on what to write upstart event handlers , or how# upstart works, see Init (5), init (8), and Initctl (8). # # # Default RunLevel. The runlevels used are:# 0-halt (do not set Initdefault to this) # 1-single user mode# 2-multiuser, Witho UT NFS (the same as 3, if you don't have networking) # 3-full multiuser mode# 4-unused# 5-x11# 6-r Eboot (do not set Initdefault to this) # Id:5:initdefault:
Change Id:5:initdefault: To Id:3:initdefault: Save the file and restart it
5 represents a graphical interface, set to 5 indicates that each boot system into the graphical interface
3 represents the command line interface, which is set to 3 to indicate that each boot system enters the command line interface
Other specified system RunLevel
0: Turn off the machine
1: Single-user mode
2: Multi-user mode but no network
3: Multi-user mode with network, which is the command line interface
4: System not used reserved to user
5:x11 mode to enter graphical interface mode
6: Restart
Graphical interface and command line interface switching in virtual machine-linux system