Skip to content

fix: document and warn about what WinRM actually needs - #154

Merged
tas50 merged 1 commit into
mainfrom
fix/windows-winrm-requirements
Aug 23, 2026
Merged

tas50 merged 1 commit into
mainfrom
fix/windows-winrm-requirements

Conversation

@tas50

@tas50 tas50 commented Aug 23, 2026

Copy link
Copy Markdown
Member

What

Rewrite the README's Windows section to cover the three things a Windows run actually needs, and warn from validate! about the one the driver can detect.

Why

I followed the Windows example in the README against a real project. It hung at "Waiting for server to be ready" until it timed out. After fixing that, it died at WinRM::WinRMAuthorizationError. Two separate undocumented causes:

1. The built-in Administrator account is disabled

Google's Windows images ship with Administrator disabled. The guest agent honours a password reset for it but does not enable it, so the login is refused. Read out of the guest on windows-2022:

admin-enabled: False

Test Kitchen's WinRM transport defaults username to administrator, and the README's example did not override it — so the documented configuration could not authenticate, and neither could gcloud compute reset-windows-password --user administrator, which confirms this is not something the driver's own password code was getting wrong.

Resetting the password for any other name works immediately, because the agent creates that account, enables it and adds it to Administrators:

CorePlugin: [INFO]: Successfully created user kitchenadmin
OK -> tk-windows-wind\kitchenadmin
True

2. Nothing in the default VPC allows TCP 5985

The default-allow-* rules on an auto mode network cover SSH, RDP and ICMP only:

default-allow-icmp      0.0.0.0/0   icmp
default-allow-internal  10.128.0.0/9 tcp:0-65535,udp:0-65535,icmp
default-allow-rdp       0.0.0.0/0   tcp:3389
default-allow-ssh       0.0.0.0/0   tcp:22

The driver already injects a windows-startup-script-ps1 that runs netsh advfirewall firewall add rule ... localport=5985, which makes this look handled — but that opens the guest firewall and cannot open the VPC. Without a rule of the user's own, the transport can never connect, and the only symptom is a silent hang.

3. email is required

Already true and already validated, but worth stating alongside the other two.

Changes

  • README Windows section rewritten: a working example with a non-Administrator username and tags, an explanation of each requirement, and the gcloud compute firewall-rules create command, with a note to narrow --source-ranges.
  • validate! now warns when the WinRM transport is pointed at the built-in Administrator, so the user is told up front instead of after a timeout and an opaque auth error.

Verification

With username: kitchenadmin and a firewall rule for 5985, a full kitchen test on windows-2022 passes end to end for the first time:

Finished creating <windows-windows-2022> (5m48.76s).
Resetting the Windows password for user kitchenadmin on tk-windows-windows-2022-2b2885...
Password reset complete on tk-windows-windows-2022-2b2885.
...
Infra Phase complete, 2/3 resources updated in 12 seconds
  ✔  converge-happened: File C:\kitchen-google-validation\marker.txt
  ✔  winrm-transport: Command: `hostname`
Profile Summary: 2 successful controls, 0 control failures, 0 controls skipped
Finished testing <windows-windows-2022> (15m29.79s).

Note this run also needed #152, since every Windows image is 50 GB and the default boot disk is 10 GB.

🤖 Generated with Claude Code

Following the Windows example in the README produced a run that hung at
"Waiting for server to be ready" and then, once that was solved, died at
WinRM::WinRMAuthorizationError. Two separate causes, neither documented:

The built-in Administrator account is disabled on Google's Windows
images. The guest agent honours a password reset for it but does not
enable it, so the login is refused. Test Kitchen's WinRM transport
defaults `username` to `administrator`, and the README's example did not
override it, so the documented configuration could not authenticate.
Confirmed on windows-2022 by reading the account state out of the guest:

    admin-enabled: False

and by resetting the password for a different name, which the agent
creates, enables and adds to Administrators - that login succeeds
immediately.

Nothing in the default VPC allows TCP 5985. The `default-allow-*` rules
on an auto mode network cover SSH, RDP and ICMP only. The driver already
injects a `windows-startup-script-ps1` that opens 5985 in the guest
firewall, which makes this look handled, but a guest rule cannot open
the VPC. Without a rule of the user's own, the transport can never
connect.

Rewrite the README's Windows section to cover all three requirements
with a working example and the `gcloud` command for the firewall rule,
and warn from `validate!` when the WinRM transport is pointed at the
built-in Administrator, so the failure is explained up front instead of
after a timeout.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tas50
tas50 merged commit d318aeb into main Aug 23, 2026
8 checks passed
@tas50
tas50 deleted the fix/windows-winrm-requirements branch August 23, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant