Ubuntu+ virtual machine switch between graphical interface and command line interface (pro-test is feasible!! Solve the problem of shortcut keys failure in Ubuntu!!)

A few days ago, the operating system experiment needed to switch between the graphical interface and the command line interface of the virtual machine. Various methods were found on the csdn, such as the shortcut keys Ctrl+Alt+F1, Ctrl+Alt+shift+F1, etc., and the virtual machines are all connected. There was no response, I could only slowly explore to find an effective method, and finally got a feasible method. Now I have summarized it. Please share it if you find it useful. ! !

Graphical interface switch to command line interface

1. After opening the virtual machine, open the terminal, enter the command sudo su, and enter the password to enter the super user mode;
2. Enter the command sudo vi /etc/default/grub to enter the file; change the line starting with "GRUB_CMDLINE_LINUX_DEFAULT=" Enter GRUB_CMDLINE_LINUX_DEFAULT="text", then enter ESC+:+wq to save the file and exit;
3. Enter the command sudo update-grub to update the grub configuration information;
4. Enter the command systemctl set-default multi-user.target to set the boot entry command Run mode;
5. Enter the command reboot to restart Ubuntu; through the above operations, you can see that the virtual machine enters the command line mode after booting.
(After entering the command line mode, the system will ask for the user name and password. The interface will not be displayed when the password is entered, and you can start using the command line mode if you enter it correctly!)

Switch from command line interface to graphical interface

Enter the command startx in the command line mode and press Enter.

Guess you like

Origin blog.csdn.net/abbcdc/article/details/108684802