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:
- Changing the default runlevel
Ideally I also want to be able to start GUI by typig a command.
One of the following, as part of the kernel command line (editable via GRUB), should work:
systemd.unit=multi-user.target will override the default of "graphical.target" – this, along with systemctl set-default, is the equivalent of "default runlevel";
systemd.mask=lightdm.service will forbid a specific service from starting, until manually systemctl unmask'd later;
systemd.mask=display-manager.service – same;
systemd.unit=rescue.target is the equivalent of "single-user runlevel"; not for daily use, but useful when fixing broken GUI.
You could disable the display manager service with
systemctl for example if your display manager is
lightdm the run
sudo systemctl disable lightdm.service. This will prevent the service from starting at boot.
I forgot to mention how to start the GUI, Its as simple as starting the service
sudo systemctl start lightdm.service