HydraIssues

hydrabody provisioning should install SunshineService (not direct-launch sunshine.exe)
open improvement Project: hydrabody Reporter: 22 Apr 2026 17:42

Description

Context

Follow-up to #9 (closed). On 2026-04-22 we confirmed the root cause: bodies where hydrabody directly launches sunshine.exe (without registering the SunshineService Windows service) show the Sunshine console/terminal window on top of the kiosk. Bodies where SunshineService is registered (spawned by C:\Sunshine\tools\sunshinesvc.exe, parent services.exe, running as LocalSystem) do not show a console.

Evidence:

  • wobbly (airborne-two): no SunshineService registered → hydrabody direct-launches sunshine.exe → console visible. Manually ran New-Service today to register it; console disappeared.
  • cosmic (tvl-body-one): SunshineService already registered → no console visible. Someone had run install-service.bat on that machine at some point.
  • Both machines have the complete C:\Sunshine\ tree including tools\sunshinesvc.exe (the service wrapper binary) and scripts\install-service.bat (the registration script). So the tooling is present; registration is just missing.

Proposal

Update hydrabody/pkg/provider/provision_windows.go so that after installProvider() extracts the Sunshine distribution, it also:

  1. Runs C:\Sunshine\scripts\install-service.bat (or equivalently calls New-Service / sc create) to register SunshineService with binPath=C:\Sunshine\tools\sunshinesvc.exe, start=auto, obj=LocalSystem.
  2. Runs C:\Sunshine\scripts\autostart-service.bat (sets auto-start).
  3. Starts the service.
  4. Skips the direct-launch code path (startProvider should check for the service first and only fall back to direct-launch if the service is not registered — or remove direct-launch entirely).

Rollout

  • Idempotent: if SunshineService already exists, skip registration but verify start=auto.
  • Tag a hydrabody patch release via normal CI.
  • On bodies that currently direct-launch, the next hydrabody update will register the service and switch over (with a brief provider-restart window).

Why this matters

Fleet-wide cosmetic fix (no Sunshine console ever visible to kiosk viewers). Also: the service approach is what Sunshine's own installer does, so we stop diverging from upstream defaults.

References

  • #9 "Sunshine terminal window visible on top when WebRTC stream starts" (closed, but structural fix was never landed)
  • Manual fix applied on wobbly on 2026-04-22 as a short-term workaround