Repository navigation
fix: document and warn about what WinRM actually needs - #154
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Administratordisabled. The guest agent honours a password reset for it but does not enable it, so the login is refused. Read out of the guest onwindows-2022:Test Kitchen's WinRM transport defaults
usernametoadministrator, and the README's example did not override it — so the documented configuration could not authenticate, and neither couldgcloud 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:
2. 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-ps1that runsnetsh 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.
emailis requiredAlready true and already validated, but worth stating alongside the other two.
Changes
usernameandtags, an explanation of each requirement, and thegcloud compute firewall-rules createcommand, 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: kitchenadminand a firewall rule for 5985, a fullkitchen testonwindows-2022passes end to end for the first time: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