Last updated on October 16, 2020 by Dan Nanni
Linux desktop comes with a display manager (e.g., GDM, KDM, LightDM), which lets the desktop machine automatically boot into a GUI-based login environment. However, what if you want to disable GUI and boot straight into a text-mode console? For example, you are troubleshooting desktop related issues, or want to run a heavy-duty application that does not require desktop GUI.
Note that you can temporarily switch from desktop GUI to a virtual console by pressing
F6. However, in this case your desktop GUI will be still running in the background, and thus is different from pure text-mode booting.
Here is how to enable text-mode booting on Ubuntu or Debian desktop.
If you want to boot into command-line permanently, you need to update GRUB configuration which defines kernel booting parameters.
Open a default GRUB config file with a text editor.
$ sudo vi /etc/default/grub
Look for a line that starts with
GRUB_CMDLINE_LINUX_DEFAULT, and comment out that line by prepending
# sign. This will disable the initial splash screen, and enable verbose mode (i.e., showing the detailed booting procedure).
Next, uncomment the line that says
The updated GRUB defult configuration looks like the following.
update-grub command to re-generate a GRUB2 config file in
/boot based on these changes.
$ sudo update-grub
Systemd-enabled Desktop Only
If your desktop uses
systemd (e.g., for Debian 8 or later or Ubuntu 15.04 or later), there is one additional step needed. That is to change the default target from
graphical target to
multi-user target. Skip this step if your desktop does not use
$ sudo systemctl set-default multi-user.target
At this point, your desktop should boot into the command line when you reboot it.
Later you can always revert to desktop boot later by restoring GRUB config file and running:
$ sudo systemctl set-default graphical.target
If you want to disable desktop GUI and boot in text-mode just one-time, you can use GRUB menu interface. This works only for Debian 7 or earlier or Ubuntu 14.10 or earlier, where
systemd is not enabled.
First, power on your desktop. When you see the initial GRUB menu, press
This will lead you to the next screen, where you can modify kernel booting parameters. Scroll down the screen to look for a line that begins with
linux, which indicates a list of kernel parameters. Remove from the list
text in the list instead.
The updated kernel parameter list looks like the following. Press
Ctrl+x to continue booting. This will enable one-time console booting in verbose mode.
Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.