sunshine-vdd-mode.ps1 is a Windows prep-command hook for upstream Sunshine and VirtualDrivers/Virtual-Display-Driver.
It reads Sunshine's SUNSHINE_CLIENT_WIDTH, SUNSHINE_CLIENT_HEIGHT, and SUNSHINE_CLIENT_FPS environment variables, validates the requested mode, and checks C:\VirtualDisplayDriver\vdd_settings.xml.
- Known modes continue without reloading VDD.
- Missing resolutions or refresh rates are added atomically.
- Fractional refresh rates are preserved to millihertz.
- VDD is refreshed with the supported UTF-16LE
SETDISPLAYCOUNT 1named-pipe command. - Errors produce a nonzero exit code and a concise log at
C:\VirtualDisplayDriver\sunshine-vdd-mode.log.
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\VirtualDisplayDriver\sunshine-vdd-mode.ps1"
Run the command without Sunshine's Elevated option so it executes in the active interactive user session.
This hook is intended to complement Sunshine's native display-device configuration:
dd_configuration_option = ensure_only_display
dd_resolution_option = auto
dd_refresh_rate_option = auto
dd_hdr_option = autoSet output_name separately to the stable Sunshine device ID for your VDD monitor. Do not copy a host-specific device ID from another machine.
-
Make sure VDD is enabled and restart Sunshine.
-
Open Sunshine's log. For a default installation it is usually:
C:\Program Files\Sunshine\config\sunshine.log -
Find the startup block beginning with
Currently available display devices:. -
Locate the entry whose
friendly_nameisVDD by MTTand copy itsdevice_idvalue, including the braces. -
Put that value in Sunshine's configuration, for example:
output_name = {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
Use device_id, not display_name. A name such as \\.\DISPLAY13 can change whenever Windows re-enumerates displays.
The device_id is designed to be the persistent selector and has been observed to survive ordinary VDD SETDISPLAYCOUNT 1 reloads. It is not an eternal identifier: re-check it after reinstalling or upgrading VDD, changing its EDID/monitor identity or monitor count, removing/recreating the Windows display device, or when Sunshine reports that the configured device cannot be found. If it changes, replace output_name with the new device_id; the hook itself does not need modification.
Sunshine currently applies its native dd_* mode before running prep commands. If the client asks for a mode VDD does not advertise yet, the first connection adds the mode and reloads VDD but cannot use it immediately. Disconnect and reconnect once. Later connections to that mode work normally.
The client must enable Optimize Game Settings/SOPS for Sunshine's auto resolution, refresh-rate, and HDR settings to follow the stream request.
- VDD is installed and its controller pipe is available as
\\.\pipe\MTTVirtualDisplayPipe. - VDD settings live at
C:\VirtualDisplayDriver\vdd_settings.xml. - One VDD monitor is used for streaming.
- A console user session is active. Windows RDP can change session and display topology; a separate Sunshine bootstrap app that excludes this global prep command can be useful for reaching/unlocking the console first.
Do not replace the supported SETDISPLAYCOUNT 1 operation with the unsafe RELOAD_DRIVER command.