Repository navigation
fix(packer): one-shot AutoLogon so Windows 11 clones finish OOBE (#1092) - #1093
Conversation
A cloned Win11 endpoint (carbuncle, siren from template 911) parks on the OOBE "create a user account" page and never reaches a logon screen. The clone's answer file had HideLocalAccountScreen=true and the built-in Administrator but no AutoLogon, which sysprep.ps1 strips from the generalised image. On client SKUs that is not enough to finish the account page, so OOBE idles as defaultuser0; Server 2025 (912) is unaffected, which is why only the Win11 guests stall. The rest of Setup completes - the guests domain-join, run sshd and the agent, and verify.yml passes - so this is a cosmetic stall that only blocks an interactive console session. unattend-oobe.xml.pkrtpl now carries a one-shot AutoLogon (Administrator, LogonCount 1) with FirstLogonCommands that turn autologon off and delete the plaintext DefaultPassword Setup writes to Winlogon. The template itself still never autologins; only the clone's single OOBE pass does, then disables itself, mirroring the build's autounattend.xml. Needs a 911 rebuild to take effect, so this stays a draft until a rebuilt clone is seen landing at a normal logon screen. Refs #1092 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Verified on a scratch build, 2026-10-08: the fix works, but
|
| Check | Result |
|---|---|
| Console | Went past OOBE by itself and finished at the desktop, not the account page ✅ |
HKLM\SYSTEM\Setup |
OOBEInProgress=0, SystemSetupInProgress=0 ✅ |
Winlogon AutoAdminLogon |
0 ✅ |
Winlogon DefaultPassword |
gone ✅ (AutoLogonCount=1 remains, which is inert with AutoAdminLogon=0) |
defaultuser0 |
no longer in Administrators ✅. The account still exists, disabled, and its profile remains |
packer-close-winrm.log |
left: 0 on both runs, and no packer certificate in LocalMachine\My ✅ (#1031 holds) |
quser |
administrator console Active |
The gap: the one-shot autologon leaves Administrator logged on at an unlocked desktop on the console, for as long as the guest runs. Anyone who opens the Proxmox console gets an admin session with no password. I'd add a third FirstLogonCommands entry so the session ends once the first two have run:
<SynchronousCommand wcm:action="add">
<Order>3</Order>
<Description>End the one-shot session, so the console rests at the sign-in screen</Description>
<CommandLine>shutdown /l /f</CommandLine>
</SynchronousCommand>logoff would also work. The console would then show the sign-in screen, which is what #1092 expects.
A separate, pre-existing finding, not caused by this PR: C:\Windows\Panther\unattend-original.xml is written during the build and baked into the image. It holds the build's AdministratorPassword and its autologon <Password> in plaintext, and its ACL grants BUILTIN\Users read access. That is true on clones of today's 911 as well (checked on dot-windows). Any standard user on a 911 clone can read the template build password. I'm raising it as its own task.
…#1092) Review on #1093 (verified on a scratch 911 clone) found the one-shot AutoLogon completes OOBE but leaves Administrator at an unlocked desktop. A third FirstLogonCommand, shutdown /l /f, logs that session off after the first two disable autologon and clear the stored credential, so the clone lands at the lock screen. Refs #1092 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…es (#1099) (#1103) * fix(packer): scrub the plaintext Panther answer files on Windows clones (#1099) Setup copies the specialize/oobe answer files into C:\Windows\Panther as unattend.xml and unattend-original.xml; they carry the build password (and, since #1093, the AutoLogon password) in plaintext and are readable by BUILTIN\Users. SetupComplete.cmd already deletes unattend-oobe.xml; it now also deletes those two, before any user can log on. The ansible base role already rotates the local Administrator away from the build password on domain members, so the leak was stale there; this removes the artifact itself, for every future 911/912 clone (incl. the dotfiles Windows VM, which is not base-role-managed). Needs a template rebuild to take effect. Closes #1099 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(packer): make the Panther scrub a readiness invariant, not best-effort (#1099) Review on #1103: the del was best-effort — a failed delete would still start QEMU-GA and pass smoke, silently shipping the plaintext credential. Now: - SetupComplete.cmd refuses to start QEMU-GA (the readiness signal packer-smoke.sh waits on) if either Panther answer file survived the scrub, so a failed rebuild fails loudly instead of shipping the leak; - packer-smoke.sh asserts both files are absent over SSH before declaring the template usable. Refs #1099 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
|
Taking this over (no other session is on it). The logoff step (d05e255, 🤖 Generated with Claude Code |
There was a problem hiding this comment.
🟡 Changes recommended
Concurrent first-logon commands can race the forced logoff, leaving autologon credentials configured.
1 open finding
What changed in this PR
Adds one-shot Administrator autologon so Windows 11 clones complete OOBE.
Changes:
- Adds clone-time autologon.
- Attempts credential cleanup and immediate logoff.
| File | Description |
|---|---|
packer/windows/unattend-oobe.xml.pkrtpl |
Configures OOBE autologon and cleanup commands. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ast (#1092) Windows 10 and 11 start FirstLogonCommands without waiting for the one before, so the separate logoff could end the session before AutoAdminLogon was cleared and DefaultPassword deleted. One cmd /c chain fixes the order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ws (#1108) (#1111) * docs(dotfiles): bake the Windows layer's prerequisites into dot-windows (#1108) At the console, tester is a standard user, so each machine-wide install in the layer's configuration.dsc.yaml asked for the Administrator password. §3 now installs those packages before `clean` is taken: PowerShell 7, Git, WSL and Wireshark, each checked against its publisher's SHA-256. It also turns on Developer Mode and `winget configure`. §4 drops the steps those cover, and the OOBE workaround that #1093 made unnecessary. Done on 198 today; the as-run table and the changelog record it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(dotfiles): the bake runs as SYSTEM through the guest agent, not over SSH (#1108) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…dows (#1108) (#1112) * docs(dotfiles): bake the Windows layer's prerequisites into dot-windows (#1108) At the console, tester is a standard user, so each machine-wide install in the layer's configuration.dsc.yaml asked for the Administrator password. §3 now installs those packages before `clean` is taken: PowerShell 7, Git, WSL and Wireshark, each checked against its publisher's SHA-256. It also turns on Developer Mode and `winget configure`. §4 drops the steps those cover, and the OOBE workaround that #1093 made unnecessary. Done on 198 today; the as-run table and the changelog record it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(dotfiles): the bake runs as SYSTEM through the guest agent, not over SSH (#1108) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(dotfiles): the bake fails when winget configure --enable does (#1108) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * wip * wip2 * feat(tofu,dotfiles): VirtIO GPU and a baked first sign-in for dot-windows (#1108) Two things made dot-windows slow, and neither was Saruman. Proxmox's default VGA has no Windows driver, so the guest drew every frame on the CPU as the Basic Display Adapter. The guest module gains a `vga` input, null by default, and dot-windows sets "virtio"; viogpudo is already in 911. And tester's first sign-in ran the CPU at 30-100% for 3.5-7.5 minutes, so §3 now signs it in once before `clean`, after which a sign-in settles in about 2 minutes. Both are applied to 198, and the as-run table and changelog record the measurements. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Draft — needs a 911 rebuild to verify (see #1092)
Addresses the Windows 11 OOBE stall diagnosed in #1092: cloned Win11 endpoints (
carbuncle,siren) park on the "set up a user account" page forever, while Server 2025 clones don't.The change
packer/windows/unattend-oobe.xml.pkrtplgains a one-shot<AutoLogon>for Administrator (LogonCount 1) in theoobeSystempass, plusFirstLogonCommandsthat:AutoAdminLogon = 0, andDefaultPasswordSetup writes to Winlogon.So the clone logs in once to finish OOBE, lands at a normal logon screen, and leaves nothing behind. The generalised image still never autologins —
sysprep.ps1is unchanged and still strips the build's autologon; this only re-adds it to the clone's single OOBE pass. It mirrors the build-timeautounattend.xml, whose AutoLogon is why the build completes OOBE cleanly.Why it's needed
On Windows 11 client,
HideLocalAccountScreen=true+ the enabled built-in Administrator does not finish the OOBE account page without an AutoLogon or a created user — OOBE idles asdefaultuser0. Server 2025 proceeds to the logon screen regardless, which is why only the 911-based guests stalled. Full evidence in #1092 (on the parkedcarbuncle:OOBEInProgress=0, agent + sshd running, domain-joined,defaultuser0on the console).Scope / safety
Verification (owner: lab-pipeline flow)
Draft until someone:
packer build, ADR-0074),defaultuser0OOBE parking;qusershows no stuck session), domain-joins and passesverify.ymlas before.Then flip this out of draft; #1092 is done at that point.
Refs #1092.
🤖 Generated with Claude Code