Skip to content

Instantly share code, notes, and snippets.

@iamthenuggetman
Last active January 8, 2026 14:02
Show Gist options
  • Select an option

  • Save iamthenuggetman/6d0884954653940596d463a48b2f459c to your computer and use it in GitHub Desktop.

Select an option

Save iamthenuggetman/6d0884954653940596d463a48b2f459c to your computer and use it in GitHub Desktop.
Sunshine on Bazzite with virtual display
  1. First connect whatever display you want to use Moonlight on. I'll be using a 65" Roku TV. I connected it to my laptop running Fedora and after my system detected it I use for p in /sys/class/drm/*/status; do con=${p%/status}; echo -n "${con#*/card?-}: "; cat $p; done to find which directory has the EDID file for me it's HDMI-A-1

  2. Copy that edid file to your home directory cp /sys/class/drm/card0-HDMI-A-1/edid ~/. Now get that edid file over to your Bazzite (streaming machine). I used LocalSend to transfer it.

  3. Create a directory to store this new edid file sudo mkdir -p /usr/local/lib/firmware then place the file in there sudo mv ./edid.bin /usr/local/lib/firmware/

  4. Add this new edid to your kernel args sudo rpm-ostree kargs --append-if-missing="firmware_class.path=/usr/local/lib/firmware drm.edid_firmware=HDMI-A-1:edid.bin video=HDMI-A-1:e"

  5. Reboot systemctl reboot. After you log back into Bazzite open up your Display Configuration window (right-click on desktop) and notice you have an additional display set your virtual display to Mirror/Replica your primary.

  6. Configure Sunshine so we force all our games to use the virtual display instead of our primary when using Moonlight. Open a terminal and run kscreen-doctor -o | grep Output: look for your virtual screen id. In my case it's HDMI-A-1.

  7. Right-click Sunshine icon in your tray and select "Open Sunshine" go to Configuration page. Once there click on the General tab and click + Add to put a "Do" and a "Undo Command".

  8. For your "Do" command you want to disable your primary display(s) and only enable your virtual display (this will force games to launch on the correct screen with correct resolution). In your "Undo" command you want to do the opposite (i.e. disable your Virtual Display and enable your primary display(s)). Below are my Do and Undo commands:

Do:

/usr/bin/kscreen-doctor output.DP-2.disable && /usr/bin/kscreen-doctor output.HDMI-A-1.enable

Undo (make sure you re-enable your Virtual Display as well):

/usr/bin/kscreen-doctor output.DP-2.enable
  1. Test on Moonlight to verify everything works as expected.

(citation: https://www.reddit.com/r/linux_gaming/comments/199ylqz/streaming_with_sunshine_from_virtual_screens/)

@deisi
Copy link

deisi commented Dec 17, 2025

Hey guys, I had some issues with this under bazzite gnome. Mostly the fact that kscreen-doctor is a kde application and not available. However instead one can use gdctl. As there is very little reference on how to use gdctl I thought I drop some of the config lines I started to use.

e.g. I use:
gdctl set --logical-monitor --primary --monitor DP-3 --mode 2560x1440@119.953
and
gdctl set --logical-monitor --primary --monitor DP-3 --mode 3440x1440@144.000

To change the resolution of my real monitor. To switch to the virtual monitor I use:
gdctl set --logical-monitor --primary --monitor HDMI-1 --mode 4096x2160@60.000 --scale 2.0

With gdctl show -v one gets an overview about the available monitors and the corresponding modes.

@Silvenga
Copy link

Silvenga commented Dec 20, 2025

So this is kind of fun for users of Bazzite in steam deck mode (so just gamescope acting as wayland). You can force gamescope over to the virtual display doing something like (as root):

find /sys/kernel/debug/dri -name "force" | grep "HDMI-A-1"
echo off > /sys/kernel/debug/dri/0000:03:00.0/HDMI-A-1/force
udevadm trigger --subsystem-match=drm

# And to enable again
echo on > /sys/kernel/debug/dri/0000:03:00.0/HDMI-A-1/force
udevadm trigger --subsystem-match=drm

This assumes the virtual display is active. You should see steam re-scale and your TV go disconnected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment