Skip to content

GCESysprep - WinRM HTTPS Listener configuration on Windows 10 2004 silently fails #201

Description

@aaronfury

Overview

On a "vanilla" Windows 10 Enterprise 2004 image, the instance_setup.ps1 script fails to configure the HTTPS listener for WinRM. The script does not produce an error, but when the GCESysprep has completed, the HTTPS listener has not been created.

Steps to reproduce

  1. Prepare a VMware VM running Windows 10 Enterprise 2004
  2. Apply all available Windows Updates
  3. Install the Google Cloud SDK
  4. Import the VM using the GCE Import Image tool
  5. Use the image to create a VM on a sole-tenant node.
  6. Connect to the GCE VM and run GCESysprep (no command-line switches)
  7. Power on the VM after GCESysprep completes (or create an image and a new VM).
  8. Observe the Serial port 1 output to confirm that no errors are reported and the "Setup of WinRM complete." message is logged
  9. Connect to the instance via RDP (or non-HTTPS remote PowerShell) and run the following PowerShell command from an elevated prompt: Get-ChildItem -Path WSMan:\localhost\Listener
  10. Note that the HTTPS listener is not present.

Proposed workaround

Running 'winrm quickconfig' prior to configuring the listener resolves the issue.
I inserted the following commands at line 134 of instance_setup.ps1 and confirmed that the HTTPS listener is successfully created:

winrm quickconfig -quiet -force

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions