Linux – Boot Ubuntu 16.04 into command line / do not start GUI

bootcommand lineguilinuxubuntu 16.04

I want my Ubuntu 16.04 to not start GUI on boot and show command line console only. I have tried the following recipies but none of them are for version 16.04 and so they do not seem to work — GUI starts anyway:

  1. GRUB_CMDLINE_LINUX=”text”

  2. Changing the default runlevel

Ideally I also want to be able to start GUI by typig a command.

Best Answer

You could disable the display manager service with systemctl. For example if your display manager is lightdm then run:

sudo systemctl disable lightdm.service

This will prevent the service from starting at boot.

Edit:

I forgot to mention how to start the GUI. It is as simple as starting the systemd service:

sudo systemctl start lightdm.service