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.

  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

  • 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 at 18:01

In GRUB, you could just add the boot option




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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.