sudo apt update && sudo apt upgrade -y
sudo adduser kiosk
- Chromium is the Chrome browser but with much more options.
- Unclutter removes the mouse cursor from the screen, giving it a clean look.
- xdotool can manipulate on screen elements using a virtual keyboard. We use it to change tabs in Chromium.
sudo apt-get install -y chromium-browser unclutter xdotool
Now we can setup the auto login process. We need the user Kiosk to auto login on every reboot.
sudo nano /etc/lightdm/lightdm.conf
and add lightdm.conf
sudo mkdir /etc/lightdm/lightdm.conf.d && sudo nano /etc/lightdm/lightdm.conf.d/50-myconfig.conf
and add:
[SeatDefaults]
autologin-user=kiosk
Run
sudo mkdir /home/kiosk/.config/autostart && sudo nano /home/kiosk/.config/autostart/kiosk.desktop
and add:
[Desktop Entry]
Type=Application
Name=Kiosk
Exec=/home/kiosk/kiosk.sh
X-GNOME-Autostart-enabled=true
Then make the script executable by running chmod +x kiosk.sh
Copy kiosk.sh
script to /home/kiosk/
x11vnx
and autossh
to automatically setup an SSH tunnel from the system to your centralized server, allowing you to SSH into the device and even VNC to the monitor without needing to know the IP. Very useful!
If you make any changes and want to log Kiosk out without rebooting, I’ve found that this command works. This will kill the kiosk.sh script and restart the Windows service which will log out and log in the kiosk user.
sudo killall kiosk.sh && sudo service lightdm restart
How to exit Kiosk mode
Ubuntu Unity UI allows you to press the Windows key on the keyboard to open the launcher. Once the launcher is open, type terminal. Once in the terminal type
sudo killall chromium-browser
or press Alt+F4 to close Chromium.
The kiosk.sh
script will still be running, this script has the xdotool keydowns running (see above).
We need to kill that too with sudo killall kiosk.s
h.
To remove it all together, refer to the above to remove the /home/kiosk/.config/autostart/kiosk.desktop
file.