Linux beginners to of CnetOS7 Linux switching command mode and graphics mode

  • 2020-10-23 21:17:46
  • OfStack

Usually we also call the command mode the terminal interface,terminal or console.

By default, Linux will provide 6 Terminal to allow users to log in, toggle by using the [Ctrl] + [Alt] + [F1]~[F6] combination button.

How to name these six terminal interfaces? The system will name [F1] ~ [F6] as the operating interface environment of tty1 ~ tty6. In other words, when you press the three combined buttons [crtl] + [Alt] + [F1], you will enter the terminal interface of tty1.

Let's go back to the graphical interface

CentOS5

[Ctrl] + [Alt] + [F1] ~ [F6] : Command line mode login to tty1 ~ tty6 terminal;
[Ctrl] + [Alt] + [F7] : Graphical interface desktop.

CentOS7

[Ctrl] + [Alt] + [F2] ~ [F6] : Command line mode login tty1 ~ tty6 terminal;
[Ctrl] + [Alt] + [F1] : Graphical interface desktop.

CentOS5

In Linux's default login mode, there are two main types. One is the command-line only (so-called execution level run level 3) login environment. In this environment, you can have the terminal interface of tty1~tty6, but there is no GUI environment.

The other is the GUI login environment (so called execution level run level 5), where you have tty1~tty7! tty7 is the default graphical environment waiting for login after boot!

If you are on Linux in command line mode, the default tty7 has nothing! You can log in using your account at any terminal interface of tty1~tty6 and then issue the startx command.
For startx to work, there are at least a few things that need to happen:

There is no other window software running on your tty7 (tty7 must be empty); You must have X Window system installed, and X server is energizing; You'd better have a window manager, such as GNOME/KDE or TWM. To initiate services necessary for X, such as font servers (X Font Server, xfs) must first be invoked

CentOS7

Because the system default login interface is different, the name to enter the graphic terminal may also be different. If the installation default is a graphical interface, the image interface will appear in the tt1 interface. If your linux default USES a text interface, then tt1 and tt6 will be occupied by command line mode
Launch the GUI from the command line environment and the GUI will appear on top of tty. For example, if you log in to tt3 and type in startx to launch the GUI, the GUI will be generated on tt3.
For startx to work, there are at least a few things that need to happen:

The graphical interface is not launched under other tt You must have X Window system installed, and the X server is energizing. You'd better have a window manager, such as GNOME/KDE or TWM.

CentOS7 has abolished the service management mode of SystemV, which has been used for many years. In other words, since this release, there has been no concept of "execution level (run level)". The new management method USES the systemd mode, which manages many services according to their requirements

If you want the system to start in a certain way by default

Use systemd to create symbolic links to point to the default run level.

The modification method is:

1. First remove existing symbolic links


rm /etc/systemd/system/default.target

2. Default level conversion to 3(text mode)


ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

Or the default level is 5(graphic mode)


ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

3. Restart


reboot

Related articles: