Windows VM get stuck at OOBE Sysprep screen in Azure Cloud

Credit goes to Richard Podd for finding the solution for this – Thanks Rich!

Summary

Windows VM get stuck at OOBE Sysprep screen in Azure. Boot diagnostics would just show the logon screen as if the OOBE sysprep was successful, RDP would connect but authentication won’t work.

Environment

  • Windows 10
  • Hyper-V for building the VHD on premise
  • Microsoft Azure

Scenario and Steps Taken

On On-Premise Hyper-V server

Convert the VM from VMDK to VHD – All OK
Prepare image for upload to Azure: Preperation Steps and Sysprep showed all OK with no errors in Sysprep logs.

On Microsoft Azure

Convert uploaded VHD to image in Azure – All OK
Deploy managed Disk VM from VHD Image in Azure – All OK
Create Managed Disk image from Managed Disk VM in Azure – All OK
Deploy Managed Disk VM from Manage Disk Image in Azure: This is where we had issues, Boot Diagnostics Data would just show the logon screen as if the OOBE Sysprep was successful, RDP would connect but authentication won’t work. This was tested with a domain joined image and without domain joining.
Reviewing the logs on the failed deployed VMs would show no errors, as would the Sysprep logs.

Troubleshooting

If we downloaded the image as a VHD to On-Premise Hyper-V server and booted the VM; OOBE would go through, then at the point where you are asked to create a new user to log in to the machine you would be met with the error ‘an error has occurred’, however clicking ‘Next’ again would go to the next step.

From this we assumed that the creation of the user account was failing for some reason.

The Solution

What worked for us was to clear our AppX packages from the local admin account as well as the logged on user.

  • If you are logged on as local admin to the image:

  • For remote execution, put the above script in a Powershell file, and execute it remotely using psexec.exe

Windows VM get stuck at OOBE Sysprep screen in Azure Cloud
Tagged on:                     

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Amir Sayes

Subscribe now to keep reading and get access to the full archive.

Continue reading