0

I have a Pi 3 and I'd like to start Chromium with a fixed address on startup. I've read a lot of tutorials on this, but most of them are outdated and use the full Jessie with Pixel Desktop package.

I'd like to keep it slim, and just installed Jessie Lite. I've found this thread Autorun browser kiosk with Jessie Lite that addresses the exact issue I have, but unfortunately all links provided are not very helpful.

I think that I need to start some kind of x server on startup. Then Chromium should start in kiosk mode and use the window from the x server to display it's content.

My naive approach was just to fire up Chromium. Of course I haven't started a x server, so I get the following error:

pi@raspberrypi:/ $ chromium-browser 
[5381:5381:1216/110715:ERROR:browser_main_loop.cc(271)] Gtk: cannot open display: 

I read something about lightdm so I installed it, and tried

pi@raspberrypi:/ $ sudo lightdm

and voilà, it fires a desktop, where I can start Chromium. Unfortunately, it displays a window with an error, where I can klick ok:

GDBus.Error:org.freedesktop.DBus.Error.ServiceUnkown: The name org.freedesktop.PolicyKit1 was not provided by any .service files

I can start Chromium, but I'm a little stuck here:

  • How would I start lightdm AND Chromium on startup?
  • Is lightdm the right choice for this? Or is there an easier xserver where one just starts a single application, without the whole desktop stuff?
  • How can I get rid of the error when lightdm starts?
Ingo
  • 42,107
  • 20
  • 85
  • 197
23tux
  • 109
  • 1
  • 4
  • 1
    If you only want to display a single page check this out https://github.com/guysoft/FullPageOS – Steve Robillard Dec 16 '16 at 11:28
  • "How would I start lightdm AND Chromium on startup?" -> The primary purpose of a display manager (the "dm" in "lightdm") is to provide a GUI login, which from the sound of things you don't want, so there's no point in pursuing this. Unless you mean, you want to go from the login to Chromium. You do not need a display manager to run the Xorg server. You can run it all by itself, with one application inside it, which would be the normal approach to creating a kiosk. – goldilocks Dec 16 '16 at 12:46
  • @goldilocks That sounds exactly like what I want. Could you provide an example? – 23tux Dec 16 '16 at 13:42
  • This explains how to start X with a single application: http://raspberrypi.stackexchange.com/a/11887/5538 If you use autologin on you can do that with a regular user to create a kiosk. Just beware for the pi user there are security issues with that unless you disable its sudo powers. There are other ways to accomplish the same thing without an autologin, since a privileged process can start X as an unprivileged user -- the one thing you do not want to do is start Chromium as root. – goldilocks Dec 16 '16 at 13:49
  • However, I would look at that first link from Steve as this is exactly what that is for (and by default it deploys Chromium). – goldilocks Dec 16 '16 at 13:50

1 Answers1

1

I think you are a bit confused. The things to do are:

  1. start only the X server (not a DM like LightDM or GDM)
  2. Write in xinit config to start chromium after the desktop manager (i can suggest Openbox or lxde for example through xorg-xinit)

The error given is because no screen accessible by DBUS at that moment

MadPapo
  • 241
  • 1
  • 8