Skip to content

Instantly share code, notes, and snippets.

@smahi
Last active October 21, 2024 05:17
Show Gist options
  • Save smahi/a80302fa0ac031697a4e2985826837cd to your computer and use it in GitHub Desktop.
Save smahi/a80302fa0ac031697a4e2985826837cd to your computer and use it in GitHub Desktop.

How to Setup Kiosk mode on Ubuntu

For more details please visit http://fisherworks.cn/?p=2517

$ sudo apt update && sudo apt dist-upgrade

$ sudo apt install vim-nox openssh-server chromium-browser x11vnc slick-greeter

On lightdm configuration screen choose lightdm

Disable Chromium notifications (password section ... etc)

$ sudo vim /etc/lightdm/lightdm.conf

[SeatDefaults]
autologin-user=kiosk
autologin-user-timeout=0
user-session=ubuntu
greeter-session=unity-greeter

$ sudo vim /etc/lightdm/lightdm.conf.d/50-myconfig.conf

[SeatDefaults]
autologin-user=kiosk

$ sudo mkdir /home/kiosk/.config/autostart && sudo vim /home/kiosk/.config/autostart/kiosk.desktop

[Desktop Entry]
Type=Application
Name=Kiosk
Exec=/home/kiosk/kiosk.sh
X-GNOME-Autostart-enabled=true

$ vim /home/kiosk/kiosk.sh

#!/bin/bash
 
# Run this script in display 0 - the monitor
export DISPLAY=:0
 
# Run x11vnc
/usr/bin/x11vnc  -create -xkb -noxrecord -noxfixes -noxdamage -display :0 -auth /var/run/lightdm/root/:0 -rfbauth /home/kiosk/.x11vnc.pass -forever -rfbport 5905 &
 
# If Chromium crashes (usually due to rebooting), clear the crash flag so we don't have the annoying warning bar
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/kiosk/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/kiosk/.config/chromium/Default/Preferences
 
# Run Chromium
/usr/bin/chromium-browser --kiosk https://duckduckgo.com &

$ chmod +x kiosk.sh

Create x11vcn password

$ x11vnc -storepasswd kiosk#2019 .x11vnc.pass

To change the screen resolution

$ xrandr -d :0 -s 1366x768

@rcfoster1111
Copy link

You don't need to install vim-nox plus it's complicated to use anyway. Nano is much more friendlier to use, especially when just editing config files. I think it comes already installed on Ubuntu 18.04 & 20.04; not completely sure. But if not it's quick to install and has a much smaller filesize than vim-nox.

@rtulke
Copy link

rtulke commented Sep 1, 2023

You don't need to install vim-nox plus it's complicated to use anyway. Nano is much more friendlier to use, especially when just editing config files. I think it comes already installed on Ubuntu 18.04 & 20.04; not completely sure. But if not it's quick to install and has a much smaller filesize than vim-nox.

i agree with nano for new beginner but defacto standard is vim everywhere :-)

@smahi
Copy link
Author

smahi commented Sep 1, 2023

@rtulke @rcfoster1111 you are free to use nano or whatever text editor your are comfortable with.
I am a Vim user, sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment