Setup Ubuntu Kiosk Mode: Complete Guide
Setting up a computer in kiosk mode, where a single application or webpage runs full-screen, can be incredibly useful for public spaces, information desks, or digital signage. Ubuntu, a popular Linux distribution, offers a straightforward way to achieve this. In this guide, we'll walk you through the process of setting up Ubuntu in kiosk mode, ensuring a seamless user experience for your specific use case.
Before we dive into the setup process, let's briefly understand what you'll need. You'll require an Ubuntu system (we'll use Ubuntu 20.04 LTS for this guide), a user account for the kiosk mode, and the specific application or webpage you want to run in full-screen.
Preparing Your Ubuntu System for Kiosk Mode
First, ensure your Ubuntu system is up-to-date by running the following commands in the terminal:
sudo apt updatesudo apt upgrade
Creating a Kiosk User Account
Next, create a new user account that will be used in kiosk mode. This user should not have sudo (administrative) privileges to prevent unauthorized access. Use the following command to create a new user:
sudo adduser --shell /bin/bash --gecos "Kiosk User" kioskuser
During the process, you'll be prompted to enter and verify a password for the new user. After creating the user, you can switch to the new user account using the command su - kioskuser.
Installing Essential Software
Depending on your use case, you might need to install specific software for the kiosk mode. For instance, if you're running a webpage in full-screen, you'll need a web browser like Firefox. You can install it using the following command:
sudo apt install firefox
Configuring LightDM for Automatic Login
LightDM is Ubuntu's display manager, responsible for handling user sessions. We'll configure it to automatically log in to the kiosk user account.
Editing LightDM Configuration
Open the LightDM configuration file in a text editor with sudo privileges. For instance, use nano:
sudo nano /etc/lightdm/lightdm.conf
Adding Automatic Login Settings
Add the following lines at the end of the file, replacing 'kioskuser' with the username you created earlier:
automatic-login-user=kioskuserautomatic-login-enabled=true
These lines will enable automatic login and set the user to your kiosk user account.
Setting Up the Kiosk Session
There are two main ways to set up a kiosk session in Ubuntu: using a custom xorg configuration file or using the Unity Tweak Tool for graphical settings. We'll use the custom xorg configuration method, which provides more control over the kiosk mode.
Creating a Custom Xorg Configuration File
Create a new xorg configuration file for your kiosk user. You can use the following command:
sudo cp /etc/lightdm/lightdm.conf.d/50-ubuntu.conf /etc/lightdm/conf.d/51-kiosk-user.conf
Editing the Xorg Configuration File
Open the newly created xorg configuration file in a text editor with sudo privileges:
sudo nano /etc/lightdm/conf.d/51-kiosk-user.conf
Add the following lines to the file, replacing '
user-session=ubuntuGreeter-show-switch-user=falseuser-workspace=usernamemetadata·l10n·name=Kioskautologin-user=usernameautologin-user-timeout=0server-args=xorgConf=/dev/null -nolisten tcp vt7 -ac -dpi 96 -screen 0 1024x768 -s 0 - Kes -s -nolisten tcp vt7 -ac -dpi 96 -screen 0 1024x768
The last line runs the specified application ('/usr/bin/firefox' in this case) in full-screen using the following arguments:presaopacity)es matquevel
After configuring the xorg file, save and close it. Now, whenever the system boots, it will automatically log in to the kiosk user account and run the specified application in full-screen.
Testing and Refining Your Kiosk Setup
Reboot your system to test your kiosk setup. If everything works as expected, you can fine-tune the setup to optimize it for your specific use case. This might include adjusting display settings, configuring the application's behavior in full-screen, or setting up timers to reset the kiosk mode after a certain period.
That's it! Now your Ubuntu system is set up to run in kiosk mode flawlessly. Whether you're using it for a public display, an information desk, or a digital signage project, Ubuntu's kiosk mode offers a simple and effective way to ensure a seamless user experience.