jozy
Posts: 2
Joined: Thu Nov 26, 2015 4:29 pm

Autologin on boot is not working (Raspbian Jessie Lite)

Thu Nov 26, 2015 4:37 pm

I'm running Raspberry Jessie Light (= headless)
I've used sudo raspi-config --> Boot Options --> Console Autologin but after rebooting I'm still asked to enter my username and password.

I can image it has something to do with the fact that inittab is not available anymore.
How can I enable auto-login without installing some desktop environment, since I want this to work headless!

jozy
Posts: 2
Joined: Thu Nov 26, 2015 4:29 pm

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Fri Nov 27, 2015 11:17 am

Was able to fix this myself using information found here: http://askubuntu.com/questions/679419/h ... ay-manager

I made this file: /etc/systemd/system/[email protected]/autologin.conf
And put this in it:

Code: Select all

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin pi --noclear %I 38400 linux
After that, i runned this:

Code: Select all

sudo systemctl enable [email protected]
That's all :)

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6183
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Fri Nov 27, 2015 11:30 pm

Thanks, will look into it when I get a chance.

Eric_Newman
Posts: 2
Joined: Thu Dec 03, 2015 8:20 pm

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Thu Dec 03, 2015 8:22 pm

Best answer ever. thank you.

Oddwarg
Posts: 1
Joined: Wed Dec 16, 2015 8:29 pm

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Wed Dec 16, 2015 8:43 pm

I've been looking for hours and this is the only guide that worked.

raspi-config seems to have an option for autologin but it must be made for the old init system, so that's pretty misleading. Some of the other tutorials made my system unbootable, which seems really unreasonable for something as simple as setting up autologin. The systemd commands are really cryptic compared to most of the other stuff I'm trying to achieve, and it doesn't help that a lot of the documentation is outdated. This is highly damaging to the experience of new users, so there should be some sort of effort to make this more accessible(autologin and running a startup script).

Rant over. Thanks for the clear answer, it helps a lot.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6183
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Wed Dec 23, 2015 6:53 am

Oddwarg wrote:I've been looking for hours and this is the only guide that worked.

raspi-config seems to have an option for autologin but it must be made for the old init system, so that's pretty misleading. Some of the other tutorials made my system unbootable, which seems really unreasonable for something as simple as setting up autologin. The systemd commands are really cryptic compared to most of the other stuff I'm trying to achieve, and it doesn't help that a lot of the documentation is outdated. This is highly damaging to the experience of new users, so there should be some sort of effort to make this more accessible(autologin and running a startup script).

Rant over. Thanks for the clear answer, it helps a lot.
Please link to the outdated documentation.

femape
Posts: 3
Joined: Mon Dec 28, 2015 2:07 pm

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Mon Dec 28, 2015 3:29 pm

Hi all,
I want to autologin and autostart the desktop manager (DM). I tried at first with the raspi-config tool without success, then I tried the suggested solution from jozy and I'm not able to autologin with autostarting the DM. At the moment the DM starts (ligthdm) but the login window too.

On the other hand, if I don't autostart the DM, the autologin works perfect.

Some useful outputs:

Code: Select all

