20.04 won't automatically login

I had a "login loop" issue a good while back, similar to what this thread describes when an automatic update went bad:

I eventually removed and reinstalled enough things so I could boot the noveau drivers and then install the Nvidia drivers but automatic login didn't work afterwards. I've ignored it until now as I don't generally reboot unless forced by an update.

I am re-purposing this laptop and now it needs to be able to automatically start up after a power failure or watchdog timer reset.

When I boot or restart, it hangs at the graphics login screen until I click the password box. I don't need to type the password but it stays frozen there until I click the password box.

Any clues as to how I can fix this?

Hi, @wally333 ,

are you still using lightdm after your reinstallations?
Does systemctl status display-manager show lightdm running?
If yes, does lightdm --show-config command list autologin-user option?

3 Likes

Yes lightdm was one of the things I "purged" and re-installed as part of getting the system to boot up correctly.

Output of your first command:

wally@FX705GM:~/detect$ systemctl status display-manager
● lightdm.service - Light Display Manager
     Loaded: loaded (/lib/systemd/system/lightdm.service; indirect; vendor preset: enabled)
     Active: active (running) since Sun 2023-04-30 11:27:20 CDT; 1 weeks 4 days ago
       Docs: man:lightdm(1)
   Main PID: 1302 (lightdm)
      Tasks: 7 (limit: 38188)
     Memory: 95.3M
     CGroup: /system.slice/lightdm.service
             ├─1302 /usr/sbin/lightdm
             └─1397 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch

Apr 30 11:27:19 FX705GM systemd[1]: Starting Light Display Manager...
Apr 30 11:27:20 FX705GM lightdm[1302]: Seat type 'xlocal' is deprecated, use 'type=local' instead
Apr 30 11:27:20 FX705GM systemd[1]: Started Light Display Manager.
Apr 30 11:27:25 FX705GM lightdm[1727]: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)
Apr 30 11:27:25 FX705GM lightdm[1727]: gkr-pam: gnome-keyring-daemon started properly
Apr 30 11:27:25 FX705GM lightdm[1874]: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" was met by user "wall>
Apr 30 11:27:30 FX705GM lightdm[1874]: pam_unix(lightdm:session): session opened for user wally by (uid=0)
Apr 30 11:27:30 FX705GM lightdm[1874]: gkr-pam: gnome-keyring-daemon started properly

Output of the second command:

wally@FX705GM:~/detect$ systemctl status display-manager
● lightdm.service - Light Display Manager
     Loaded: loaded (/lib/systemd/system/lightdm.service; indirect; vendor preset: enabled)
     Active: active (running) since Sun 2023-04-30 11:27:20 CDT; 1 weeks 4 days ago
       Docs: man:lightdm(1)
   Main PID: 1302 (lightdm)
      Tasks: 7 (limit: 38188)
     Memory: 95.3M
     CGroup: /system.slice/lightdm.service
             ├─1302 /usr/sbin/lightdm
             └─1397 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch

Apr 30 11:27:19 FX705GM systemd[1]: Starting Light Display Manager...
Apr 30 11:27:20 FX705GM lightdm[1302]: Seat type 'xlocal' is deprecated, use 'type=local' instead
Apr 30 11:27:20 FX705GM systemd[1]: Started Light Display Manager.
Apr 30 11:27:25 FX705GM lightdm[1727]: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)
Apr 30 11:27:25 FX705GM lightdm[1727]: gkr-pam: gnome-keyring-daemon started properly
Apr 30 11:27:25 FX705GM lightdm[1874]: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" was met by user "wall>
Apr 30 11:27:30 FX705GM lightdm[1874]: pam_unix(lightdm:session): session opened for user wally by (uid=0)
Apr 30 11:27:30 FX705GM lightdm[1874]: gkr-pam: gnome-keyring-daemon started properly

Any other ideas as to what is wrong?

You may have erased your lightdm config during reinstallation. Check your lightdm config for autologin-user entry. Use lightdm --show-config command. If you have autologin-user entry missing, it is necessary to configure autologin again.

I assume wally is a user you want to automatically login.
Create or edit /etc/lightdm/lightdm.conf file.
Add autologin-user=wally entry under [Seat:*] section and save changes.
So, minimal working file example:

[Seat:*]
autologin-user=wally

Reboot to check effect.

2 Likes

I had to put the created lightdm.conf file into the lightdm.conf.d to get it to work.
Thanks.

But now this has exposed another issue that seems to prevent unattended restarts.
After the auto login a modal dialog pops up that prevents any user interaction.

"Unlock Keyring" Authorization required. How do I get rid of this? or figure out what is automatically starting that is causing it?

I've unchecked the three "GNOME keyring" services in "Startup Applications Preferences" but it made no difference, they are still unchecked once I type in the password to unlock the keyring.

Or should I start a new thread about this?

You are welcome @wally333.

Try installing seahorse to inspect your keyring(s).

This makes sense.

1 Like