Transform Proxmox VMs into High-Performance Cloud PCs for Gaming and Graphics with Sunshine & Moonlight

Virtualization tutorial - IT technology blog
Virtualization tutorial - IT technology blog

The Nightmare Called Remote Desktop

You own a powerful Proxmox server with dozens of virtual machines (VMs) for work. However, whenever you need to use a Windows VM to edit videos with CapCut or play a few games, you hit a dead end. Traditional solutions like RDP (Windows Remote Desktop) or VNC often provide a terrible experience.

Pixelated images, mouse delays of a full second, and watching 60fps video is out of the question. For an IT professional, this stuttering and lag is extremely frustrating. You have powerful hardware, but you can’t fully exploit its power remotely.

Why Are Old Protocols So Slow?

RDP and VNC were originally designed for light office tasks. They optimize the transmission of static frames or small changes on the screen. When you open a video or play a game, millions of pixels change constantly every second.

At this point, RDP eats up all CPU resources to compress images but still can’t keep up with the frame rate. The result is bandwidth congestion, an overloaded server, and a laggy mess of visuals. More importantly, these solutions don’t leverage the hardware encoding power of the GPU, causing latency to skyrocket.

Weaknesses of Popular Solutions

I tried many options before finding “the one”:

  • AnyDesk/TeamViewer: Convenient but depends on intermediary servers. Latency is often over 100ms, and bandwidth is frequently throttled on the free version.
  • Parsec: Very smooth but closed source. Installation on Proxmox VMs can sometimes be very picky with drivers and hardware.
  • VNC: Outdated technology. Poor image quality and almost no support for high-quality audio.

The Ultimate Solution: The Sunshine and Moonlight Duo

After months of testing on my personal homelab, I can confirm that Sunshine (Host) and Moonlight (Client) is the reigning champion combo. Sunshine is a perfect open-source replacement for the discontinued NVIDIA GameStream. It allows the GPU to handle video compression with ultra-low latency, typically under 5-10ms on a LAN.

Moonlight acts as an extremely lightweight receiver app. You can install it on any device, from Android phones and iPhones to an old laptop running Linux.

Step 1: Configure GPU Passthrough on Proxmox

This is the most critical step for the VM to achieve near-native performance. You need to pass the physical graphics card’s power directly into the Windows VM. If running via CPU (software encoding), performance drops by up to 60%, and the visuals won’t be smooth.

First, enable IOMMU in the BIOS (usually under the Virtualization section). Next, access the Proxmox terminal and edit the grub file:

nano /etc/default/grub

Edit the GRUB_CMDLINE_LINUX_DEFAULT line (example for Intel CPUs):

GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt"

Don’t forget to update grub and load the necessary modules so Proxmox recognizes the passthrough mode correctly:

update-grub
echo "vfio" >> /etc/modules
echo "vfio_iommu_type1" >> /etc/modules
echo "vfio_pci" >> /etc/modules
echo "vfio_virqfd" >> /etc/modules

Restart the server, then go to the Proxmox Web UI. In the Hardware section of the Windows VM, select Add -> PCI Device and point it to your graphics card. Remember to check “All Functions” and “Primary GPU”.

Step 2: Set Up Sunshine on the Virtual Machine

Once the Windows VM has recognized the GPU driver, download Sunshine from GitHub. The installation takes only a few minutes. After running, Sunshine opens a management interface at https://localhost:47990.

In the Configuration tab, pay attention to the Video section. If using an NVIDIA card, select the nvenc encoder. For AMD cards, select amf. Forcing Sunshine to use the correct hardware encoder reduces CPU load and eliminates image latency.

Step 3: Connect Using Moonlight

Open Moonlight on your client device (laptop or phone). The app will automatically scan for the VM running Sunshine on the same local network. If it doesn’t appear, simply enter the VM’s IP address manually.

A PIN code will appear on the Moonlight screen. Go back to the Sunshine web interface, enter this code into the PIN tab to authenticate. Instantly, the smooth Windows screen will appear before your eyes.

Step 4: Fine-tuning Parameters for 60 FPS

For the best experience, I usually configure Moonlight as follows:

  • Bitrate: Set to around 30-50 Mbps for 5GHz Wi-Fi. For 1Gbps LAN, you can push it to 80 Mbps for crystal-clear images.
  • Video Codec: Prioritize H.265 (HEVC) for better quality at lower bandwidth.
  • V-Sync: Disable this in Moonlight to minimize input lag for fighting games or shooters.

Real-world Experience from the Homelab

I am currently running 12 VMs on Proxmox and have learned one lesson: Don’t use onboard GPUs for Passthrough. An old dedicated card like a GTX 1650 or RTX 3060 makes a world of difference in stability.

If you want to access your Cloud PC from a cafe, absolutely do not open Sunshine ports to the Internet. Install Tailscale or WireGuard on Proxmox instead. This allows you to connect securely to your home network and then use Moonlight as if you were sitting right next to the server.

Conclusion

Building a Cloud PC with Sunshine and Moonlight is a great way to repurpose old hardware. You can perform heavy tasks on a thin-and-light laptop while the server handles all the computational heavy lifting. With just a few GPU Passthrough configuration steps, you’ll have a remote workstation that is just as smooth as a physical machine on your desk.

Share: