Inspect the default systemd target, safely isolate between
targets, and verify persistent defaults via the
default.target symlink. Confirm active targets and
runlevel-style mappings so you can reason about boot behavior and
operational mode changes without rebooting.
A host is booting into an unexpected mode and services are not
behaving as the team expects. Before changing anything, you
need to confirm the current default systemd target, understand
what targets are currently active, and practice switching
between targets safely using isolate. You will
then set a persistent default and verify it using the
/etc/systemd/system/default.target symlink.
Changing targets can stop services and terminate sessions. Do target changes as controlled operations and always verify the active and persistent state separately.
multi-user.target without changing the default.
multi-user.target is active.multi-user.target as the persistent default.default.target symlink to prove the persistent default.
graphical.target as the persistent default and verify the symlink update.
graphical.target for the current session.
systemctl isolate changes current state immediately and may stop non-required units.
systemctl set-default updates the
/etc/systemd/system/default.target symlink.
systemctl get-default
This is the target the system will boot into by default. It does not necessarily reflect the mode you are currently in if someone isolated into a different target during runtime.
graphical.target
systemctl list-units --type=target --state=active | head -n 10
Active targets give you an operational snapshot. Multiple targets can be active because they represent dependency groupings.
UNIT LOAD ACTIVE SUB DESCRIPTION
basic.target loaded active active Basic System
sockets.target loaded active active Sockets
multi-user.target loaded active active Multi-User System
graphical.target loaded active active Graphical Interface
timers.target loaded active active Timers
Isolating to multi-user.target can stop graphical
services and terminate graphical sessions. Use this intentionally.
systemctl isolate multi-user.target
isolate switches the current system state by
stopping units not required by the target and starting what
is needed to reach it. This does not change the default boot
target.
(switched to multi-user.target; graphical sessions would stop if present)
multi-user.target is active.
systemctl list-units --type=target --state=active | grep multi-user.target
Confirm state instead of assuming the isolate succeeded just because the command returned.
multi-user.target loaded active active Multi-User System
systemctl set-default multi-user.target
This changes what the system will boot into on the next
reboot by updating the default.target symlink.
Created symlink /etc/systemd/system/default.target → /lib/systemd/system/multi-user.target
default.target symlink destination.
ls -l /etc/systemd/system/default.target
This is the durable proof of the persistent default. When troubleshooting “why did it boot into text mode,” this symlink is a primary artifact to check.
lrwxrwxrwx 1 root root 46 Aug 19 12:40 /etc/systemd/system/default.target -> /lib/systemd/system/multi-user.target
systemctl set-default graphical.target
This returns the system to a graphical boot default for the next reboot.
Removed symlink /etc/systemd/system/default.target.
Created symlink /etc/systemd/system/default.target → /lib/systemd/system/graphical.target
graphical.target.
ls -l /etc/systemd/system/default.target
Confirming the symlink destination ensures the persistent default target is what you intend.
lrwxrwxrwx 1 root root 45 Aug 19 12:42 /etc/systemd/system/default.target -> /lib/systemd/system/graphical.target
Isolating into graphical.target will start
graphical services and may change system resource usage.
systemctl isolate graphical.target
This changes the current running state immediately. It is
separate from set-default, which controls only
future boots.
(switched to graphical.target)
who -r
runlevel
These commands provide a legacy-friendly view. Use them for quick context, then verify state using systemd tooling.
# who -r
run-level 5 2025-08-19 12:43 last=3
# runlevel
N 5
That is expected when you stop a display manager or switch targets on a system you are connected to through a graphical login. Use an out-of-band console, a persistent TTY, or a controlled maintenance window when practicing isolate on non-lab hosts.
That is expected. set-default affects the next
boot only. Use systemctl isolate if you want to
change the current state.
Runlevels are compatibility views. Use them as a hint and
confirm real state using
systemctl list-units --type=target --state=active
and the default.target symlink.
Leave the system in a known-good state by restoring the persistent default and confirming active targets.
systemctl set-default graphical.target
ls -l /etc/systemd/system/default.target
systemctl get-default
systemctl list-units --type=target --state=active | grep -E 'multi-user.target|graphical.target'
who -r
runlevel
You can explain the difference between default and active targets, safely switch targets for the current session, and prove the persistent default by reading the symlink.
systemctl get-default
: Displays the persistent default target used at boot.
systemctl list-units --type=target
: Lists target units.
--state=active
: Shows only active targets.
systemctl isolate <target>
: Switches the current running state to the specified target.
systemctl set-default <target>
: Sets the target used on the next boot by updating
/etc/systemd/system/default.target.
/etc/systemd/system/default.target
: Symlink that defines the default boot target.
graphical.target
: Graphical boot target (typically includes multi-user plus a display manager).
multi-user.target
: Multi-user text environment target.
who -r
: Displays the current runlevel-style status.
runlevel
: Prints previous and current runlevel (compatibility view).