From 88a5d919dcffaa68d1fa2d119ab4c5a857951b83 Mon Sep 17 00:00:00 2001 From: Garrett Allen <98648590+Gerrrt@users.noreply.github.com> Date: Fri, 9 Oct 2026 13:41:10 -0700 Subject: [PATCH 1/3] docs(dotfiles): bake the Windows layer's prerequisites into dot-windows (#1108) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- docs/changelog.md | 13 +++ docs/runbooks/test-the-dotfiles-layers.md | 101 +++++++++++++++++----- 2 files changed, 91 insertions(+), 23 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 74d79ce3..45fd3ad9 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -46,6 +46,19 @@ docstring gives: it is a record, not a claim about now. through the guest agent on all seven, and confirmed gone on each. 911 and 912 lose it at their next rebuild. +- **`dot-windows` now starts a run with the layer's prerequisites in place** + ([#1108](https://github.com/Gerrrt/HomeLab/issues/1108)). It was re-cloned + from 911, rebuilt with the OOBE fix (#1093). Its `clean` snapshot now + includes, machine-wide: + - PowerShell 7.6.6, Git 2.56.0.2, WSL 3.0.1 and Wireshark 4.6.9, each + checked against its publisher's SHA-256; + - Developer Mode; + - `winget configure`, switched on. + + The layer's `winget configure` finds each package present and skips it, so + the UAC prompts that stalled the 2026-10-08 console run should not appear. + The bake is in `test-the-dotfiles-layers.md` §3, for the next re-clone. + - **The replacement rack is bought, at 32U rather than the planned 27U** ([#919](https://github.com/Gerrrt/HomeLab/issues/919)). It is due 2026-10-16. Nothing else about the plan changed. The five extra units are diff --git a/docs/runbooks/test-the-dotfiles-layers.md b/docs/runbooks/test-the-dotfiles-layers.md index 1ec088cb..a92d7c53 100644 --- a/docs/runbooks/test-the-dotfiles-layers.md +++ b/docs/runbooks/test-the-dotfiles-layers.md @@ -143,6 +143,61 @@ is never written down. The account logs in by key alone, as `sshd` allows nothing else here. Its default shell is PowerShell, so chain commands with `;`, not `&`. +**Then bake in what the layer's `configuration.dsc.yaml` installs, still +before the shutdown** (#1108). `tester` is a standard user, so at the console +every machine-wide install asks for the `Administrator` password, and the +first run (2026-10-08) was mostly UAC prompts. Installed here, machine-wide, +`winget configure` finds each package present and skips it. Run it as +`Administrator` over SSH, or as SYSTEM through the guest agent +(`qm guest exec 198 -- powershell -NoProfile -EncodedCommand …` as root on +`Saruman`): + +```powershell +$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue' +$d = Join-Path $env:WINDIR 'Temp\bake'; New-Item -ItemType Directory -Force $d | Out-Null +# Each from its publisher, with the SHA-256 the publisher states (GitHub's +# release digest; Wireshark's SIGNATURES file). Current on 2026-10-09. +$items = @( + @{ n='PowerShell-7.6.6-win-x64.msi'; u='https://github.com/PowerShell/PowerShell/releases/download/v7.6.6/PowerShell-7.6.6-win-x64.msi'; h='958838ff55091e1c8705d89efed0cc7e8245a3a6ef6c0ccfae20015227108ad8' }, + @{ n='Git-2.56.0.2-64-bit.exe'; u='https://github.com/git-for-windows/git/releases/download/v2.56.0.windows.2/Git-2.56.0.2-64-bit.exe'; h='52188f917b378f00c70ec136bcf090005f30d44fbc4eba0bce759cc6592d60f6' }, + @{ n='wsl.3.0.1.0.x64.msi'; u='https://github.com/microsoft/WSL/releases/download/3.0.1/wsl.3.0.1.0.x64.msi'; h='28b1a0d013640a2ac95898ea705fa186e5b4ff767a1c1b49257161bc106599c6' }, + @{ n='Wireshark-4.6.9-x64.exe'; u='https://www.wireshark.org/download/win64/Wireshark-4.6.9-x64.exe'; h='bf9b5ce8a89f244c376a9b1a946276eaa06463dde3e33069a34d7f102f5878cf' } +) +foreach ($i in $items) { + $f = Join-Path $d $i.n + Invoke-WebRequest -UseBasicParsing -Uri $i.u -OutFile $f + if ((Get-FileHash -Algorithm SHA256 $f).Hash.ToLower() -ne $i.h) { throw "hash mismatch: $($i.n)" } +} +# Not $args: that name is PowerShell's own, and a parameter called it is empty. +function Run($exe, $argv) { $p = Start-Process -FilePath $exe -ArgumentList $argv -Wait -PassThru; if ($p.ExitCode -notin 0, 3010) { throw "$exe exited $($p.ExitCode)" } } +Run msiexec.exe "/i `"$d\PowerShell-7.6.6-win-x64.msi`" /qn /norestart ADD_PATH=1 ENABLE_PSREMOTING=0 REGISTER_MANIFEST=1 USE_MU=1 ENABLE_MU=1" +Run "$d\Git-2.56.0.2-64-bit.exe" "/VERYSILENT /NORESTART /SUPPRESSMSGBOXES /NOCANCEL /SP- /COMPONENTS=gitlfs,assoc,assoc_sh" +Run msiexec.exe "/i `"$d\wsl.3.0.1.0.x64.msi`" /qn /norestart" +Run "$d\Wireshark-4.6.9-x64.exe" "/S /desktopicon=no /quicklaunchicon=no" +# Developer Mode: what the layer's DeveloperMode resource sets. +New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock -Force | Out-Null +Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock -Name AllowDevelopmentWithoutDevLicense -Type DWord -Value 1 +Remove-Item -Recurse -Force $d +# winget configure is off on a fresh install, and turning it on is elevated. +$wg = Get-ChildItem 'C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe\winget.exe' | Sort-Object FullName | Select-Object -Last 1 +& $wg.FullName configure --enable +``` + +What it leaves out, on purpose: + +- **Windows Terminal** ships with Windows 11 and is registered at each + user's first logon. +- **GNU Wget2** installs per user, so it asks for nothing. +- **Npcap.** Wireshark's silent install skips it, because Npcap's free + edition has no silent install. Capture is not part of the test. +- **WSL** is installed but cannot start, because the guest has no nested + virtualization (§4). + +The versions are the current ones on 2026-10-09. At a re-clone, take the +current release of each and its publisher's SHA-256. winget's `configure` +only asks for each package to be present, not for a version, so an older +pin is still skipped. + ## 4. A run Every run starts from `clean`: @@ -237,37 +292,36 @@ Then, per layer: ``` The password is a run-time change, and the next rollback discards it. - Then, at the console, in Windows PowerShell: + Then, at the console, in PowerShell 7 (`pwsh`). `clean` already has Git, + PowerShell 7, the configuration's other packages, Developer Mode and + `winget configure` switched on (§3): ```powershell - winget configure --enable - winget install Git.Git Microsoft.PowerShell git clone https://github.com/dotgibson/dotfiles-Windows.git ~/dotfiles-Windows cd ~/dotfiles-Windows (Get-Content configuration.dsc.yaml) -replace 'allowPrerequisites','allowPrerelease' | Set-Content configuration.dsc.yaml winget configure -f configuration.dsc.yaml --accept-configuration-agreements ``` - Two lines here are not in the layer's README - ([dotgibson/dotfiles-Windows#285](https://github.com/dotgibson/dotfiles-Windows/issues/285)): - - - **`winget configure --enable`.** A fresh install has configuration - switched off. - - **The `-replace` on `configuration.dsc.yaml`.** On 2026-10-08 the file's - directives read `allowPrerequisites`, which winget does not know. - `Microsoft.Windows.Developer` (`OsVersion`, `DeveloperMode`) is - published only as prereleases, so without `allowPrerelease` the - configure stops at "OsVersion [os-version] The configuration unit could - not be found". Drop the line once the layer is fixed. - - **The console opens at OOBE's "Who's going to use this device?"**, because - 911's answer file declares no local account (a template bug, tracked - separately). Create a throwaway account there, which the rollback - discards. Then sign out and sign in as `tester` under *Other user*, because - OOBE's account is an administrator. - - Approve the UAC prompts with the `Administrator` password, which is the - template's build password from `phoenix.env`. Then, in a new `pwsh`: + One line here is not in the layer's README + ([dotgibson/dotfiles-Windows#285](https://github.com/dotgibson/dotfiles-Windows/issues/285)). + It is the `-replace` on `configuration.dsc.yaml`: + - On 2026-10-08 the file's directives read `allowPrerequisites`, which + winget does not know. + - `Microsoft.Windows.Developer` (`OsVersion`, `DeveloperMode`) is published + only as prereleases. + - So without `allowPrerelease` the configure stops at "OsVersion + [os-version] The configuration unit could not be found". + + Drop the line once the layer is fixed. + + The console opens at the sign-in screen (#1092, fixed by #1093 and 911's + 2026-10-09 rebuild). Sign in as `tester` under *Other user*. + + The configure should ask for no UAC approval. If it does, that package is + one the bake in §3 does not cover: approve it with the `Administrator` + password (the template's build password, from `phoenix.env`) and add it to + the bake. Then, in a new `pwsh`: `cd ~/dotfiles-Windows; .\install.ps1`. After that, in another new `pwsh`, run the layer's doctor (`powershell/os/45-doctor`). @@ -341,3 +395,4 @@ reservations. The templates are `build-the-lab-templates.md` §10's. | 2026-10-09 | 907 rebuilt for review (`cloud-init clean --machine-id`) | Built twice and smoke-tested again, then `dot-alpine` re-cloned with `-target`ed `-replace` and `clean` retaken. Alpine (OpenRC) has no `/etc/machine-id` at all, so the flag is for parity with the other templates, not a fix | | 2026-10-09 | Phase 4: template 909 (NixOS) and `dot-nixos` | 909 built twice from the NixOS 26.05 minimal ISO and smoke-tested both times, about 5 min a build. The first two builds stopped at mounting the new root: once on a `/dev/disk/by-label` link udev had not made yet, and once because the ISO had not loaded ext4, so `mount` tried the partition as FAT. Both are fixed by mounting by device, with the type named. `dot-nixos` (197, .97) was applied with `-target`. `tester` has `sudo`, the `nixos-26.05` channel is present, root grew to 39G, and `clean` was taken stopped | | 2026-10-09 | First run, NixOS (dotfiles v7.14.0) | In the layer's order: the `home-manager` channel (release-26.05), `nix/nixos.nix` with `tester` and the home-manager module, then `nixos-rebuild switch`, which took about 1 min and activated `home-manager-tester.service`. Then `./bootstrap.sh`, exit 0 in 1 s (links only, no escalation), and `core doctor` exit 0, with nine missing: `viddy gron sd xh doggo op ast-grep uv difft`. None of them is in `nix/home.nix`'s `home.packages`, so the layer's package set lags what Core expects | +| 2026-10-09 | `dot-windows` re-cloned from the rebuilt 911 (#1093), §3 again, then the new prerequisite bake (#1108) | First boot rested at the sign-in screen: `AutoAdminLogon=0`, no `DefaultPassword`, no `Panther\unattend-original.xml`. `tester` logs in by key at Medium Mandatory Level. The bake ran as SYSTEM through the guest agent: all four downloads matched their published SHA-256, and every installer exited 0. Afterwards winget (as SYSTEM) lists Git.Git 2.56.0.2, Microsoft.PowerShell 7.6.6, Microsoft.WSL 3.0.1 and WiresharkFoundation.Wireshark 4.6.9. `configure --enable` exited 0. `clean` retaken stopped. The console run has not been done yet | From f96246733e36fc33fe996547b660ff5edcb91afb Mon Sep 17 00:00:00 2001 From: Garrett Allen <98648590+Gerrrt@users.noreply.github.com> Date: Fri, 9 Oct 2026 13:50:14 -0700 Subject: [PATCH 2/3] docs(dotfiles): the bake runs as SYSTEM through the guest agent, not over SSH (#1108) Co-Authored-By: Claude Opus 5.5 --- docs/runbooks/test-the-dotfiles-layers.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/runbooks/test-the-dotfiles-layers.md b/docs/runbooks/test-the-dotfiles-layers.md index a92d7c53..8bf7d15c 100644 --- a/docs/runbooks/test-the-dotfiles-layers.md +++ b/docs/runbooks/test-the-dotfiles-layers.md @@ -147,10 +147,20 @@ nothing else here. Its default shell is PowerShell, so chain commands with before the shutdown** (#1108). `tester` is a standard user, so at the console every machine-wide install asks for the `Administrator` password, and the first run (2026-10-08) was mostly UAC prompts. Installed here, machine-wide, -`winget configure` finds each package present and skips it. Run it as -`Administrator` over SSH, or as SYSTEM through the guest agent -(`qm guest exec 198 -- powershell -NoProfile -EncodedCommand …` as root on -`Saruman`): +`winget configure` finds each package present and skips it. + +Run it as SYSTEM through the guest agent, as root on `Saruman`, and **not** +as `Administrator` over SSH. The last line, `winget configure --enable`, +fails from an SSH network logon (`0x80070520`, §4), and SYSTEM is the route +that was verified (2026-10-09). Save the block below as `bake.ps1`, then: + +```bash +qm guest exec 198 --timeout 1780 -- powershell -NoProfile \ + -EncodedCommand "$(iconv -t UTF-16LE bake.ps1 | base64 -w0)" +``` + +`exitcode` 0 means every step ran. Anything else names the step in +`err-data`. ```powershell $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue' @@ -179,6 +189,7 @@ New-Item -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock -F Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock -Name AllowDevelopmentWithoutDevLicense -Type DWord -Value 1 Remove-Item -Recurse -Force $d # winget configure is off on a fresh install, and turning it on is elevated. +# As SYSTEM this works; from an SSH logon it fails (0x80070520). $wg = Get-ChildItem 'C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe\winget.exe' | Sort-Object FullName | Select-Object -Last 1 & $wg.FullName configure --enable ``` From b25b4d1b8670c4b991abd78a6426aecedb7c7ff2 Mon Sep 17 00:00:00 2001 From: Garrett Allen <98648590+Gerrrt@users.noreply.github.com> Date: Fri, 9 Oct 2026 13:55:46 -0700 Subject: [PATCH 3/3] docs(dotfiles): the bake fails when winget configure --enable does (#1108) Co-Authored-By: Claude Opus 5.5 --- docs/runbooks/test-the-dotfiles-layers.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/runbooks/test-the-dotfiles-layers.md b/docs/runbooks/test-the-dotfiles-layers.md index 8bf7d15c..e4bb3bb1 100644 --- a/docs/runbooks/test-the-dotfiles-layers.md +++ b/docs/runbooks/test-the-dotfiles-layers.md @@ -191,7 +191,10 @@ Remove-Item -Recurse -Force $d # winget configure is off on a fresh install, and turning it on is elevated. # As SYSTEM this works; from an SSH logon it fails (0x80070520). $wg = Get-ChildItem 'C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe\winget.exe' | Sort-Object FullName | Select-Object -Last 1 +if (-not $wg) { throw 'winget.exe not found: App Installer is not provisioned' } +# A native command's exit code is not an error to $ErrorActionPreference. & $wg.FullName configure --enable +if ($LASTEXITCODE -ne 0) { throw "winget configure --enable exited $LASTEXITCODE" } ``` What it leaves out, on purpose: