Fixing automatic login issues on Ubuntu 26.04 LTS
Fixing automatic login issues on Ubuntu 26.04 LTSAs part of an earlier project, I had s 2026-7-26 16:40:53 Author: derflounder.wordpress.com(查看原文) 阅读量:5 收藏

Fixing automatic login issues on Ubuntu 26.04 LTS

As part of an earlier project, I had set up a status board using MagicMirror on Ubuntu LTS. As part of this, I had set Ubuntu to do the following:

  • Reboot on a daily basis, in case any of the MagicMirror modules got hung or there was some other problem.
  • Automatically log in as the user account used to run MagicMirror.
  • Set MagicMirror to automatically launch when the user account in question logged in.

This setup has worked reliably for a few years now, until the automatic login process quit working out of the blue this week. When I did some research, I saw that I was not the only person who had problems with this:

https://www.reddit.com/r/Ubuntu/comments/1v627xc/autologin/
https://askubuntu.com/questions/1501453/automatic-login-not-working/1568632#1568632

I verified via the documentation that I had everything configured like it is supposed to be for automatic login to work, but it looks like something in the latest Ubuntu updates for Ubuntu 26.04 LTS is preventing automatic login from working. What to do? After some additional research, I found an answer. For more details, please see below the jump.

I’m using GNOME for my desktop environment on Ubuntu 26.04 LTS, which means that the automatic login settings are stored in the following file:

/etc/gdm3/custom.conf

My custom.conf file looked like this:


# GDM configuration storage
#
# See /usr/share/gdm/gdm.schemas for a list of available options.
[daemon]
AutomaticLoginEnable=True
AutomaticLogin=username_goes_here
# Enabling automatic login
# AutomaticLoginEnable = true
# AutomaticLogin = user1
# Enabling timed login
# TimedLoginEnable = true
# TimedLogin = user1
# TimedLoginDelay = 30
[security]
[debug]
# Uncomment the line below to turn on debugging
# More verbose logs
# Additionally lets the X server dump core if it crashes
#Enable=true

The relevant section which controls the automatic login is this, in the [daemon] section of the custom.conf file:


AutomaticLoginEnable=True
AutomaticLogin=username_goes_here

However, there is another option for automatically logging in. This is GNOME’s time delay automatic login option. This allows the login screen to appear and wait for a specified time in seconds. If no action occurs at the login screen, the computer logs in as the user account configured in the timed login settings. This option is commented out by default and should also be in the [daemon] section of the custom.conf file:


# Enabling timed login
# TimedLoginEnable = true
# TimedLogin = user1
# TimedLoginDelay = 30

I updated my configuration file to comment out the automatic login section, then enabled the timed login settings to log in as the desired user account with a delay of one second. Once my edits were completed, my custom.conf file looked like this:


# GDM configuration storage
#
# See /usr/share/gdm/gdm.schemas for a list of available options.
[daemon]
# AutomaticLoginEnable=True
# AutomaticLogin=username_goes_here
# Enabling automatic login
# AutomaticLoginEnable = true
# AutomaticLogin = user1
# Enabling timed login
TimedLoginEnable = true
TimedLogin = username_goes_here
TimedLoginDelay = 1
[security]
[debug]
# Uncomment the line below to turn on debugging
# More verbose logs
# Additionally lets the X server dump core if it crashes
#Enable=true

Once I saved my changes, I restarted my computer. After the reboot, the login screen appeared for one second and then logged in as my desired user account. That gave me back the automatic login experience I wanted.

For folks in a similar situation of needing auto-login to work on Ubuntu, hopefully this solution works for you like it did for me.


文章来源: https://derflounder.wordpress.com/2026/07/26/fixing-automatic-login-issues-on-ubuntu-26-04-lts/
如有侵权请联系:admin#unsafe.sh