"Validating connection to vm..." step fails during stembuild construct for Stembuild v2019.15
search cancel

"Validating connection to vm..." step fails during stembuild construct for Stembuild v2019.15

book

Article ID: 297869

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

When running stembuild v2019.15 (this is not known to occur on other versions of stembuild), you may see an error looking like the following when running stembuild construct:
Validating connection to vm...

Could not prepare VM: Cannot complete login due to an incorrect VM user name or password: failed to create winrm shell: http response error: 401 - invalid content type

This is due to stembuild trying to validate your VM credentials prior to enabling WinRM. You can confirm that this is the case by running the following:
winrm get winrm/config

Confirm that "AllowUnencrypted = false" and/or "Auth: Basic = false" under Service.

Environment

OS: Windows Server 2019

Resolution

To resolve this, log into the VM and run the following commands:
winrm set winrm/config/service/auth @{Basic="true"}

winrm set winrm/config/service @{AllowUnencrypted="true"}

powershell

Enable-NetFirewallRule -DisplayName "Windows Remote Management (HTTP-In)"

netsh firewall add portopening TCP 5985 "Port 5985"

You can confirm these commands had the intended effects by once again running the following:
winrm get winrm/config

Confirm that "AllowUnencrypted = true" and "Auth: Basic = true" under Service. It should not matter whether these are set as true under Client. You can confirm that the firewall rules were configured properly by running:
Get-NetFirewallRule -DisplayName "Windows Remote Management (HTTP-In)"

Finally, restart the VM and run stembuild construct against it.