RidgeRun Platform Security Manual/Getting Started/Kiosk Modes

From RidgeRun Developer Wiki


NVIDIA partner logo NXP partner logo






Kiosk mode on a Jetson Orin Nano essentially transforms the powerful embedded system into a dedicated, single-purpose device. Instead of a general-purpose desktop environment, it boots directly into a specific application, often in a full-screen, locked-down state. This is incredibly useful for creating interactive displays, digital signage, point-of-sale systems, or any application where a user should only interact with a single, defined interface.

Below is a general approach to activate kiosk mode. This was done on a Jetson Orin Nano using JetPack 6. This assumes the board is already flashed. In case the board is not flashed, please follow Flashing_with_SDK_Manager_Guide to flash a Jetson board using Jetpack 6 and Linux for Tegra. Also, the board needs to be connected to a screen. It could be via HDMI.

With the board connected to an HDMI screen and a keyboard, login into the default user, created in the flashing process. Open a terminal with the following keys:

ctrl + alt + t

Create a dedicated user for kiosk mode.

sudo useradd -m kioskmode

Then, enable login without a password on the kiosk mode user.

sudo passwd -d kioskmode

This will allow you to directly get into the kiosk mode session without the user having to provide login information. Also, autologin must be set for the kiosk mode user. This will tell the system to login in kiosk mode user without asking. To achieve this, modify the gdm3 custom configuration.

Open the custom configuration file for gdm3:

sudo nano /etc/gdm3/custom.conf

In the [daemon] section, add or modify:

[daemon]
AutomaticLoginEnable=true
AutomaticLogin=kioskmode

For reference gdm3 stands for GNOME Display Manager version 3. As its name says, it is the display manager that runs after the boot process is done, and has functionalities like handling the login screen and the process itself. It also handles the session for the desktop environment and the necessary resources for it.

Now, an xsession created specially for Kiosk mode is needed. Create the kiosk.desktop file:

sudo nano /usr/share/xsessions/kiosk.desktop

Add the following lines:

[Desktop Entry]
Name=KioskMode
Comment=Starts the kiosk application
Exec=/home/kioskmode/kioskmode.sh
Type=Application

This .desktop file is used to launch a desktop session. In this file, the session's name is defined. There is also a comment added to describe what the session is going to do. The Exec value defines the application that is going to be run. This is a important value because it shows the name of the application that is going to be run or the path to the executable. It is going to be the name of the application if it is a system wide installed application, or a path if an specific executable wants to be launched. For the Type value, which is Application, signifies that this .desktop file defines an entire desktop session rather than a single application that would typically appear in a menu. This might seem a bit counter-intuitive, but it's the standard way to define sessions. The [Desktop Entry] header is the standard for .desktop file.

To activate kiosk mode, we also need to create a configuration file for the kiosk user inside the accounts service.

sudo nano /var/lib/AccountsService/users/kiosk

And add or modify the following lines in the [user] section:

[User]
Language=
XSession=kiosk
Session=kiosk

the [User] header is the standard to let the service know that the following lines define general properties for the user account. The XSession value specifies the desktop session to be used when the "kioskmode" user logs in.

Save and close the file. Set kiosk.desktop as the Default Session for the kiosk User

sudo su -
nano /var/lib/AccountsService/users/kiosk

Modify it or add the following lines.

Session=kiosk
XSession=kiosk

Exit Root User

exit

And then only reboot the board

sudo reboot

You should go directly to screen