I want to stream at 1080p and 120 Hz without keeping a physical display active. Is there a KDE virtual monitor setup that works without a dummy plug?
How can I set up a virtual monitor for Sunshine and Moonlight on KDE?
Answers
On KDE Wayland, KRFB's virtual monitor is one option. Install KRFB and check that krfb-virtualmonitor --help works. On Arch-based systems, the package is called krfb.
Start it with a resolution of 1920x1080, a name such as sunshine-vm, a password, the desktop file org.kde.krfb.virtualmonitor, scale 1 and a port such as 5905. Leave the process running because it keeps the virtual monitor alive. Then use kscreen-doctor -o to find the new output, which should appear as Virtual-sunshine-vm.
You can add a 120 Hz mode with kscreen-doctor output.Virtual-sunshine-vm.addCustomMode.1920.1080.120000. Check the output again and make sure the new mode is actually selected. The physical HDMI monitor can remain enabled, and this approach does not require a dummy plug.
Reply to this answer
Watch the session environment if kscreen-doctor cannot see the display. It needs to talk to the KDE Wayland session. XDG_RUNTIME_DIR is normally /run/user/ followed by your numeric user ID, and WAYLAND_DISPLAY needs to match the session's Wayland socket rather than blindly assuming wayland-0.
Also, adding a mode and using it are separate things to verify. Check the reported output after configuring it, then select the virtual display in your streaming setup.
Reply to this answer
For automatic startup, the KRFB process needs to start after login and stay running. Keep its password private. If you put it in a configuration file, restrict that file to your user, for example with chmod 600. Avoid sharing commands or logs that contain the actual password.
Reply to this answer
Add your answer
Answers are reviewed before publication.
P2meatyRoute_3V:
The example output name depends on the name given to KRFB, so check kscreen-doctor -o rather than assuming it matches.