Thursday, March 3, 2016

How to Boot into Console Mode in Ubuntu

If you want to change the default boot option of Ubuntu Desktop into a console mode, here is how:

1. Backup the grub file
$ sudo cp -n /etc/default/grub /etc/default/grub.bk

2. Open up the grub file
$ sudo vim /etc/default/grub

3. Modify the menu entries
a) Comment out GRUB_CMD_LINE_LINUX_DEFAULT="quiet splash"
b) Change GRUB_CMD_LINE_LINUX="" to GRUB_CMD_LINE_LINUX="text"
c) Uncomment GRUB_TERMINAL=console

When complete, the file should look something like below:
...
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="text"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=console
...

4. Update grub
$ sudo update-grub

Only for Ubuntu 15.10 or up that uses systemd:
$ sudo systemctl enable multi-user.target --force
$ sudo systemctl set-default multi-user.target

5. Reboot and see if it works
$ sudo reboot

By the way, to start GUI, simply run the following command after logging into the console
$ sudo service lightdm start

No comments:

Post a Comment