Skip to content

Instantly share code, notes, and snippets.

@seffs
Last active November 15, 2024 23:36
Show Gist options
  • Save seffs/2395ca640d6d8d8228a19a9995418211 to your computer and use it in GitHub Desktop.
Save seffs/2395ca640d6d8d8228a19a9995418211 to your computer and use it in GitHub Desktop.
Raspbian Bookworm - Ultra Minimal Kiosk Setup

This was tested on a FRESH Raspbian Bookworm Lite installation. Proceed with caution.

EDIT 23/12/2023: Removed dead download link and added own release

EDIT 09/06/2024: Force wayland after install

EDIT 06/07/2024: Add Troubleshooting section

EDIT 11/09/2024: Rearrange config file


First Steps

Update your system

sudo apt update && sudo apt -y full-upgrade

Install core packages

sudo apt install wayfire seatd xdg-user-dirs

Create ~/.config/wayfire.ini

mkdir -p ~/.config
touch ~/.config/wayfire.ini

Force Wayland through raspi-config

See https://raspberrypi.stackexchange.com/a/144867 ---> REBOOT

On systems older than Pi4: you need wayland=on
See https://www.raspberrypi.com/documentation/computers/configuration.html#wayland
---> REBOOT

Test wayfire

wayfire ---> A black screen should appear with the mouse pointer at the center. Otherwise see Troubleshooting

Note: if you are controlling your Pi with a physical keyboard, you might not be able to terminate the process from the same session. This is because no keybindings exist in the config file yet. You can spawn a second tty with ctrl+alt+f2 and kill it from there.


Change display orientation

sudo apt install wlr-randr

Rotate display: WAYLAND_DISPLAY=wayland-1 wlr-randr --output HDMI-A-1 --transform 180
(------------------------has to be launched from within the session. Keep reading---------------------------)


Hide mouse pointer

You'll need the wayfire-plugins-extra package. Unfortunately it is not available in the Bookworm repos. You have two ways to install it [1]

1.1) Download compiled library

  1. Choose your arch
  1. Decompress with tar xf /path/to/wayfire-plugins-extra.tar.xz
  2. Each plugin comes with a .so and a an .xml file. You will need to copy those files to their correct paths:
    /usr/lib/<your-arch-linux-gnu>/wayfire/<desired-plugin>.so
    /usr/share/wayfire/metadata/<desired-plugin>.xml

1.2) Build from source

  1. Install dev packages:
    sudo apt install libglibmm-2.4-dev libglm-dev libxml2-dev libpango1.0-dev libcairo2-dev wayfire-dev libwlroots-dev libwf-config-dev
  2. Follow the instructions in https://github.com/seffs/wayfire-plugins-extra-raspbian/
  3. Each plugin comes with a .so and .xml file. meson should take care of the installation. Otherwise check if the following path exists for any new extra plugin:
    ls /usr/lib/<your-arch-linux-gnu>/wayfire/<new-extra-plugin>.so
    ls /usr/share/wayfire/metadata/<new-extra-plugin>.xml

2) Activate your plugin(s)

I was only interested in hiding the mouse pointer. This can be accomplished with the hide_cursor plugin. The same concept applies to the rest of plugins.

Open your ~/.config/wayfire.ini file and paste the following:

[core]
plugins = \
        autostart \
        ### We need to add the extra plugin to the list ###
        hide-cursor

### We can tweak it to our liking. You will find the documentation inside of each plugin's XML file. ###
#[hide-cursor]
#toggle = <alt> KEY_Z
#hide_delay = 3

### Execute commands on compositor startup ###
[autostart]
# my_script = /path/to/script
rotate_display = WAYLAND_DISPLAY=wayland-1 wlr-randr --output HDMI-A-1 --transform 360

Execute your script on startup

Adjust my_script = /path/to/script to your needs. Don't forget to uncomment it.

Start wayfire

wayfire -c ~/.config/wayfire.ini ---> See? No pointer!

Troubleshooting

