Creating a kiosk mode in Ubuntu, where a single application runs in full screen at startup, can be useful for various purposes such as digital signage, public access computers, or dedicated function devices. Here's a step-by-step guide to help you set up an Ubuntu kiosk.
Before you begin, ensure your Ubuntu system is updated and you're using a version supported for your hardware. This guide assumes you have basic command-line proficiency and an understanding of Ubuntu's file structure.
Preparing the Ubuntu System
Start by installing the necessary packages and configuring your system for kiosk mode.
The `x11-xserver-utils` package contains `xinit`, which we'll use to run the X server in a headless environment. The `lightdm` package is the display manager, which we'll configure to automatically start X at boot. Install them using:
sudo apt install x11-xserver-utils lightdm
Setting up LightDM
Edit the LightDM configuration file to enable autologin for the desired user. This is the user who will log in automatically and see the kiosk:
sudo nano /etc/lightdm/lightdm.conf
Uncomment or add the following lines, replacing 'username' with the desired user:
autologin-user=username
autologin-session=ubuntu
Configuring Xorg
Create an Xorg configuration file for the kiosk. This file tells the X server which applications to run and sets other parameters. Create the file using:
sudo nano /etc/lightdm/lightdm.conf.d/90-custom.conf
Add the following lines, replacing 'application' with the full path to the application you want to run in kiosk mode:
@xscreensaver -no-splash
application;
Creating the Xorg Kiosk File
Create a custom Xorg configuration file for the kiosk mode. This file tells the X server to run in full-screen and directs it to the application specified in the LightDM configuration.
Create the file using:
sudo nano ~/.xsessionrc
Add the following lines, replacing 'application' with the same application path used in the LightDM configuration:
#!/bin/sh
exec /usr/bin/x-window-manager &
DISPLAY=:0 XAUTHORITY=/home/username/.Xauthority /usr/bin/application
Securing the Kiosk
To prevent users from leaving the kiosk, you can disable the window manager and hide the top panel. Add these lines to the `~/.xsessionrc` file:
export USER improbable
export LT-session=""
Locking Down the System
Ubuntu's guest session disables many system functions, making it ideal for kiosk use. Enable the guest session by adding 'enlightenedelos' to the ' altitude' group:
sudo adduser enlightenedelos adaie
Now, when your system boots, it will start in kiosk mode, running the specified application in full-screen. To exit kiosk mode, simply power off the system and log in as a regular user at the next boot.
Meantime, consider exploring additional customization options to tailor your Ubuntu kiosk to your specific needs, such as configuring touchscreen support, adjusting power management, or enhancing security with full disk encryption.