Ubuntu – Why does an Ubuntu Server have graphical.target as the default systemd target

bootserversystemd

I've been an Ubuntu user for a while, and at work we have many Ubuntu VM servers, all of which run Ubuntu 14.04 LTS to deploy our web applications, databases, and other tools.

I'm currently studying Ubuntu 16.04 LTS, desktop and server, to be able to upgrade our production servers in the near future without causing problems.

Since Ubuntu 15.04, init and upstart have been replaced by Systemd, so I'm studying Systemd too.

I noticed that my development computer running Ubuntu 16.04 Desktop edition has graphical.target as the default systemd target, which is logical.

But then I noticed that the testing server running Ubuntu 16.04 Server edition also uses graphical.target as the default systemd target.

$ systemctl get-default
graphical.target

So I'm confused. The server doesn't have any graphical layer, so how it is that the default target is graphical.target?

Edit #0

Like Rinzwind suggested in the comments, I looked at the target to see whether it's active or not…

and the response is YES:

admin@server1604:~$ systemctl get-default
graphical.target

admin@server1604:~$ systemctl status graphical.target
● graphical.target - Graphical Interface
Loaded: loaded (/lib/systemd/system/graphical.target; static; vendor preset: enabled)
Active: active since jeu. 2016-10-13 16:03:18 CEST; 46min ago
Docs: man:systemd.special(7)

oct. 13 16:03:18 fdea systemd[1]: Reached target Graphical Interface.

So I'm a bit more confused.

Edit #1

The Mark Stosberg's answer point the fact that display-manager.service is part of the dependency tree of the graphical.target on its own 16.04 server, and he adds that no display manager is installed or running on its machine. I looked at that too, and indeed, on my server this dependency is there:

admin@server1604:~$ systemctl list-dependencies graphical.target 
graphical.target
● ├─accounts-daemon.service
● ├─apache2.service
● ├─apport.service
● ├─display-manager.service

...

And this target has a red circle on the left, where most of the other dependencies have a green one.

And this time the result is consistent:

admin@server16.04:~$ systemctl status display-manager.service 
● display-manager.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

But here is an other strange thing: on my desktop edition, the display-manager.service is not a dependency of graphical.target:

me@desktop16.04:~ $ systemctl list-dependencies graphical.target | grep display
me@desktop16.04:~ $ 

But I even found an alternative because I run Ubuntu-Gnome with lightdm replacing the default window manager:

me@desktop16.04:~ $ systemctl list-dependencies graphical.target | grep lightdm
● ├─lightdm.service

Best Answer

Despite the name of the target, there is nothing graphical running on Ubuntu Server 16.04. You can run this command to check and compare it with your desktop distro if you like:

systemctl list-dependencies graphical.target 

On my Ubuntu 16.04 server, I see that the targets depend on "display-manager.service", but no display manager is installed or running.

I expect Ubuntu servers are set this way for some kind of consistency, although I agree it's confusing.

Related Question