On Ubuntu 16.04 with lightdm, and an autologin account, I can restart the graphical session with command :

sudo service lightdm restart

The account logs in automatically.

On Ubuntu 18.04 (and also on 19.04), the same autologin account is setup, but the command :

sudo service gdm3 restart

fails to autologin, and bring the display to the login page.

In gdm logs, I can find

systemd[1]: gdm.service: Succeeded.
systemd[1]: Stopped GNOME Display Manager.
systemd[1]: Starting GNOME Display Manager...
systemd[1]: Started GNOME Display Manager.
gdm-autologin][4091]: gkr-pam: no password is available for user
gdm-autologin][4091]: pam_unix(gdm-autologin:session): session opened for user screen by (uid=0)
gdm-autologin][4091]: gkr-pam: couldn't unlock the login keyring.

How to properly restart the user session, with autologin user logged in on ubuntu 18.04 ?


3 Answers 3


Had the same issue, I solved it by enabling 'Timed Login' in the /etc/gdm3/custom.conf file. Mine looks like:

# GDM configuration storage
# See /usr/share/gdm/gdm.schemas for a list of available options.


# Uncoment the line below to force the login screen to use Xorg

# Enabling automatic login

# Enabling timed login
TimedLoginEnable = true
TimedLogin = username
TimedLoginDelay = 10




# Uncomment the line below to turn on debugging
# More verbose logs
# Additionally lets the X server dump core if it crashes
  • 1
    On my RPi-4 it's /etc/gdm3/daemon.conf, FYI.
    – cyqsimon
    May 10, 2021 at 13:10

Slight change to Celly's answer above. The default, or OOB, custom.conf file has the AutomaticLoginEnable and AutomaticLogin parameters commented out. I left those parameters commented out and uncommented/set TimedLoginEnable, TimedLogin, and TimedLoginDelay. It still works. Thank-you Celly!


This seems to be fixed on Ubuntu 20.04 : gdm3 service restart will result in successful autologin.


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.