failed to open vc4: /usr/lib/dri/vc4_dri.so

sudo apt install libgl1-mesa-dri
sudo apt install mesa-utils --> If you want to test the mesa drivers

Vulkan support

sudo apt install vulkan-tools mesa-vulkan-drivers

X11 support

sudo apt install xwayland --> Lots of dependencies. Install if necessary


[1] Based on bjtheone's instructions

@seffs
Copy link
Author

seffs commented Jan 31, 2024

EE 20-01-24 12:15:25.053 - [EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message:
"eglQueryDeviceStringEXT"
MESA-LOADER: failed to open vc4: /usr/lib/dri/vc4_dri.so: cannot open shared object file: No such file or directory

A couple of things you can try:

Let me know what works for you. I'll consider adding them to the guide.

@attree
Copy link

attree commented Feb 3, 2024

This is great, thanks for this gist.

@swvalenti194
Copy link

I am somewhat of a novice but I think I followed all these instructions. I see the paths of the hide curser .so and .xml. I created the config and added hide-curser config. But the curser never disappears. When I start wayfire I get the below. I probably did something wrong but I don't know where. Anyway to dumb it down more? HA. Thanks

swvalenti@raspberrypiwx:~ $ wayfire -c ~/.config/wayfire.ini II 09-04-24 18:12:46.202 - [src/main.cpp:280] Starting wayfire version 0.7.5 EE 09-04-24 18:12:46.203 - [libseat] [libseat/backend/seatd.c:308] Could not poll connection: Broken pipe II 09-04-24 18:12:46.203 - [libseat] [libseat/libseat.c:76] Backend 'seatd' failed to open seat, skipping II 09-04-24 18:12:46.203 - [libseat] [libseat/libseat.c:76] Backend 'logind' failed to open seat, skipping II 09-04-24 18:12:46.205 - [libseat] [seatd/seat.c:39] Created VT-bound seat seat0 II 09-04-24 18:12:46.205 - [libseat] [seatd/server.c:145] New client connected (pid: 1924, uid: 1000, gid: 1000) II 09-04-24 18:12:46.205 - [libseat] [libseat/backend/seatd.c:633] Started embedded seatd EE 09-04-24 18:12:46.205 - [libseat] [common/terminal.c:162] Could not open target tty: Permission denied EE 09-04-24 18:12:46.205 - [libseat] [seatd/seat.c:61] Could not open tty0 to update VT: Permission denied II 09-04-24 18:12:46.205 - [libseat] [seatd/seat.c:170] Added client 0 to seat0 EE 09-04-24 18:12:46.205 - [libseat] [common/terminal.c:162] Could not open target tty: Permission denied EE 09-04-24 18:12:46.205 - [libseat] [seatd/seat.c:72] Could not open terminal for VT 0: Permission denied EE 09-04-24 18:12:46.205 - [libseat] [seatd/seat.c:461] Could not open VT for client EE 09-04-24 18:12:46.206 - [libseat] [common/terminal.c:162] Could not open target tty: Permission denied EE 09-04-24 18:12:46.206 - [libseat] [seatd/seat.c:86] Could not open terminal to clean up VT 0: Permission denied II 09-04-24 18:12:46.206 - [libseat] [libseat/libseat.c:73] Seat opened with backend 'builtin' II 09-04-24 18:12:46.206 - [backend/session/session.c:109] Successfully loaded libseat session II 09-04-24 18:12:46.206 - [backend/backend.c:91] Waiting for a session to become active EE 09-04-24 18:12:56.216 - [backend/backend.c:114] Timeout waiting session to become active EE 09-04-24 18:12:56.216 - [backend/backend.c:352] Failed to start a DRM session EE 09-04-24 18:12:56.217 - [src/main.cpp:144] Fatal error: Segmentation fault EE 09-04-24 18:12:56.299 - #1 wf::print_trace(bool) ??:? addr2line: '?,ߥ': No such file addr2line: '?,ߥ': No such file EE 09-04-24 18:12:56.317 - #2 ??? ??? EE 09-04-24 18:12:56.346 - #3 wlr_backend_get_drm_fd ??:? EE 09-04-24 18:12:56.379 - #4 main ??:? EE 09-04-24 18:12:56.742 - #5 __libc_start_call_main ../sysdeps/unix/sysv/linux/aarch64/libc-start.c:74 EE 09-04-24 18:12:56.928 - #6 call_init ../csu/libc-start.c:128 EE 09-04-24 18:12:56.948 - #7 _start ??:? II 09-04-24 18:12:56.949 - [libseat] [seatd/client.c:471] Client disconnected EE 09-04-24 18:12:56.950 - [libseat] [common/terminal.c:162] Could not open target tty: Permission denied

@seffs
Copy link
Author

seffs commented Apr 10, 2024 via email

@swvalenti194
Copy link

Seated was installed and already up to date

@seffs
Copy link
Author

seffs commented Apr 15, 2024

@swvalenti194 there could be a number of reasons for this to happen. I'm afraid I won't be able to help you troubleshoot this to the very end, but I'm willing to point you to other resources. I would suggest starting from scratch and document each step you followed before the error appears. What is your current setup (Pi model, connected hardware)? Are you using a fresh Bookworm Lite Image?

@swvalenti194
Copy link

@seffs I understand, I appreciate the effort. PI4 with bookworm desktop and touchscreen display. I guess the issue is it's not the lite version.

@seffs
Copy link
Author

seffs commented Apr 16, 2024

@swvalenti194 then you might not need to install seatd at all. Uninstall it and then execute the following command:

apt-get install --reinstall -o Dpkg::Options::="--force-confask" raspberrypi-ui-mods

This should bring your Desktop GUI back to default. After that, try to switch wayland -> X11-> wayland through raspi-config (see my second comment on this thread).

In (the best) case of a reinstall, skip the First Steps section. The wayfire.init file is already provided by the desktop image. Just fill in the missing sections.

@I7T5
Copy link

I7T5 commented Jun 8, 2024

Hi I'm getting the following errors trying wayfire with my pretty fresh (only docker and portainer, still a noob) RPI Zero 2 W with latest bookworm lite 64bit. Seems like wayland kiosk mode is very unfriendly for Lite OS users...

II 07-06-24 22:11:13.300 - [src/main.cpp:280] Starting wayfire version 0.7.5
II 07-06-24 22:11:13.301 - [libseat] [libseat/libseat.c:73] Seat opened with backend 'seatd'
II 07-06-24 22:11:13.301 - [libseat] [libseat/backend/seatd.c:212] Enabling seat
II 07-06-24 22:11:13.302 - [backend/session/session.c:109] Successfully loaded libseat session
II 07-06-24 22:11:13.310 - [backend/backend.c:220] Found 1 GPUs
II 07-06-24 22:11:13.311 - [backend/drm/backend.c:186] Initializing DRM backend for /dev/dri/card0 (vc4)
II 07-06-24 22:11:13.311 - [backend/drm/drm.c:242] Found 4 DRM CRTCs
II 07-06-24 22:11:13.312 - [backend/drm/drm.c:200] Found 24 DRM planes
II 07-06-24 22:11:13.338 - [render/egl.c:201] Supported EGL client extensions: EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_device EGL_EXT_platform_wayland EGL_KHR_platform_wayland EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_EXT_platform_xcb EGL_MESA_platform_gbm EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless
libEGL warning: MESA-LOADER: failed to open vc4: /usr/lib/dri/vc4_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/aarch64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)