$ cat /etc/*-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Code: Select all

$ cat /etc/X11/default-display-manager
/usr/sbin/lightdm

Code: Select all

$ cat /etc/systemd/system/[email protected]/autologin.conf 
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin pi --noclear %I 38400 linux

Code: Select all

$ systemctl list-unit-files | grep getty
console-getty.service                  disabled
[email protected]               static  
getty-static.service                   static  
[email protected]                         enabled
[email protected]                  disabled
getty.target                           static
I tried as well to add the user to the autologin group:

Code: Select all

$ sudo groupadd -r autologin
$ gpasswd -a pi autologin
$ groups
pi adm dialout cdrom sudo audio video plugdev games users input netdev autologin gpio i2c spi
With all above I have a dmesg message:

Code: Select all

[    5.303220] systemd[1]: [email protected] has more than one ExecStart setting, which is only allowed for Type=oneshot services. Refusing.
[    5.473100] systemd[1]: Cannot add dependency job for unit [email protected], ignoring: Unit [email protected] failed to load: Invalid argument. See system logs and 'systemctl status [email protected]' for details.
So I took off the empty line "ExecStart=" from the *.conf file shown above but I still have the same message in dmesg. Then I see

Code: Select all

$ systemctl status [email protected][email protected] - Getty on tty1
   Loaded: error (Reason: Invalid argument)
  Drop-In: /etc/systemd/system/[email protected]
           └─autologin.conf, noclear.conf
   Active: inactive (dead)
     Docs: man:agetty(8)
           man:systemd-getty-generator(8)
           http://0pointer.de/blog/projects/serial-console.html

Warning: Unit file changed on disk, 'systemctl daemon-reload' recommended.
Then I ran 'systemctl daemon-reload' but it doesn't change anything.

Any thoughs?

I think I should work on the ~/.bash_profile file, I will check...

spinacz
Posts: 6
Joined: Thu Feb 18, 2016 10:23 am

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Sun Feb 21, 2016 10:09 am

On fresh install jessie raspbery pi2 i manage to create >
sudo nano /etc/systemd/system/[email protected]/autologin.conf
but when i sudo systemctl enable [email protected] i get error
Failed to execute operation: File exists

help please

DirkS
Posts: 10130
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Sun Feb 21, 2016 2:08 pm

spinacz wrote:On fresh install jessie raspbery pi2 i manage to create >
sudo nano /etc/systemd/system/[email protected]/autologin.conf
but when i sudo systemctl enable [email protected] i get error
Failed to execute operation: File exists

help please
Have you tried using raspi-config?
Are you using full Jessie or Jessie Lite?

spinacz
Posts: 6
Joined: Thu Feb 18, 2016 10:23 am

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Sun Feb 21, 2016 3:08 pm

i have full jessie
i try by the comand , nothing hapend

DirkS
Posts: 10130
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Sun Feb 21, 2016 3:19 pm

spinacz wrote:i have full jessie
i try by the comand , nothing hapend
What option do you choose?
What do you want to achieve?

spinacz
Posts: 6
Joined: Thu Feb 18, 2016 10:23 am

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Sun Feb 21, 2016 3:42 pm

i chose autologin with desktop...
i try to run jdownloader to start after i plug on power with no any other operation.
But i manage to do that on wezzy , if i update wezzy with all configured to jessi is my config gone?

DirkS
Posts: 10130
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Sun Feb 21, 2016 3:54 pm

spinacz wrote:i chose autologin with desktop...
i try to run jdownloader to start after i plug on power with no any other operation.
But i manage to do that on wezzy , if i update wezzy with all configured to jessi is my config gone?
The thing with getty will not work to autologin to the desktop.
That fixed a problem for someone who had problems autologin to the command line on Jessie Lite

I think you should create a new topic for your problem.

In the meantime you should run raspi-config or the config GUI program to enable auto login to the desktop.
When you have that working you can start fixing the problem with autostarting jdownloader.

spinacz
Posts: 6
Joined: Thu Feb 18, 2016 10:23 am

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Sun Feb 21, 2016 6:28 pm

Ok i install fresh jessie i install jdownloader using this >
http://steven-england.info/2014/11/23/s ... wnloader2/
next i do auto start and auto login in rasp conf
but myjdownloader app is not reading the jdownloader from pi.
any sugestion

DirkS
Posts: 10130
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Sun Feb 21, 2016 6:39 pm

spinacz wrote:but myjdownloader app is not reading the jdownloader from pi.
any sugestion
I think you need to add your command in ~/.config/lxsession/LXDE-pi/autostart

spinacz
Posts: 6
Joined: Thu Feb 18, 2016 10:23 am

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Sun Feb 21, 2016 7:28 pm

THX man you just solved my big problem again thx
PS how can i do a backup my sustem and configuration from misco-sd

DirkS
Posts: 10130
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Sun Feb 21, 2016 8:29 pm

spinacz wrote:PS how can i do a backup my sustem and configuration from misco-sd
You can create a full image (img file) with the same tools as you write an image to SD (win32diskimager on Win, dd on Linux, etc).

User avatar
iggynach
Posts: 15
Joined: Sat Apr 16, 2016 12:03 am
Location: Whittier, CA

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Fri Sep 16, 2016 7:11 pm

Thank you for this info. I didn't need to use the second part to automatically trigger startx, but the first part worked flawlessly.

Sweet!
---Nacho---
Are you learning?... Good, so am I!

yu210148
Posts: 2
Joined: Mon Oct 13, 2014 4:58 pm
Location: Davis, CA, USA

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Thu Oct 06, 2016 2:53 am

Thank you jozy. I was using the edit to /etc/inittab described at viewtopic.php?f=66&t=59960 to auto log in and run a script that started pulseaudio (https://gist.github.com/yu210148/152e78 ... 7db3399218) but that mysteriously stopped working about a week and a half ago. This did the trick.

kev.

Killertechno
Posts: 194
Joined: Wed Jan 02, 2013 8:28 am

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Tue Mar 21, 2017 4:46 pm

I'm a bit confused, sorry.....

1) is there a way to come back to inittab instead using systemd?
2) avoiding raspi-config (I'm trying to create a slim Debian image), I set:

sudo systemctl set-default multi-user.target

then I want use serial port (ttyS0) as console @115200 for autologin.

Now, where could I say I'm using ttyS0? I'm confused on getty.target.wants, [email protected], [email protected]
At boot it hangs on:
"Started Update UTMP about System Runlevel Changes"

Black_Fiction
Posts: 2
Joined: Mon Apr 17, 2017 8:20 am

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Mon Apr 17, 2017 8:23 am

I prefer on the most recent raspian image this way:

Code: Select all

nano /etc/lightdm/lightdm.conf
Uncomment these two lines:

Code: Select all

autologin-user=USERNAME
autologin-user-timeout=0
Replace USERNAME with your own username. Save the file and exit. Run now this command so that changes are taken into effect:

Code: Select all

dpkg-reconfigure lightdm 

psfales
Posts: 1
Joined: Mon Dec 09, 2019 4:17 pm

Re: Autologin on boot is not working (Raspbian Jessie Lite)

Mon Dec 09, 2019 4:42 pm

Black_Fiction's answer from April 2017 is what did it for me. Even though I'm using a freshly installed recent download of 2019-09-26-raspbian-buster.img, somehow the lightdm.conf file was set to

Code: Select all

autologin-user=
I set it to

Code: Select all

autologin-user=pi
and things started working as expected!

Return to “Troubleshooting”