I want a choice about starting a Desktop system or a Server system

See also What is the easiest way to strip a desktop edition to a server edition?. Thst question addresses a similar concept but he wants a permanent system migration.

My question is more like Can I Use Ubuntu Server As A Desktop?

I would like to be able to "Restart Ubuntu {with/without} the GUI" and later either start or stop lightdm/X/etc. I suppose I could boot initially into Server mode and then manually go to /etc/init.d and start the appropriate service -- or conversely.

Is there a single service name that covers all the bases? (I presume the answer is No, and it will be different if I upgrade Ubuntu. [FYI, I'm currently running 16.04 on this system.]

... Or do I need to set up different options in GRUB which seems like a primitive way to accomplish the same thing?

There are several reasons why I'd like to do this, but the most critical is that upgrading the NVidia drivers with the .run file they supply will thoroughly corrupt the X GUI if it happens to still be running.


Solution 1:

On a systemd based desktop system:

sudo systemctl set-default multi-user.target

and

sudo systemctl set-default graphical.target

From man systemctl:

  set-default NAME
       Set the default target to boot into. This sets (symlinks) the
       default.target alias to the given target unit.