6

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?

SouravGhosh
  • 553
  • 5
  • 12
  • 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 03 '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 03 '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 09 '17 at 18:42
  • @Centimane `systemctl list-dependencies graphical.target` is what you mean (missed a c). – Ned64 Mar 23 '18 at 10:26

1 Answers1

11

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

multi-user.target

On your desktop you want

graphical.target

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
Ned64
  • 8,486
  • 9
  • 48
  • 86
  • 2
    `systemctl enable gdm` resolved it. After removing pulseaudio from centos 8 I had some issue logging again in graphical mode. Thanks – tuxErrante Mar 08 '20 at 20:49