HydraIssues

hydrabody uninstall/shutdown do not restore kiosk-mode side effects
open bug Project: hydrabody Reporter: cederik 15 May 2026 10:37

Description

Problem

When kiosk mode has been enabled on a hydrabody node (via kiosk_mode_enabled in BodyConfig, or POST /api/v1/kiosk/enable), hydrabody uninstall and any non-API shutdown path leave all kiosk side effects in place. The Windows machine is left unusable for the operator (no taskbar, no Win key, no Task Manager).

Observed

After removing a render node via hydranode uninstall (which kills hydrabody from outside, so kiosk Disable never runs), the following persisted on the Windows host:

  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoWinKeys = 1 — Win key blocked, so the user could not open Chrome via Win+R / search
  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr = 1 — Task Manager blocked
  • Shell_TrayWnd still hidden — taskbar missing from main display
  • Progman + WorkerW still hidden — desktop icons missing
  • C:\Windows\System32\config\systemprofile\.hydrabody\ (kioskoverlay.exe + config cache) re-created right after a previous hydranode uninstall removed it, because hydrabody was still running

Root cause

  • hydrabody/internal/cli/uninstall_windows.go stops the scheduled task, removes data dirs, firewall rules, and C:\hydrabody, but never touches the registry policies or kiosk window state.
  • hydrabody/pkg/provider/kiosk_windows.go defines KioskController.Cleanup() / Disable() which would correctly revert everything (delete NoWinKeys + DisableTaskMgr, kill overlay, re-show Shell_TrayWnd / Progman / WorkerW). But grep -rn 'Cleanup()\|\.Disable()\|KioskController' cmd/ internal/ pkg/ (excluding the kiosk file itself) returns zero hits. Cleanup is dead code. Only POST /api/v1/kiosk/disable ever invokes the disable path.

Proposed fix

  1. internal/cli/uninstall_windows.go — before deleting files, force a kiosk teardown unconditionally (idempotent):
    • taskkill /F /IM kioskoverlay.exe (best-effort)
    • delete NoWinKeys and DisableTaskMgr registry values (ignore 'not found')
    • re-show Shell_TrayWnd / Progman / WorkerW via the same Win32 calls as showTaskbar / showDesktopIcons, or just taskkill /F /IM explorer.exe and let it respawn
  2. Wire KioskController.Cleanup() into the run-loop signal handler so SIGTERM/Ctrl-C / scheduled-task termination also restores state.
  3. CLAUDE.md Kiosk Mode section: document that uninstall and shutdown restore kiosk state.

Workaround for already-broken machines

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoWinKeys /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableTaskMgr /f
taskkill /F /IM kioskoverlay.exe
taskkill /F /IM explorer.exe
rmdir /s /q C:\Windows\System32\config\systemprofile\.hydrabody

(explorer.exe auto-respawns; this brings back the taskbar and desktop icons.)

How to reproduce

  1. Enroll a Windows render node in hydracluster, assign to a district whose BodyConfig has kiosk_mode_enabled: true, wait for kiosk to engage.
  2. From the cluster admin: remove the node, or run hydranode uninstall on the box.
  3. Sign in to Windows — taskbar gone, Win key dead, no Task Manager.

Environment

  • hydranode v1.10.33 on Windows (hydra-s-0000, node-11da9ea3 'fluffy-dumpling-87')
  • hydracluster.experiencenet.com