1# win11-gaming
2
3`win11-gaming` is Clover's Windows 11 Pro libvirt guest for games (`windows-11-pro-v2` preset, 10 vCPU,
440 GiB, account `snow`), with the RTX 3090 passed through. Its 500 GB disk is a standalone qcow2 on the `work`
5NVMe pool (`work/win11-gaming` at `/srv/win11-gaming`); NVRAM, seed, `domain.xml`, `access.json` and
6`apollo.json` stay in `/srv/vm/win11-gaming`. `config/win11-gaming.json` and `nixos/win11-gaming.nix` own the
7host side.
8
9```
10LAN ── Snow Globe 10.0.0.1 :47984,47989,48010/tcp :47998-48002,48010/udp ─DNAT─> Apollo (Moonlight host)
11Snow Globe ── ssh snow@10.101.0.2 (config/admin.pub only) / Apollo web API :47990
12dashboard console / Computer MCP ─── libvirt VNC + guest agent (owner Clover)
13guest ── virbr-ext (forward mode='open') ── MASQUERADE ── internet only
14```
15
16- **GPU:** the 3090 serves this guest or one GPU service (Local AI, Fusion), chosen with the dashboard's GPU switch.
17 Deploys never move it: GPU services other than the holder are registered stopped. The
18 domain's `managed='yes'` hostdevs make libvirt move both functions to vfio-pci at start and back to nvidia at
19 shut off; `nvidia-persistenced` stays off so nothing holds the device. Windows Update is barred from driver
20 updates (`ExcludeWUDriversInQualityUpdate`); install GeForce drivers with `-s -n`.
21- **Streaming:** Apollo 0.4.6 (a Sunshine fork) encodes HEVC on NVENC and creates a SudoVDA virtual display at
22 each client's resolution, so no monitor or dummy plug is needed. `sg game` on the Mac pairs and streams with
23 Moonlight; another client (the Apple TV) shows a PIN for `sg game pin <PIN>`. Apollo's web login is in
24 `apollo.json`; its UI only answers Snow Globe. The router forwards none of the stream ports.
25- **Isolation:** libvirt adds no rules for an open network; the `win11-gaming` chain drops new connections to
26 private, CGNAT and link-local ranges and port 25. From the guest, Snow Globe answers only DHCP and DNS.
27 Snow Globe and the forwarded stream ports can still reach into the guest.
28- **CPUs and memory:** vCPUs are pinned 1:1 to cores 3-7 and their siblings 19-23, which a libvirt hook makes an
29 exclusive cpuset partition beside `knife-linux` (8 cores); the host keeps 0-2 and 16-18. VFIO pins all 40 GiB, so
30 the ZFS ARC floor is 16 GiB and `knife-linux` is capped at 72 GiB to leave headroom.
31- **OpenSSH:** the Windows `OpenSSH.Server` capability, key-only, PowerShell as the shell:
32 `ssh -J root@10.0.0.1 snow@10.101.0.2`.
33- **Shutdown:** `win11-gaming-shutdown` shuts the guest down before `libvirt-guests`, whose managed save cannot
34 capture a VFIO device.