Skip to content

System tray failure causes 'Main loop has exited', preventing headless/server operation on Linux #5170

@wintrover

Description

@wintrover

Environment

  • Sunshine version: 2026.516.143833
  • OS: Linux Mint 22.3 (Cinnamon X11)
  • GPU: AMD Radeon iGPU (display) + NVIDIA RTX 3060 (PRIME offload)
  • Kernel: 6.17.0-29-generic

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

  1. Document that system_tray = disabled is required for headless/server setups
  2. Document that the user must be in the video group for KMS capture
  3. Consider adding a startup diagnostic that checks these prerequisites
  4. Improve error messages to point the user toward the fix ("Missing video group membership? Missing capabilities?")

Metadata

Metadata

Assignees

No one assigned

    Labels

    aiPR has signs of heavy ai usage (either indicated by user or assumed)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions