It works almost like that. libegl1
is needed on the host system. And it can only be started from within an X session, either from desktop, or:
xinit ./Moonlight*.AppImage
or as non-root:
startx ./Moonlight*.AppImage
This is inconsistent with the ARM builds, which should be explicitly executed from console to run via DRM/KMS. The information is somehow missing, the output gives an indicator that the embedded Qt build has X11 support enabled only. Found it in the AppImage build script: moonlight-qt/scripts/build-appimage.sh at 1dbdcb5279b3c2bce756e6eff3b97d3f12a38092 · moonlight-stream/moonlight-qt · GitHub
There are two branches from 3 and 2 years ago, with an approach to change it, but obviously it was never finished:
I mean not such a big issue, it is degrading performance, but for x86_64 systems with a somewhat proper GPU, not a big issue. And I guess that systems where you run a game streaming client will have a desktop anyway, making it also more comfortable to just execute Moonlight within.
This means however some more work to implement:
- Download AppImage
- Create desktop icon
- Create launcher for console, which detects whether it is started within an X session, else wraps it into one, like our Chromium kiosk mode script does.
Fun facts: AppImages are compressed archives with a common Linux root filesystem structure/overlay inside with the needed data and libraries etc. Instead of being extracted to the host OS (which would be perfectly possible), or executed in an insolated/sandboxed environment via container engine, the contained filesystem is mounted to /tmp
, and then just executed pretty normally with a fixed AppRun
executable, which is a symlink to the actual moonlight
executable within the directory tree:
root@VM-Bookworm:~# ls -Al /tmp/.mount_Moonli0feN0l/
total 1.0K
-rw-r--r-- 1 root root 820 Sep 17 2024 .DirIcon
lrwxrwxrwx 1 root root 17 Sep 17 2024 AppRun -> usr/bin/moonlight
-rw-r--r-- 1 root root 293 Sep 17 2024 com.moonlight_stream.Moonlight.desktop
-rw-r--r-- 1 root root 820 Sep 17 2024 moonlight.svg
drwxr-xr-x 7 root root 0 Sep 17 2024 usr
There is a regular Linux desktop launcher (.desktop
entry) included, not sure whether/how it is used, or whether it is even part of the AppImage specification, since it does define a non-standard attribute:
X-AppImage-Version=6.1.0
I have to say, I do like the simplicity of this, at least the way it appears. It fills a gap between native executable and container: