Couch Lag

Sunshine on Linux: get Wayland, KMS and portal capture working

Updated · By Couch Lag

Short answer: Most Linux capture failures come from a capture method that can’t work with how Sunshine was installed or with your desktop. Flatpak and AppImage builds can’t use KMS capture, NvFBC doesn’t work on Wayland, and portal capture needs you to approve a Remote Desktop prompt on the host. Check the log for which method failed, then use portal or KWin capture on Wayland, or a native package if you need KMS.

Checked October 31, 2026 against Moonlight PC v6.2.0 and Sunshine v2026.914.233613 (latest stable releases) and their documentation. Sources are listed at the end of the page.

1. Find out which capture method failed

Open Sunshine’s web UI on the host and go to the Troubleshooting tab to read the log. Sunshine picks the first capture method that works unless you force one with the capture setting. The Linux options in Sunshine’s configuration docs are:

SettingWhat it isWatch out for
nvfbcNVIDIA Frame Buffer Capture, usually the fastest on NVIDIA cardsNo native Wayland support and doesn’t work with XWayland
wlrwlroots compositors (for example Hyprland) via wlr-screencopyOnly for wlroots-based compositors
kmsDRM/KMS capture from the kernelNeeds the cap_sys_admin capability, so not Flatpak or AppImage
kwinKDE Plasma (KWin) screencasting on WaylandKDE only
x11XCB captureSlowest and most CPU-heavy, so avoid it if you can

Sunshine’s troubleshooting page also recommends XDG Portal capture (“portal”) for most desktops, and says KMS capture will be phased out in favour of it because portal works with every package type.

2. KMS fails on Flatpak or AppImage

KMS capture needs elevated privileges that Flatpak and AppImage packages aren’t allowed to have. Sunshine’s install docs say to use your distribution’s native package (DEB, RPM or the Arch package) instead of Flatpak or AppImage when one is available. If you want to stay on Flatpak, use portal capture.

3. Portal capture: approve the prompt, reset the token

  • The first time, the host shows a Remote Desktop permission prompt. Approve it and pick the display to capture.
  • Sunshine saves a restore token so it doesn’t ask every time. The token can go bad after a crash, a desktop or portal change, or plugging and unplugging monitors.
  • If portal capture used to work but the prompt no longer appears, or the log shows a token being loaded followed by “no streams in response”, reset it: web UI → Troubleshooting → Reset XDG Portal Capture. Sunshine deletes the token and restarts.
  • If the web UI won’t open, stop Sunshine and delete the token file yourself:
    rm "${XDG_CONFIG_HOME:-$HOME/.config}/sunshine/portal_token"
    For the Flatpak, the file is $HOME/.var/app/dev.lizardbyte.app.Sunshine/config/sunshine/portal_token.
  • On KDE Plasma you can switch to kwin capture, or grant permanent portal permission:
    flatpak permission-set kde-authorized remote-desktop dev.lizardbyte.app.Sunshine yes
    Sunshine notes this works for any install type, not only the Flatpak.

Sunshine says not to use the token reset for a general encoder error unless the log also shows portal capture failing.

4. NVIDIA: black screen with KMS

If KMS capture streams a black picture on an NVIDIA GPU, Sunshine’s docs say you may need to add nvidia_drm.modeset=1 to the kernel command line. How you do that depends on your distribution and boot loader (often GRUB), so follow your distro’s instructions.

5. Frame rate drops when the GPU is busy

Flatpak and AppImage installs lack the CAP_SYS_NICE permission needed for high-priority GPU contexts, which can drop frames under heavy GPU load. Look for this log line:

Warning: EGL: context priority set to HIGH but CAP_SYS_NICE capability is missing

Sunshine says switching to Vulkan encoding fixes it for most setups. Its recommendations:

DesktopVulkan supportedInstall typeCapture and encoder
KDE PlasmaYesAnyportal or kwin, Vulkan encoding
KDE PlasmaNoNot sandboxedportal or kwin, VA-API or NVENC
GNOME and othersYesAnyportal, Vulkan encoding
GNOME and othersNoNot sandboxedportal, VA-API or NVENC

6. The picture works but input doesn’t

After installing, the udev rules need to be reloaded. Sunshine’s post-install script tries this, and a reboot also works. Sunshine recreates its virtual gamepads for each session, so manual chmod fixes don’t last. The documented commands are:

sudo udevadm control --reload-rules
sudo udevadm trigger --subsystem-match=hidraw
sudo udevadm trigger --subsystem-match=input

If input still doesn’t work, add your user to the input group with sudo usermod -aG input $USER, then log out and back in. Flatpak users also need to run flatpak run --command=additional-install.sh dev.lizardbyte.app.Sunshine after installing or updating.

7. HDR on a Linux host

Sunshine calls Linux HDR experimental. It needs an Intel or AMD GPU that can encode HEVC Main 10 or AV1 10-bit through VA-API, the KMS capture backend (NvFBC and X11 don’t support HDR), and a compositor that renders HDR, such as Gamescope or KDE Plasma 6.

Start Sunshine as a user service so it runs inside your desktop session: systemctl --user --now enable app-dev.lizardbyte.app.Sunshine (also available as sunshine.service).

FAQ

Which capture method should I use on Wayland?

Sunshine’s troubleshooting page recommends portal capture for most desktops, or kwin capture on KDE Plasma, with Vulkan encoding where your GPU supports it. NvFBC doesn’t work on Wayland or XWayland.

Why does KMS capture not work in the Flatpak?

KMS capture needs elevated privileges that Flatpak and AppImage packages can’t have. Use your distribution’s native Sunshine package for KMS, or switch to portal capture.

Sunshine stopped asking for screen permission and now shows nothing. What do I do?

The saved portal restore token is probably stale. In the web UI, open Troubleshooting and choose Reset XDG Portal Capture, then approve the Remote Desktop prompt on the host again.

Sources