39

I'd like to put my Raspberry Pi into a kiosk mode with Chromium directed to my website but I can't seem to figure out how to get it to work. I've been following a few different guides, and the code they have given me has all been slightly different so I'm not sure what exactly to follow.

So far I've tried a few different variations of changing the code in

/etc/xdg/lxsession/LXDE-pi/autostart

with this:

#@xscreensaver -no-splash
@xset s off
@xset -dpms
@xset s noblank
@chromium --noerrdialogs --kiosk http://localhost --incognito

I also put the same code in

/etc/xdg/lxsession/LXDE/autostart

It still boots to just the desktop and I'm at a loss of what to do, as there doesn't seem to be very many tutorials discussing this and none that are recent.

3
  • 1
    Hello and welcome. Have a look here and let us know whether that's helpful or not.
    – Ghanima
    Jan 6, 2016 at 1:35
  • 1
  • 1
    Thanks for the help but that did not do the trick either. Honestly this is kind of ridiculous. This seems like a common thing people would want to do with their pi, yet there is little to no info on how to do it and the steps seems to change for every iteration of the OS.
    – DavidK
    Jan 7, 2016 at 0:02

2 Answers 2

48

I have a Raspberry Pi 2 running Raspbian Jessie with Chromium 45 installed. I found that you need to copy the existing autostart file to your local:

mkdir -p /home/pi/.config/lxsession/LXDE-pi/
cp /etc/xdg/lxsession/LXDE-pi/autostart /home/pi/.config/lxsession/LXDE-pi/autostart

So edit this local version:

nano /home/pi/.config/lxsession/LXDE-pi/autostart

#@xscreensaver -no-splash  # comment this line out to disable screensaver
@xset s off
@xset -dpms
@xset s noblank
@chromium-browser --incognito --kiosk http://localhost/  # load chromium after boot and point to the localhost webserver in full screen mode

Save

sudo reboot
5
  • 1
    FINALLY! The right file! Jun 8, 2016 at 8:30
  • 3
    Before trying this, I want to know how to get out of Kiosk mode so I can make changes. Yet, I don't want anyone else to be able to do that.
    – Chiwda
    Feb 28, 2017 at 12:01
  • 1
    I guess you could, at worst, SSH in from somewhere else and edit the file to remove the autostart options? Nov 29, 2017 at 18:40
  • 1
    Yep. ssh -Y kioskname into the system, then sudo killall chromium-browser will kill it. Then you can just run Chromium via the ssh connection to change settings in the browser. Then sudo init 6 will cleanly reboot it.
    – SDsolar
    Jun 28, 2018 at 0:29
  • this changed my default theme, how to fix back :)
    – Wasim A.
    Nov 13, 2019 at 20:14
6

By default the Pi the auto-logon X environment is done with credentials of the pi user. The config setting's of the Xserver environment of this user is in /home/pi/.config/lxsession/LXDE-pi/autostart, NOT in /etc/xdg/lxsession/LXDE-pi/autostart (this is the environment for the root user).

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