I would like to settup my Raspberry Pi to auto login in a specific user. I googled this and the solutions that i found were about editing the /etc/inittab file. My problem i
I found this, which is the only thing that worked for me.
Open the terminal and make first a backup of the file we are going to edit:
su -
gedit /etc/lightdm/lightdm.gedit /etc/lightdm/lightdm.conf.back
Edit now this file:
gedit /etc/lightdm/lightdm.conf
or
nano /etc/lightdm/lightdm.conf
Uncomment these two lines:
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:
dpkg-reconfigure lightdm
I assume you're using the latest Raspian-Image (jessie). This one is based on Debian 8 (jessie) where the init-system changed from sysvinit to systemd. I think that it could have something to do with your problem. If you google: raspbian jessie auto login you should find a solution for your problem.
p.e. this link provides a possible solution:
$ sudo -i
# mkdir -pv /etc/systemd/system/getty@tty1.service.d
# nano /etc/systemd/system/getty@tty1.service.d/autologin.conf
insert the following text:
[Service]
ExecStart=-/sbin/agetty --autologin $username --noclear I 38400 linux
make sure that $username is your username
Then reboot.
optional:
If you want to start the X-Server automatically, just add the following line at the end of your ~/.profile
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
I use raspi-config:
pi@raspberrypi:~ $ sudo raspi-config
Created symlink /etc/systemd/system/default.target → /lib/systemd/system/graphical.target.
There's a menu that comes up wherein you select Boot Options then something along the lines of B1 Boot Desktop Options and finally you select among several auto login options.
See: https://raspberrypi.stackexchange.com/questions/48241/auto-login-in-jessie-how
My autologin.conf file appears as below. Note the %I, my pi hangs otherwise:
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin pi --noclear %I 38400 linux