Ubuntu – How to start lightdm services at startup

bootgrub2lightdmsystemd

My system is running Ubuntu 15.04 and I've changed default boot to "text" instead of "quiet splash" by going through answer by @Bruno Pereira How do I disable X at boot time so that the system boots in text mode?.However again I've changed default boot to quiet splash and update-grub but as Ubuntu 15.04 uses systemd my system does not boot to graphical login and stuck at Ubuntu Logo screen.I've to go to the tty1 terminal by CTRL+ALT+F1 and manullay starts Lightdm services as sudo service lightdm start on every login.

How should I change my boot to Graphical login i.e "quiet splash"?
content of sudo gedit /etc/default/grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT="quiet splash"
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="quiet splash"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=1920x1080

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Best Answer

First run this command for a graphical environment

sudo systemctl set-default graphical.target

Because you have used sudo systemctl set-default multi-user.target before.


Then repair the entries in /etc/default/grub

This statement is completely wrong:

GRUB_DEFAULT="quiet splash"

Open the configuration:

sudo nano /etc/default/grub

and replace the entry

GRUB_DEFAULT="quiet splash"

with

GRUB_DEFAULT=0

add the entry

GRUB_CMDLINE_LINUX="quiet splash"

After that run

sudo update-grub

  • GRUB_DEFAULT

    The default menu entry. This may be a number, in which case it identifies the Nth entry in the generated menu counted from zero, or the title of a menu entry, or the special string ‘saved’. Using the title may be useful if you want to set a menu entry as the default even though there may be a variable number of entries before it.

  • GRUB_CMDLINE_LINUX

    Command-line arguments to add to menu entries for the Linux kernel.

  • GRUB_CMDLINE_LINUX_DEFAULT

    Unless ‘GRUB_DISABLE_RECOVERY’ is set to ‘true’, two menu entries will be generated for each Linux kernel: one default entry and one entry for recovery mode. This option lists command-line arguments to add only to the default menu entry, after those listed in ‘GRUB_CMDLINE_LINUX’.

Source

Related Question