Easily Enjoy Remote Gaming with Sunshine and Moonlight

Easily Enjoy Remote Gaming with Sunshine and Moonlight
Do you have a high-end gaming PC and want to access it from anywhere? Play your favorite games on your TV or projector via an Android TV or Apple TV? Or enjoy gaming from your bed on your smartphone? 😎
Look no further! With Sunshine and Moonlight, you can stream your games with outstanding quality and virtually no latency — and the best part: it’s free.
These two open-source tools let you play in 4K HDR, with Bluetooth controller support, without costly subscriptions. I’ll walk you through the entire setup step by step. 🚀
🛠️ Step-by-Step Configuration
In my case, I have a high-performance Unraid server powered by a Threadripper 3990X, 128 GB of RAM, and 2 NVIDIA RTX 3090 GPUs. I chose to create a gaming VM running Windows 11 Pro.
🔵 0. OPTIONAL – Install a Virtual Display for Gaming VM
Since my VM didn’t have a physical display and I didn’t have a “Dummy HDMI” plug, I installed a virtual display. I used VDD (Virtual Display Driver), an open-source project, which you can download here.
The installation is straightforward: Next > Next > Install > Finish. ✅
Once installed, you can add custom resolutions. For example, I added 2560x1600:
🔵 1. Install Sunshine on Your PC or VM
On Windows:
- Download Sunshine from the official GitHub repository.
- Follow the installation instructions: sunshine-windows-installer.exe.
On Linux:
- Refer to the instructions provided on the GitHub page.
💡 Sunshine works with all GPU types, making it ideal for VMs with GPU passthrough.
🔵 2. Configure Sunshine
- Access Sunshine’s web interface and log in.
- Navigate to Configuration > Audio/Video and add your Display Device ID.
- Sunshine may detect the display automatically, but I opted to specify my virtual display manually.
- To find your Display Device ID:
- Go to Troubleshooting > Logs to locate the ID.
- Under the Network tab:
- Set “Address Family” to IPv4+IPv6.
- Optionally : Specify your Tailscale IP under “External IP” if you plan to access your games remotely.
This setup lets you play from anywhere in the world with Moonlight. 🌍
🔵 3. Install Moonlight on Your Clients
Install Moonlight on:
- Your Android TV or Apple TV
- Your smartphone (Android/iOS)
- Your Steam Deck
How to Pair Moonlight with Sunshine:
- Open Moonlight on your client device.
- Note the PIN displayed.
- In Sunshine’s web interface, go to PIN and enter the code.
Done! Your devices are now paired. 🎮
🔵 4. OPTIONAL – Automatically Resize the Display to Match Client Resolution
If automatic display resizing doesn’t work properly, here’s a PowerShell workaround:
Steps:
- Install the DisplaySettings PowerShell module:
Install-Module -Name DisplaySettings
- In Sunshine’s web interface, go to Applications and create a new application.
- Add the following commands under Command Preparations:
✅ Do Command (dynamically adjusts resolution):
cmd /c "powershell -Command \"if (-not (Get-Module -Name 'DisplayResolution')) { Import-Module 'DisplayResolution' }; Set-DisplayResolution -Width %SUNSHINE_CLIENT_WIDTH% -Height %SUNSHINE_CLIENT_HEIGHT%\""
↩️ Undo Command (reverts to default resolution):
cmd /c "powershell -Command \"if (-not (Get-Module -Name 'DisplayResolution')) { Import-Module 'DisplayResolution' }; Set-DisplayResolution -Width 1920 -Height 1080\""
- Optionally, launch Steam in Big Picture mode using:
steam://open/bigpicture
And there you go! Your setup is now optimized for seamless remote gaming. 🕹️
🚀 Conclusion
Congratulations! 🎉 You’ve successfully configured a high-performance remote gaming setup using Sunshine and Moonlight. Whether you’re playing on your TV, smartphone, or remotely through Tailscale, you’ll enjoy stunning visuals and ultra-low latency — all for free and with open-source tools.
Enjoy remote gaming 😎