EE 07-06-24 22:11:13.349 - [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to load driver"
libEGL warning: MESA-LOADER: failed to open vc4: /usr/lib/dri/vc4_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/aarch64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)

EE 07-06-24 22:11:13.352 - [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to load driver"
EE 07-06-24 22:11:13.352 - [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "eglInitialize"
EE 07-06-24 22:11:13.352 - [render/egl.c:264] Failed to initialize EGL
EE 07-06-24 22:11:13.353 - [render/egl.c:554] Failed to initialize EGL context
EE 07-06-24 22:11:13.353 - [render/gles2/renderer.c:688] Could not initialize EGL
EE 07-06-24 22:11:13.353 - [src/main.cpp:144] Fatal error: Segmentation fault
EE 07-06-24 22:11:13.397 - #1  wf::print_trace(bool) ??:?
addr2line: '�,��': No such file
addr2line: '�,��': No such file
EE 07-06-24 22:11:13.419 - #2  ho4�� ho4��
EE 07-06-24 22:11:13.450 - #3  wlr_renderer_is_gles2 ??:?
EE 07-06-24 22:11:13.480 - #4  wlr_renderer_is_gles2 ??:?
EE 07-06-24 22:11:13.511 - #5  wlr_gles2_renderer_get_egl ??:?
EE 07-06-24 22:11:13.552 - #6  main ??:?
EE 07-06-24 22:11:13.931 - #7  __libc_start_call_main ../sysdeps/unix/sysv/linux/aarch64/libc-start.c:74
EE 07-06-24 22:11:14.313 - #8  call_init ../csu/libc-start.c:128
EE 07-06-24 22:11:14.354 - #9  _start ??:?

Wayland is forced through raspi-config. seatd is installed and the video driver is KMS.

Also touch ~/.config/wayfire.init just gives No such file or directory...

@seffs
Copy link
Author

seffs commented Jun 9, 2024

@I7T5 Did you install the plug-ins already?

If so, have you tried deleting them first and then starting wayfire that way?

@I7T5
Copy link

I7T5 commented Jun 9, 2024

I did not install the plug-ins. Ended up using DietPi with Chromium which (finally!) worked but the display's not optimal. Guess the Pi Zero's not fit for kiosk mode, at least not with a high refresh rate? Thanks for the gist and the reply though!

@seffs
Copy link
Author

seffs commented Jun 9, 2024

I've been using the kiosk mode on a Pi Zero W, which has the same board as of the Pi 1. No flaws so far.

I think I've found the culprit. I will update the gist accordingly. Thx for the feedback.

@holly-hacker
Copy link

holly-hacker commented Jul 6, 2024

During the "Testing wayfire" step on a raspberry pi 2, I got the following output

pi@pi2dash:~$ wayfire
II 06-07-24 12:59:38.584 - [src/main.cpp:280] Starting wayfire version 0.7.5
II 06-07-24 12:59:38.600 - [libseat] [libseat/libseat.c:73] Seat opened with backend 'seatd'
II 06-07-24 12:59:38.601 - [libseat] [libseat/backend/seatd.c:212] Enabling seat
II 06-07-24 12:59:38.601 - [backend/session/session.c:109] Successfully loaded libseat session
II 06-07-24 12:59:38.615 - [backend/backend.c:220] Found 1 GPUs
II 06-07-24 12:59:38.616 - [backend/drm/backend.c:186] Initializing DRM backend for /dev/dri/card0 (vc4)
II 06-07-24 12:59:38.616 - [backend/drm/drm.c:242] Found 4 DRM CRTCs
II 06-07-24 12:59:38.617 - [backend/drm/drm.c:200] Found 24 DRM planes
II 06-07-24 12:59:38.674 - [render/egl.c:201] Supported EGL client extensions: EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_device EGL_EXT_platform_wayland EGL_KHR_platform_wayland EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_EXT_platform_xcb EGL_MESA_platform_gbm EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless
libEGL warning: MESA-LOADER: failed to open vc4: /usr/lib/dri/vc4_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)

EE 06-07-24 12:59:38.685 - [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to load driver"
libEGL warning: MESA-LOADER: failed to open vc4: /usr/lib/dri/vc4_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)

EE 06-07-24 12:59:38.688 - [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to load driver"
EE 06-07-24 12:59:38.689 - [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "eglInitialize"
EE 06-07-24 12:59:38.689 - [render/egl.c:264] Failed to initialize EGL
EE 06-07-24 12:59:38.689 - [render/egl.c:554] Failed to initialize EGL context
EE 06-07-24 12:59:38.689 - [render/gles2/renderer.c:688] Could not initialize EGL
EE 06-07-24 12:59:38.689 - [src/main.cpp:144] Fatal error: Segmentation fault
EE 06-07-24 12:59:38.790 - #1  ?? ??:0
EE 06-07-24 12:59:39.571 - #2  __default_sa_restorer ../sysdeps/unix/sysv/linux/arm/sigrestorer.S:67

The error itself seems to be failed to open vc4: /usr/lib/dri/vc4_dri.so. The /usr/lib/dri folder does not seem to exist.

I fixed this by installing the mesa drivers:

sudo apt install mesa-vulkan-drivers mesa-utils libgl1-mesa-dri -y

I don't know if all of these packages are needed, I just installed all of them and that fixed it.


To fix further errors, I:

  • removed the comment from the wayfire.init file as it didn't escape the newline at the end
  • installed xwayland with sudo apt install xwayland -y
  • modified .bashrc to start wayfire if the tty is not /dev/tty1

@seffs
Copy link
Author

seffs commented Jul 6, 2024

Excellent work @holly-hacker. Adding your fixes to the guide. Thank you! Pinging @Torsten85 @swvalenti194 @I7T5 in case they want to give it another try.

modified .bashrc to start wayfire if the tty is not /dev/tty1

What exactly are you fixing with this?

@holly-hacker
Copy link

holly-hacker commented Jul 6, 2024

modified .bashrc to start wayfire if the tty is not /dev/tty1

What exactly are you fixing with this?

I'm using it to start wayfire on boot, since the guide does not mention how to do it.

if [ "$(tty)" = "/dev/tty1" ]; then
    wayfire -c ~/.config/wayfire.init
fi

It's worth noting that I also haven't yet gotten the cursor hiding to work, but it's not a priority for me yet. I will post a fix for that if the solution is non-obvious.

@ea7kir
Copy link

ea7kir commented Aug 5, 2024

Seffs, I appreciate your effort, but it's not working for me. Apart from the obvious (touch not creating .config) and other suggestions, I suspect Bookworm Lite today (5th August 2024) is a later version than the version you were using.

@matzrm
Copy link

matzrm commented Sep 6, 2024

Same here on Raspbian Lite 04/07/2024.
I fixed wayfire error message installing:

sudo apt install mesa-utils libgl1-mesa-dri -y

@ea7kir
Copy link

ea7kir commented Sep 6, 2024

Seffs is just another time waster who publishes and forgets.

@matzrm
Copy link

matzrm commented Sep 6, 2024

Anyone knows how to autostart at boot wayfire in Raspbian Lite without login?

@ea7kir
Copy link

ea7kir commented Sep 6, 2024

Anyone knows how to autostart at boot wayfire in Raspbian Lite without login?

The Raspberry Pi Foundation knows, but they won't tell you. They're only interested in competing with Microsoft.

@matzrm
Copy link

matzrm commented Sep 9, 2024

Hi @ea7kir u can find here the solution I found to start wayland without login

@seffs
Copy link
Author

seffs commented Sep 10, 2024

@ea7kir I've added a "Troubleshooting" section based on the fixes ppl have been posting during the last weeks. It's been slowly evolving from the notes I took for a very specific project to a more structured guide. Unfortunately, I'm not dealing with RPis at this point in time. I try to update this guide as soon as I allow myself to do so.

Did you find any other error? Let me know

@ruperthair
Copy link

For anyone on a Pi 3, the kernel command line parameter is wayland=on and not wayland=enabled as above. Thanks for the guide, and it would be great if you could update it.

@seffs
Copy link
Author

seffs commented Oct 29, 2024

Updated the cmdline. Thanks @ruperthair

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