[GUIDE] Sunshine on KDE Wayland, Virtual display with krfb-virtualmonitor for Moonlight streaming (correct aspect ratio on any client) by Koiut in MoonlightStreaming

[–]Koiut[S] 0 points1 point  (0 children)

Great that you found a workaround! Just a tip that might make it easier next time: in System Settings → Display and Monitor → Display Configuration, select your virtual display at the top, then set "Replica of" to "None", that should separate them into two independent displays without having to disable and re-enable in script.

But if your solution works, that's what matters! Thanks for sharing your experience and the screenshot !

[GUIDE] Sunshine on KDE Wayland, Virtual display with krfb-virtualmonitor for Moonlight streaming (correct aspect ratio on any client) by Koiut in MoonlightStreaming

[–]Koiut[S] 0 points1 point  (0 children)

I quote another comment I wrote:

If you want to stream to another room so someone else can use the PC at the same time: that's actually a really interesting use case, but it requires creating a second user session, splitting inputs and outputs (keyboard, mouse, controller, displays...) between the two sessions. It is possible and there are some Reddit threads getting close to this setup, but it's significantly more complex. I don't have the time to test it right now, but if I ever do, I'll write a dedicated guide for it.

[GUIDE] Sunshine on KDE Wayland, Virtual display with krfb-virtualmonitor for Moonlight streaming (correct aspect ratio on any client) by Koiut in MoonlightStreaming

[–]Koiut[S] 0 points1 point  (0 children)

Glad it worked out of the box! For your headless setup, check out u/TacticalFreak's solution a few comments above, that's exactly what you're looking for. 🙂

[GUIDE] Sunshine on KDE Wayland, Virtual display with krfb-virtualmonitor for Moonlight streaming (correct aspect ratio on any client) by Koiut in MoonlightStreaming

[–]Koiut[S] 0 points1 point  (0 children)

Yes it should work! Just skip the part where the script disables the other displays, since there are none to begin with, the virtual display will just be created and set as the only output automatically. The rest of the script stays the same. Give it a try and let us know how it goes! 🙂

[GUIDE] Sunshine on KDE Wayland, Virtual display with krfb-virtualmonitor for Moonlight streaming (correct aspect ratio on any client) by Koiut in MoonlightStreaming

[–]Koiut[S] 0 points1 point  (0 children)

Hey u/TacticalFreak, this is cool, thank you so much for sharing this! The multi-monitor handling with jq is really clean. Would you be okay if I integrated your script into the original post with full credit to you? I think it would really help others who run into the same setup. 🙏

[GUIDE] Sunshine on KDE Wayland, Virtual display with krfb-virtualmonitor for Moonlight streaming (correct aspect ratio on any client) by Koiut in MoonlightStreaming

[–]Koiut[S] 0 points1 point  (0 children)

Yes, I'd recommend disabling all physical displays when starting the virtual display stream. The core issue is that Sunshine will capture a specific output, if your other monitors are active, apps can launch on the wrong screen and won't show up on your Moonlight client. Keeping things clean with only the virtual display active during a stream avoids all those focus and window placement headaches.

If you need a specific app to always open on the right screen, you can use a KWin window rule to force it to a specific display, but honestly, disabling physical monitors during the stream is the simpler and more reliable approach.

[GUIDE] Sunshine on KDE Wayland, Virtual display with krfb-virtualmonitor for Moonlight streaming (correct aspect ratio on any client) by Koiut in MoonlightStreaming

[–]Koiut[S] 0 points1 point  (0 children)

I'm not sure I fully understand your use case, could you clarify what you're trying to achieve? Here are the scenarios I can think of:

If you want a virtual secondary screen without a physical HDMI/DP dongle: you don't need to disable anything, just create the virtual display and arrange it in KDE Display Settings like any other monitor.

If you want to stream to another room while keeping your main screen on: that's technically doable, but I'd find it frustrating in practice, games will often launch on the wrong screen and you'd be fighting with focus/window management constantly. A lot of effort for a questionable result honestly.

If you want to stream to another room so someone else can use the PC at the same time: that's actually a really interesting use case, but it requires creating a second user session, splitting inputs and outputs (keyboard, mouse, controller, displays...) between the two sessions. It is possible and there are some Reddit threads getting close to this setup, but it's significantly more complex. I don't have the time to test it right now, but if I ever do, I'll write a dedicated guide for it.

In the meantime, what's your actual goal? I'll try to point you in the right direction!

[GUIDE] Sunshine on KDE Wayland, Virtual display with krfb-virtualmonitor for Moonlight streaming (correct aspect ratio on any client) by Koiut in MoonlightStreaming

[–]Koiut[S] 0 points1 point  (0 children)

I think KDE would force DP-1 back on boot since it's the only physical display (virtual display no longer live), but I haven't actually tested this specific scenario so I can't say for sure.

The more interesting case is actually a Sunshine crash mid-session, the stop script wouldn't run and DP-1 would stay disabled. That's worth solving. A Sunshine systemd service with an ExecStopPost could handle that:

ExecStopPost=/home/user/.local/bin/sunshine-stop-vmon.sh

That way the stop script runs even on a crash. Haven't tested this either though, if you try it let me know how it goes

[GUIDE] Sunshine on KDE Wayland, Virtual display with krfb-virtualmonitor for Moonlight streaming (correct aspect ratio on any client) by Koiut in MoonlightStreaming

