From 91670f0d28d20dcaecd38d318fe4f0eba34e7f02 Mon Sep 17 00:00:00 2001 From: ediblerope Date: Thu, 7 May 2026 09:47:55 +0100 Subject: [PATCH] dr-server: wrap wine64 in xvfb-run for headless Unity Unity's Win64 build still creates a 1x1 hidden window via Win32 even under -batchmode -nographics. Wine needs an X display to honor that; without one, startup fails with "Failed to create batch mode window: Success." after Mono initializes and PhysX comes up. xvfb-run -a gives it a virtual display with no real X server cost. Co-Authored-By: Claude Opus 4.7 --- services/dr-server.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/dr-server.nix b/services/dr-server.nix index 548e6ac..aa08f6a 100644 --- a/services/dr-server.nix +++ b/services/dr-server.nix @@ -40,7 +40,6 @@ in WINEARCH = "win64"; WINEDEBUG = "-all"; HOME = dataDir; - DISPLAY = ""; }; preStart = '' @@ -57,7 +56,11 @@ in User = "dr-server"; Group = "dr-server"; WorkingDirectory = buildDir; - ExecStart = "${wine}/bin/wine64 DR_Server.exe -batchmode -nographics -logFile ${logDir}/server.log"; + # Unity's Win64 build still tries to create a 1x1 hidden window + # via Win32 even with -batchmode -nographics, and Wine needs a + # real X display for that — fails with "Failed to create batch + # mode window: Success." otherwise. xvfb-run gives it one. + ExecStart = "${pkgs.xvfb-run}/bin/xvfb-run -a ${wine}/bin/wine64 DR_Server.exe -batchmode -nographics -logFile ${logDir}/server.log"; Restart = "on-failure"; RestartSec = "10s"; };