I am having issues where my centos 7 machine with KDE does not load the gui at startup. It gets stuck on some white letters and I have to press CTRL+ALT+F2 to load another terminal session and then run startx to properly load the gui.

Is there some file that I can edit so that it automatically loads starx at startup?

  • Normally if you set the systemd target at graphical that's enough. Can you take a screenshot of what you're seeing? I don't understand your problem description. – Bratchley Jan 3 '17 at 17:09
  • Can you please be more specific on your issue (eg, provide screenshots, logs from the gdm, lightdm, or other service)? Running startx is not the solution. This is all handled by the display manager. – Sokel Jan 3 '17 at 17:09
  • If you run systemctl list-dependenies graphical.target you should see your display manager in the list near the top (mine is gdm.service as an example). Then try a systemctl status [display manager].service to get an idea of why things failed. Your display manager should likely have a child process for Xorg under it if things are going well. – Centimane Mar 9 '17 at 18:42
  • @Centimane systemctl list-dependencies graphical.target is what you mean (missed a c). – Ned64 Mar 23 '18 at 10:26

The key here is what used to be called "default runlevel" if you remember CentOS 6 with SysV init.

In CentOS 7, the programs started upon boot are determined by systemd as @Centimane rightly pointed out.

Systemd will start the "default target" when it boots the system. On servers this target does not have graphical user interface but on desktop systems it usually should.

Please check the output of the command

# systemctl get-default

On non-graphical systems output would normally be


On your desktop you want


In order to set the second you execute

# systemctl set-default graphical.target

and then, install+enable a graphical login screen (e.g. gdm, but there are others like lightdm)

# yum install gdm
# systemctl enable gdm

protected by Community Aug 2 '18 at 23:35

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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