Skip to main content

Autostart Chromium Kiosk Browser

Overview​

This guide explains how to configure Chromium to start automatically on a device running Clea OS.

The browser is started through a custom systemd service after the Weston graphical environment is available. In this example, Chromium automatically opens the SECO website.

The configuration can be adapted to open another web page or a locally hosted web application.


Requirements​

Before configuring the Chromium autostart, verify the following:

  • Clea OS is running with the Weston graphical environment.
  • Chromium is available at /usr/bin/chromium.
  • You have access to the target device command line.
  • If the configured web page requires Internet access, the device must have a working network connection.
note

All commands in this guide are executed on the target device, indicated by the # prompt.
Do not copy and paste the # to execute commands.


1. Disable the Existing OOBE Application​

Clea OS may already use the oobe-application-start service to start Chromium and display the default OOBE application as a running demo.

Stop and disable this service before configuring the custom Chromium autostart:

# systemctl stop oobe-application-start
# systemctl disable oobe-application-start

Disable the OOBE web server as well:

# systemctl disable oobe-server

This prevents the existing OOBE application and its web server from starting automatically.


2. Create the Chromium Service​

Create a new systemd service file:

# vi /etc/systemd/system/mydemo.service

Press i to enter insert mode and add the following configuration:

[Unit]
Description=my_chromium_demo
After=weston.service
After=network-online.target
Requires=weston.service
Requires=network-online.target
Conflicts=getty@tty1.service

[Service]
Type=simple
Environment=XDG_RUNTIME_DIR=/var/run/user/1000
Environment=WAYLAND_DISPLAY=/run/wayland-0
Environment=QT_QPA_FONTDIR=/usr/share/fonts/truetype
Environment=QT_QPA_PLATFORM=wayland
ExecStart=/usr/bin/chromium --no-sandbox www.seco.com
TimeoutSec=60
Restart=on-failure
StandardOutput=journal
StandardError=journal
SyslogIdentifier=qt-kiosk-browser
User=weston
Group=weston
WorkingDirectory=/home/weston

[Install]
WantedBy=multi-user.target

Press Esc to leave insert mode and save the file with:

:wq

3. Configure the Web Page​

The web page that is automatically opened by Chromium is configured in the ExecStart line:

ExecStart=/usr/bin/chromium --no-sandbox www.seco.com

Replace www.seco.com with the web page or local application that should be displayed.

For example:

ExecStart=/usr/bin/chromium --no-sandbox https://www.example.com
tip

Only the ExecStart entry needs to be changed to configure a different web page.


4. Network Dependency​

The example service waits for network connectivity before Chromium is started:

After=network-online.target
Requires=network-online.target

If network connectivity is not required, for example when displaying a locally available web page, these two lines can be removed from the service.

The dependency on Weston must remain:

After=weston.service
Requires=weston.service

For more information about systemd unit dependencies and ordering, refer to the systemd documentation.


5. Reload the systemd Configuration​

After creating the service file, reload the systemd manager configuration:

# systemctl daemon-reload

6. Enable Autostart​

Enable the new service so that Chromium starts automatically during system startup:

# systemctl enable mydemo

7. Start Chromium​

Start the service immediately without rebooting the device:

# systemctl start mydemo

Chromium should now start and open the web page configured in the ExecStart entry.


Verify the Configuration​

Check the current status of the service:

# systemctl status mydemo

If additional information is required, check the service log:

# journalctl -u mydemo

Troubleshooting​

Chromium Does Not Start​

Check the service status:

# systemctl status mydemo

Review the service log for additional information:

# journalctl -u mydemo

OOBE Application Still Starts​

Verify the status of the original OOBE services:

# systemctl status oobe-application-start
# systemctl status oobe-server

If necessary, stop the services:

# systemctl stop oobe-application-start
# systemctl stop oobe-server

Then restart the custom Chromium service:

# systemctl restart mydemo

Web Page Is Not Available​

If the configured web page requires network access, verify that the device has a working network connection.

For network-dependent pages, make sure that the following entries are included in the service:

After=network-online.target
Requires=network-online.target

For a locally available page that does not require network connectivity, these dependencies can be omitted.


Summary​

You have configured Clea OS to automatically start Chromium using a custom systemd service.

The configuration disables the existing OOBE application and web server, starts Chromium after the Weston graphical environment is available, and automatically opens the configured web page during system startup.

To display a different web page or local web application, adjust the URL in the ExecStart entry.