How to switch boot target to text or GUI in systemd Linux

How to switch boot target to text or GUI in systemd Linux

You can switch the boot target to text or GUI (graphical user interface) mode in a systemd Linux system using the systemctl command.

  1. To switch to text mode:
‮ot refer‬:lautturi.com
sudo systemctl set-default multi-user.target

This will set the default boot target to multi-user.target, which will boot the system into text mode.

  1. To switch to GUI mode:
sudo systemctl set-default graphical.target

This will set the default boot target to graphical.target, which will boot the system into GUI mode.

  1. To apply the changes, reboot your system:
sudo systemctl reboot

Note: These commands assume that you have root access to your system. You will need to use sudo to run them.

You can also switch between text and GUI mode by using the systemctl isolate command. For example:

sudo systemctl isolate multi-user.target # Switch to text mode
sudo systemctl isolate graphical.target # Switch to GUI mode

This will immediately switch the system to the specified target without requiring a reboot. However, the changes will not be persisted across reboots. To make the changes permanent, you will need to use the set-default command as described above.

Created Time:2017-10-29 22:08:38  Author:lautturi