3

Unlike 17.04, sudo service stop gdm or sudo service stop lightdm will return stop: unrecognized service, so my question being how to stop the GUI process in this bleeding edge version?

3 Answers3

9

Instead of killing the gdm, you can change the systemd target.


Changing the systemd target

As mentioned here, starting from 16.04, Ubuntu uses systemd and the boot process relies on a set of targets. Each target defines the system software that Ubuntu must run.

This is a list of targets for Ubuntu:

   ┌───────────────────┐
   │ Target            │
   ├───────────────────┤
   │ poweroff.target   │ turn off the computer
   ├───────────────────┤
   │ rescue.target     │ minimal for admin/rescue tasks
   ├───────────────────┤
   │ multi-user.target │ multi-user, no GUI
   ├───────────────────┤
   │ graphical.target  │ multi-user, GUI
   ├───────────────────┤
   │ reboot.target     │ reboot the computer
   └───────────────────┘

To stop the GUI, you can change the target. The system checks all the running system software and kills those not included in the specified target. In consequence, if you change to the multi-user.target target, the GUI will be killed.

To change the "target" and kill the GUI:

sudo systemctl isolate multi-user.target

To make this the default "target" (and start booting your computer without GUI), you can use:

sudo systemctl enable multi-user.target
sudo systemctl set-default multi-user.target
Madacol
  • 518
Jaime
  • 1,440
3

To stop:

sudo telinit 3

To start:

sudo telinit 5
2

To stop it:

sudo systemctl gdm stop

To disable it completely:

sudo systemctl gdm disable

To start it:

sudo systemctl gdm start

and to re-enable it:

sudo systemctl gdm enable

To see the actually running services

systemctl --state running
Videonauth
  • 33,815