Since 16.04 (and possibly 15.10, but I skipped everything between 14.04 and 16.04...), you are expected to use systemctl
instead:
To start lightdm
, you will get the lightdm
prompt (login screen) first:
sudo systemctl start graphical.target
Then to leave X-Windows start multi-user
instead:
sudo chvt 1 && sudo systemctl start multi-user.target
chvt
means "Change Virtual Terminal", because otherwise you get on vt 7 which will look like something is broken. You can use the Alt-F1 to Alt-F7 or even Alt-F8 to switch between terminals.
For more information about systemd, check out the systemd wiki. I am still learning myself!
The graphical.target
file is found under /lib/systemd/system/graphical.target
and looks like this (16.04 version):
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Graphical Interface
Documentation=man:systemd.special(7)
Requires=multi-user.target
Wants=display-manager.service
Conflicts=rescue.service rescue.target
After=multi-user.target rescue.service rescue.target display-manager.service
AllowIsolate=yes
The multi-user.target
file is found under /lib/systemd/system/multi-user.target
and looks like this (16.04 version):
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Multi-User System
Documentation=man:systemd.special(7)
Requires=basic.target
Conflicts=rescue.service rescue.target
After=basic.target rescue.service rescue.target
AllowIsolate=yes