Monday, 8 August 2016

Linux Kiosk computer with Chrome Browser [2]

So my steps followed are:

  1. Install Ubuntu Server 14.04.5 from a bootable pen drive
  2. Set my username to user with a password
  3. Enabled automatic updates
  4. Install OpenSSH server in the tasksel at the end
  5. Reboot
  6. Log or SSH into the system (latter from another system is preferred since you can copy and paste instructions from this web page)
  7. Install some packages:
    1. sudo apt install --no-install-recommends chromium-browser
    2. sudo apt install  --no-install-recommends xorg openbox pulseaudio
    3. sudo usermod -a -G audio $USER
  8. Edit the kiosk.sh file:
    1. sudo nano /opt/kiosk.sh
    2. Enter the following lines:
      #!/bin/bash

      xset -dpms
      xset s off
      openbox-session &
      start-pulseaudio-x11

      while true; do
      rm -rf ~/.{config,cache}/chromium/
      chromium-browser --incognito --disable-background-mode --disable-sync --start-maximized --no-first-run 'http://www.example.com
      done
    3. Ctrl-O to write the file then Ctrl-X to exit
  9. sudo chmod +x /opt/kiosk.sh to make the script executable
  10. Edit the kiosk.conf file:
    1. sudo nano /etc/init/kiosk.conf
    2. Enter the following lines:
      start on (filesystem and stopped udevtrigger)
      stop on runlevel [06]
      
      console output
      emits starting-x
      
      respawn
      
      exec sudo -u user startx /etc/X11/Xsession /opt/kiosk.sh --
      
      
    3. Ctrl-O to write the file then Ctrl-X to exit
  11. sudo dpkg-reconfigure x11-common and select "Anybody" can start the X server
  12. try sudo start kiosk for testing and away it should go (or reboot)
  13. Change grub configuration to hide startup messages:
    1. sudo nano /etc/default/grub
    2. Find GRUB_CMDLINE_LINUX_DEFAULT and put quiet splash inside the quotes.
    3. Ctrl-O to write the file then Ctrl-X to quit
    4. Run the command sudo update-grub
    5. Reboot to test
I am still looking at whether to clone the disk to copy it to another computer. It looks complex to do this, because we really want to be copying a whole disk (two partitions) instead of just a partition at a time.

Chromium policies are also a possible scenario as referred to in the previous post.

There is some OpenBox stuff we want to change, particularly the number of virtual desktops offered and the right click menu that we don't want. Only one virtual desktop and disable the popup etc.

To do this copy /etc/xdg/openbox/rc.xml to /home/user/.config/openbox and then use nano to edit the latter. Look for the <desktops> section to set the number of desktops to 0, look for <keybind>s that relate to switching desktops, and look for a <mousebind> for a right mouse click that relates to the root menu to get rid of the right click menu.