How to enter the command line after the GUI starts in Ubuntu/debian

Source: Internet
Author: User

The Linux desktop comes with a display manager (for example, GDM, KDM, LIGHTDM), which allows the computer to start automatically into a GUI-based logon environment. However, what if you want to start directly into the terminal? For example, you are troubleshooting desktop-related issues or want to run an application that does not require a GUI.

Note that although you can temporarily switch from the desktop GUI to the virtual terminal by pressing CTRL+ALT+F1 to F6. However, in this case your desktop GUI is still running in the background, which is different from the plain text mode boot.

On Ubuntu or Debian desktops, you can start text mode at startup by passing the appropriate kernel parameters.

Start Temporary access command line

If you want to disable the desktop GUI and temporarily enter text mode, you can use the Grub menu.

First, turn on your computer. When you see the initial Grub menu, press ' E '.

Then you go to the next screen, where you can modify the kernel startup options. Scroll down to the line starting with "Linux", which is the list of kernel parameters. Deletes "quiet" and "splash" from the parameter list. Add "text" to the argument list.

The list of upgraded kernel options looks like this. Press CTRL+X to continue booting. This will start the console in verbose mode once (LCTT) the next reboot will go into the GUI because no changes have been saved.

To permanently boot into the command line

If you want to permanently boot into the command line, you need to update the kernel startup parameter grub settings defined.

Open the default grub configuration file in a text editor.

$ sudo vi/etc/default/grub

Find the line that starts with Grub_cmdline_linux_default, and annotate the line with "#". This disables the splash screen and starts verbose mode (that is, displays a detailed boot process).

Change grubcmdlinelinux= "" into:

grub_cmdline_linux= "Text"

Next, uncomment the "#GRUB_TERMINAL =console".

The updated grub configuration looks like the following.

Finally, use the Update-grub command to regenerate the GRUB2 configuration file under/boot based on these changes.

$ sudo update-grub

At this point, your desktop should be able to switch from the GUI boot to the console boot. You can verify by restarting.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.