You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
System tray failure causes 'Main loop has exited', preventing headless/server operation on Linux #5170
Issue 1: System tray crash causes streaming to be unavailable
When running Sunshine without a system tray (headless/server context, or from a systemd user service), the "System tray is not initialized" error causes "Main loop has exited", which prevents the streaming server from fully starting. The web UI becomes partially functional but streaming never works.
Workaround found
Adding system_tray = disabled to ~/.config/sunshine/sunshine.conf fixes this ("No main thread features enabled, skipping event loop"), and streaming then works correctly. However, this option is not well-documented for headless/server setups.
Issue 2: KMS capture requires cap_sys_admin but systemd user services cannot apply ambient capabilities
The Sunshine binary has cap_sys_admin,cap_sys_nice=p set via setcap
However, when launched via a systemd user service, these capabilities are not carried through to the running process (CapEff=0000000000000000)
Setting AmbientCapabilities=CAP_SYS_ADMIN CAP_SYS_NICE in a systemd user service override fails with "Operation not permitted"
Workaround: Use capture = x11 instead of KMS (KMS capture not needed)
Issue 3: User needs video group for DRM access
The user must be in the video group to access /dev/dri/card*. Sunshine documentation does not mention this prerequisite.
Suggestions
Document that system_tray = disabled is required for headless/server setups
Document that the user must be in the video group for KMS capture
Consider adding a startup diagnostic that checks these prerequisites
Improve error messages to point the user toward the fix ("Missing video group membership? Missing capabilities?")
Issue 2 definitely needs to be documented somewhere. I have significantly higher host processing latency when using X11 instead of KMS on a system running Linux mint 22.3 with intel uhd graphics 630. I was able to find this workaround that solved the issue for me:
To fix Issue 2 and keep KMS capture, you need to run Sunshine as a system service. systemd user services cannot grant the required ambient capabilities.
Create /etc/systemd/system/sunshine.service and include this under [Service]:
Hi, this issue is closed, but for what it's worth, on Fedora 44 after update to Version 2026.525.22124 (now there is already a newer pre-release as i'm writing this) from an old version 2026.215.224211, everything works now, here's what i had to do:
After update as USER (not root): systemctl --user enable app-dev.lizardbyte.app.Sunshine systemctl --user start app-dev.lizardbyte.app.Sunshine
and then for the CSRF issue, if i connect from a client from ip 10.0.0.10 to Web UI at https://10.0.0.20:47990, i need to add
Although it might not have been a proper submission via AI summary, I have to add that I currently have exactly the same issues 1 and 2 with the current beta version(s). (Tested today on both v2026.525.145348 and v2026.525.22124)
I'm coming from bazzite-nvidia 44.20260515 using the homebrew package of sunshine-beta. I updated primarily because of the missing systray icon, but at the moment sunshine-beta is not working anymore for me. I'll paste some logs and a stacktrace (when the systray is enabled; different pid, as the service retries to launch).
From what I can see the most interesting section are these:
with new systray enabled (where the stacktrace follows):
May 25 22:56:38 bazzite.fritz.box sunshine[11943]: [2026-05-25 22:56:38.830]: Info: Starting system tray
May 25 22:56:38 bazzite.fritz.box sunshine[11943]: [2026-05-25 22:56:38.830]: Warning: Qt: Could not find the Qt platform plugin "wayland" in ""
May 25 22:56:38 bazzite.fritz.box sunshine[11943]: [2026-05-25 22:56:38.830]: Warning: Qt: Could not find the Qt platform plugin "xcb" in ""
May 25 22:56:38 bazzite.fritz.box sunshine[11943]: [2026-05-25 22:56:38.830]: Error: Qt: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
... which will lead to a black screen with error code 1 on moonlight.
I'm not sure, if my setup is somehow unusual, but I can at least confirm the two issues mentioned above for the latest beta releases. @ReenigneArcher Please reconsider the issue. If you need more info, I'm happy to help.
EDIT:
I don't know why that worked, but removing the setcap capabilities via sudo setcap -r $(readlink -f $(which sunshine)) and restarting made my stream work again. (still with disabled systray though) I checked my history from last sunshine update and found this command. For reference, I'll attach another log for the working variant:
Activity
ReenigneArcher commentedon May 22, 2026
Thanks AI
darman84 commentedon May 22, 2026
Issue 2 definitely needs to be documented somewhere. I have significantly higher host processing latency when using X11 instead of KMS on a system running Linux mint 22.3 with intel uhd graphics 630. I was able to find this workaround that solved the issue for me:
To fix Issue 2 and keep KMS capture, you need to run Sunshine as a system service. systemd user services cannot grant the required ambient capabilities.
Create
/etc/systemd/system/sunshine.serviceand include this under[Service]:Then swap the services:
systemctl --user disable --now sunshine.service sudo systemctl daemon-reload sudo systemctl enable --now sunshine.serviceReenigneArcher commentedon May 25, 2026
This is the only bug here, and probably is no longer required after merging #4907 ... please test beta/pre-release.
Never heard of this requirement before. I don't think this is true. Feel free to prove me wrong though.
Sunshine output/logs already tells you if it doesn't have the right capabilities and what to do in that case.
PRs accepted for docs or service file improvements.
Edit: Also, for future reference. Please don't open AI generated issues, and use our issue template.
nomisma-qt commentedon May 25, 2026
Hi, this issue is closed, but for what it's worth, on Fedora 44 after update to Version 2026.525.22124 (now there is already a newer pre-release as i'm writing this) from an old version 2026.215.224211, everything works now, here's what i had to do:
After update as USER (not root):
systemctl --user enable app-dev.lizardbyte.app.Sunshinesystemctl --user start app-dev.lizardbyte.app.Sunshineand then for the CSRF issue, if i connect from a client from ip 10.0.0.10 to Web UI at https://10.0.0.20:47990, i need to add
csrf_allowed_origins = https://10.0.0.20:47990to /home/user/.config/sunshine/sunshine.conf
and restart service:
systemctl --user restart app-dev.lizardbyte.app.Sunshinenow it all works, tray icon works, and no errors in systemd service log:
agonio commentedon May 25, 2026
Although it might not have been a proper submission via AI summary, I have to add that I currently have exactly the same issues 1 and 2 with the current beta version(s). (Tested today on both v2026.525.145348 and v2026.525.22124)
I'm coming from bazzite-nvidia 44.20260515 using the homebrew package of sunshine-beta. I updated primarily because of the missing systray icon, but at the moment sunshine-beta is not working anymore for me. I'll paste some logs and a stacktrace (when the systray is enabled; different pid, as the service retries to launch).
sunshine_systray_disabled.log
sunshine_systray_enabled.log
sunshine_systray_enabled_stacktrace.log
From what I can see the most interesting section are these:
... which will lead to a black screen with error code 1 on moonlight.
I'm not sure, if my setup is somehow unusual, but I can at least confirm the two issues mentioned above for the latest beta releases. @ReenigneArcher Please reconsider the issue. If you need more info, I'm happy to help.
EDIT:
I don't know why that worked, but removing the setcap capabilities via
sudo setcap -r $(readlink -f $(which sunshine))and restarting made my stream work again. (still with disabled systray though) I checked my history from last sunshine update and found this command. For reference, I'll attach another log for the working variant:sunshine_setcap-r.log
ReenigneArcher commentedon May 25, 2026
I'd suggest opening a proper issue with reproduction steps.