Add doctor health check and Kali setup script

doctor verifies bridge, per-VM SMB/WinRM, DNS SRV records, the site and the
leaked credential in one pass — the instructor's first move when something
looks wrong.

Start order now boots dc01 first and waits for WinRM: a member that wins the
race loses its machine-account channel (NO_LOGON_SERVERS on every logon).
This commit is contained in:
2026-10-21 20:13:18 -04:00
parent 71e05d6aa6
commit d34981d279
6 changed files with 222 additions and 8 deletions
+47
View File
@@ -195,3 +195,50 @@ backend_stop() {
rm -f "$(qemu_pidfile "$name")"
ok "$name stopped"
}
# ------------------------------------------------------------------ baseline
backend_snapshot() {
local name=$1
local golden base overlay
golden=$(qemu_golden "$name")
base=$(qemu_base "$name")
overlay=$(qemu_overlay "$name")
if backend_running "$name"; then
fail "$name is still running"
return 1
fi
if [[ -f $base ]]; then
ok "$(printf '%-6s baseline already frozen' "$name")"
return 0
fi
if [[ ! -f $golden ]]; then
fail "$name has no disk to freeze"
return 1
fi
mkdir -p "$(dirname "$base")" "$(dirname "$overlay")"
mv "$golden" "$base"
# Relative backing path: the tree can move without breaking the chain.
qemu-img create -q -f qcow2 -F qcow2 -b "../base/${name}-base.qcow2" "$overlay"
ok "$(printf '%-6s baseline frozen (%s)' "$name" "$(du -h "$base" | cut -f1)")"
}
backend_reset() {
local name=$1
local base overlay
base=$(qemu_base "$name")
overlay=$(qemu_overlay "$name")
if backend_running "$name"; then
backend_stop "$name" >/dev/null 2>&1 || true
fi
if [[ ! -f $base ]]; then
fail "$name has no baseline — run ./lab.sh snapshot first"
return 1
fi
rm -f "$overlay"
qemu-img create -q -f qcow2 -F qcow2 -b "../base/${name}-base.qcow2" "$overlay"
ok "$(printf '%-6s reverted' "$name")"
}