0

Accidentally gave the command

systemctl set-default machines.target

on Fedora 29 to reset back to GUI from cli and now my PC hangs on the boot logo. I want to know where the config file is so that I can boot with a live image and change the settings if it is in text format.

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232

3 Answers3

1
  1. Boot the operating system into emergency mode, or rescue mode.
  2. Log in.
  3. Run systemctl to set the default to what you want.

Further reading

JdeBP
  • 68,745
  • Worth pointing out that "Setting up the root password is a mandatory part of the Red Hat Enterprise Linux 7 installation" does not apply to Fedora. But the procedure to "reset" the root password should work equally well, to set a root password for the first time, so that you can log in to emergency/rescue mode. (You cannot do so with any other user). – sourcejedi Apr 10 '19 at 18:01
1

In GRUB, you could just add the boot option

systemd.unit=graphical.target

or

systemd.unit=multi-user.target

to override the misconfigured default target and explicitly boot into either the GUI or CLI mode, and then use systemctl set-default graphical.target to reset the default target to normal.

telcoM
  • 96,466
0
cd /path/to/mounted/root/filesystem
rm etc/systemd/system/default.target

The configuration is stored as a symbolic link file. When you delete the file in etc, it will go back to using the package default, which is stored at lib/systemd/system/default.target.

sourcejedi
  • 50,249