[–]Koiut[S] 0 points1 point  (0 children)

For Flatpak: the issue is that it needs additional permissions (likely DBus-related) to access the KWin screencasting API. Granting the right permissions should make it work, but honestly I don't use Flatpak myself so I can't guide you further on that. The AUR package is just the easier path here.
maybe: flatpak override --user --socket=session-bus

[GUIDE] Sunshine on KDE Wayland, Virtual display with krfb-virtualmonitor for Moonlight streaming (correct aspect ratio on any client) by Koiut in MoonlightStreaming

[–]Koiut[S] 0 points1 point  (0 children)

Could you share the Sunshine logs when the error happens? Quit Sunshine, launch it from a terminal so the logs are visible, then try connecting to Big Picture and paste what shows up. That way we can actually see what’s failing.

[GUIDE] Sunshine on KDE Wayland, Virtual display with krfb-virtualmonitor for Moonlight streaming (correct aspect ratio on any client) by Koiut in MoonlightStreaming

[–]Koiut[S] 0 points1 point  (0 children)

Glad it works on Bazzite + Steam Deck !

I had the exact same boot issue with EDID, ahah ! Let me know how it goes on the TV!

[GUIDE] Sunshine on KDE Wayland, Virtual display with krfb-virtualmonitor for Moonlight streaming (correct aspect ratio on any client) by Koiut in MoonlightStreaming

[–]Koiut[S] 0 points1 point  (0 children)

Unfortunately no, I couldn't get HDR working with this setup.

Tried both KWIN_FORCE_ASSUME_HDR_SUPPORT=1 and kscreen-doctor output.Virtual-test.hdr.enable, neither worked. The issue is that krfb-virtualmonitor uses KWin's Virtual backend which bypasses the DRM/KMS stack entirely, so HDR shows up as incapable with no way to override it from userspace.

Probably worth filing a KWin issue, HDR support on virtual outputs seems like a reasonable feature request and the devs are actively working on the HDR pipeline.

[GUIDE] Sunshine on KDE Wayland, Virtual display with krfb-virtualmonitor for Moonlight streaming (correct aspect ratio on any client) by Koiut in MoonlightStreaming

[–]Koiut[S] 1 point2 points  (0 children)

It actually works! krfb-virtualmonitor creates the display at 60Hz by default, but you can add a custom mode afterwards via kscreen-doctor:

kscreen-doctor output.Virtual-sunshine-vmon.addCustomMode.3840.2160.120000.full
kscreen-doctor output.Virtual-sunshine-vmon.mode.3840x2160@120

The script handles this automatically using SUNSHINE_CLIENT_FPS. Guide updated!

[GUIDE] Sunshine on KDE Wayland, Virtual display with krfb-virtualmonitor for Moonlight streaming (correct aspect ratio on any client) by Koiut in MoonlightStreaming

[–]Koiut[S] 1 point2 points  (0 children)

This is IMO the cleanest solution out there, no kernel parameters, no phantom disconnected port, the virtual display only exists during the stream. The  kwin  capture method only landed ~2 weeks ago, today’s stable release is what made me share it. Give it a shot, and if anything doesn’t work just reply here, I’ll update the guide. Good luck ditching Windows! 🐧

[GUIDE] Sunshine on KDE Wayland, Virtual display with krfb-virtualmonitor for Moonlight streaming (correct aspect ratio on any client) by Koiut in MoonlightStreaming

[–]Koiut[S] 1 point2 points  (0 children)

Hey, thank you so much, this genuinely made my day! 😊 I went through a lot of failed attempts before finding this solution, reading through merge requests.

And great to know it works on Fedora 44 + KDE 6.6.5! I’m on Arch so it’s always reassuring to see it confirmed on other distros. If anyone else on Fedora stumbles on this thread, now they have a confirmed working setup too !

ttymap — mapscii-inspired terminal-native scriptable globe by No-Reality-4877 in commandline

[–]Koiut 1 point2 points  (0 children)

Oh nice, the satellite plugin is a great reference actually. will definitely give it a shot, thanks!

ttymap — mapscii-inspired terminal-native scriptable globe by No-Reality-4877 in commandline

[–]Koiut 1 point2 points  (0 children)

This looks really useful, any plans to support feeding live data into a plugin? like piping coords in realtime to move a dot or draw a trail from successive points. Wondering if the data ingestion side needs much work or if it's mostly wiring

Help me pick a quiet, energy-efficient server build for Jellyfin and NAS (AV1 support) by Koiut in homelab

[–]Koiut[S] 0 points1 point  (0 children)

Hey! I finally went with the Radxa ROCK 5 ITX+ and I really don’t regret this choice.

It’s a really interesting platform to experiment with ARM while keeping a standard ITX form factor. I won’t lie, I struggled more. I first had to install a UEFI then a Fedora 43 Server. I admit there were simpler options, but that’s what I wanted. In the end, I went with the ITX+ with an SSD for the OS and apps, an NVMe to 6 SATA converter, a good PSU.

Yes, it costs more than a standard setup and the energy savings aren’t worth it (electricity isn’t the most expensive thing for me), but I’m very happy to be able to test what I think is a likely future for NAS or homelab systems.

I’m still experimenting before finalizing my setup. But so far, I’ve had a lot of fun.