4

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.

bruce
  • 51
  • Go for the server edition, and add services from there. If you need desktop you can add it. And to answer your question, yes you can use the server edition as a desktop. IF you add the wright things to it. – An0n Jul 27 '18 at 03:04

1 Answers1

8

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.
steeldriver
  • 136,215
  • 21
  • 243
  • 336
  • This looks good for selecting the profile for the next boot, but to address the question: Is there some boot parameter he could put into his grub.cfg to select the corresponding systemd target? – allo Jul 27 '18 at 08:41
  • 1
    @allo I believe you can set the target explicitly at boot time e.g. by adding systemd.unit=multi-user.target to the usual quiet splash line. I don't understand what advantage editing the grub.cfg file would have over simply setting the default target. – steeldriver Jul 27 '18 at 11:39
  • I think the difference is, if you decide on boot or on shutdown how you want to use the system. Advantage for setting on shutdown is, that you can do it e.g. via ssh as well. Disadvantage: possibly you need to boot the system just to reboot in the other mode. Anyway, if somebody verifies the grub method it will be a great addition to the answer. – allo Jul 27 '18 at 13:37