I need a Raspberry PI to login on boot and execute a bunch of scripts. The bunch of scripts part is working fine.

For the auto-login, it isn't as cooperative. I work on a RPI that has had quite some modifications yet. It is on Raspbian installed with NOOBS. As I started working on it, it already started with a login GUI, getting me to the desktop.

Here is what I tried so far to skip the login screen :

sudo raspi-config

And desktop log in as user 'pi' at the graphical desktop. Reboot to see the changes.. Nothing.

Then I tried the several /etc/inittab lines :

1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
1:2345:respawn:/bin/login -f pi tty1 / dev/tty1 2>&1

And the variants with different space placements. I forgot some unfortunately.

Finally, I tried putting these in /etc/lightdm/lightdm.conf


Nothing worked. So I'm starting to lose hope. I can't know what has been done before on this RPI to get it not working.

If you have any idea where to search, or any alternative solution, I'll take it.


  • Your not alone, I am dealing with the same issue.
    – NULL
    Apr 8, 2016 at 16:34
  • I haven't looked in a while, but last time I checked Raspian defaulted to LXDE, so googling "LXDE auto login" should point you in the right direction. The gist is that you have to edit the configuration file for LXDM, but the exact edits (and the location of the file) depend on the distribution and LXDE version. Unfortunately all of my Pis are headless right now...
    – Harald
    Apr 8, 2016 at 18:55

3 Answers 3


I faced similar problem and resolved it using following

sudo apt-get install --reinstall lxsession

I got a hint about this from .xsession-errors file. The error in this file was

/usr/bin/x-session-manager: 33: exec: /usr/bin/lxsession: not found

  • You're my hero! This worked, and is the only place I found this suggestion.
    – kregus
    Jan 30, 2022 at 20:34
  • @kregus, glad it worked for you..!
    – vishruti
    Jan 31, 2022 at 13:59

I finally found the solution to my problem.

It might help some lost souls.

My RPI turned out to use XDM as its default display manager. And it appears that XDM doesn't allow at all autologin.

So what I did :

sudo dpkg-reconfigure lightdm

And then, the raspi-config stuff worked without any problem.


We had a similar problem and found that commenting out the following line from /etc/lightdm/lightdm.conf fixed the issue:




# autologin-session=LXDE-pi-x

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.