40

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.

Aurora0001
  • 6,308
  • 3
  • 23
  • 38
DavidK
  • 503
  • 1
  • 5
  • 7

2 Answers2

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
Roger Lipscombe
  • 163
  • 2
  • 12
Justin N
  • 496
  • 5
  • 2
  • 1
    FINALLY! The right file! – Quintin Balsdon Jun 08 '16 at 08: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 '17 at 12:01
  • 1
    I guess you could, at worst, SSH in from somewhere else and edit the file to remove the autostart options? – Neil Barnwell Nov 29 '17 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 '18 at 00:29
  • this changed my default theme, how to fix back :) – Wasim A. Nov 13 '19 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).

techraf
  • 4,319
  • 10
  • 31
  • 42
kamiel
  • 61
  • 1
  • 1