Startx not automatically running on reboot

17,705

The Gui is loaded by systemd, when the init system is systemd, this is the case of Ubuntu

Here is a nice answer about the subject

systemctl get-default permit to see what target is set for the startup either multi-user.target or graphical.target

To enable x at startup time you can use:

sudo systemctl enable graphical.target --force
sudo systemctl set-default graphical.target

And to disable it

sudo systemctl enable multi-user.target --force
sudo systemctl set-default multi-user.target

Note that /etc/X11/default-display-manager contain the default used display manager (this file is not required tho)

Also find here how to setup the default display manager, this is required as well

For a detailed answer more information about the setup are required (what desktop are you using kde/gnome what dm are using lightdm/sddm etc)

Share:
17,705

Related videos on Youtube

APorter1031
Author by

APorter1031

Updated on September 18, 2022

Comments

  • APorter1031
    APorter1031 almost 2 years

    When starting up by machine, I am prompted with a terminal asking me to login, rather than the nice GUI that I am use to. When I login in, I am able to run startx and everything works smoothly.

    I added the following to my ~/zprofile but it only ran once I was logged in.

    if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
      startx
    fi
    

    How can I get the login screen that I am use to, to appear again?

    • smw
      smw about 5 years
      What Ubuntu version? What is the output of systemctl get-default and cat /etc/X11/default-display-manager?
    • APorter1031
      APorter1031 about 5 years
      @steeldriver Version: Ubuntu 18.04.2 LTS x86_64 and systemctl output: graphical.target