27

I would like to make a debian system where you can only open one GUI program at boot, no other graphical interface, no minimize, or any X apart from that program, is there a way to do it on debian if possible, or any other custom distro? I just want to boot open the program and allow the user to only see and use that program.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Zaxuhe
  • 379
  • 1
  • 3
  • 4
  • 2
    Running a single application is called a kiosk; use this word in your searches, including [here](http://unix.stackexchange.com/questions/tagged/kiosk). – Gilles 'SO- stop being evil' Jan 28 '12 at 22:08
  • I recently was struggling with similar problem and I posted a solution - not debian based, but would work exactly the same way with debian. http://unix.stackexchange.com/questions/344374/how-to-configure-kiosk-with-wayland-xorg Beauty is - only 2 key combinations work (to reboot or to shutdown), system is fast and only has access to browser, normal text input and mouse. No other apps. – r0berts Feb 14 '17 at 15:07

2 Answers2

14

I've done that with Ubuntu (Debian based), though I think the technique applies for other distros too. I'll just summarize the steps here together with some explanation, see "Run Linux with a bare window manager" for the scripts.

  1. Add a custom session by creating a file at /usr/share/xsessions/metacity-session.desktop. This file tells the login manager about your session.

  2. Create the file to be executed by the session added in (1) /usr/local/bin/metacity-session

  3. Create the user-specific config file ~/.metacity-session. This file will be executed by the file added in (2). The content should be the program you want to run, followed by an ampersand, for example

    firefox &
    
  4. Optionally make the user auto-login and make the custom session the default session for the user.

Here I use Metacity as the window manager for its simplicity, you can use Compiz if you want to.

There are tools to lock down the system. A search yields tools such as sabayon and pessulus. I haven't used any of them to give a recommendation.

There are also distros specialized on kiosk mode, the most promising seems to be Fedora Kiosk Mode, though it's not Debian based.

muru
  • 69,900
  • 13
  • 192
  • 292
phunehehe
  • 20,030
  • 27
  • 99
  • 151
7

I know this is a little old but I've written a simple how to on this that works on PCs and the Raspberry PI:

Creating a Debian Chromium Kiosk (PC or Raspberry PI)

  • download and install debian

    • PC x64 or i386 : download "standard" iso from debian.org
    • raspberry pi 2/3 : download "raspbian lite" from raspberryip.org
      • use Win32DiskImager to write img to SD card
  • after install use apt to install packages

    apt install --no-install-recommends xorg openbox lightdm chromium pulseaudio
    
    • on raspberry pi chromium package is chromium-browser
    • installing packages is slow on raspberry, get a FAST SD card (class 10 or better)
  • configure lightdm for autologin

    • edit /etc/lightdm/lightdm.conf goto [SeatDefaults] section, uncomment autologin-user
      [SeatDefaults]
      autologin-user={USER}
      
    • {USER} is defined during debian installer for PC
    • {USER} is 'pi' for raspberry pi
  • configure openbox to start chromium automatically

    • edit /etc/xdg/openbox/autostart or create ~/.config/openbox/autostart and add these lines:
      xset -dpms
      xset s off
      chromium --kiosk http://google.com
      
    • change google.com to whatever you need
    • the xset commands disable screen savers
    • on raspberry pi chromium is chromium-browser
  • to auto connect to Wifi

    • edit /etc/network/interfaces and write:
      auto wlan0
      iface wlan0 inet dhcp
        wpa-ssid {ssid}
        wpa-psk  {password}
      
    • replace {ssid} and {password} with your respective WiFi SSID and password
muru
  • 69,900
  • 13
  • 192
  • 292
Peter Quiring
  • 171
  • 1
  • 2
  • 1
    You can also modify `xserver-command` on `/etc/lightdm/lightdm.conf` if you want hide mouse cursor. `xserver-command=X -bs -core -nocursor` – EFernandes Oct 11 '18 at 15:34