3
votes

I am having problems reconstituting a Windows Server 2016 VM from a VHD.

I allocate a new Windows Server 2016 VM using unmanaged disks. After it is up and running, I load my software onto the VM. Then I test it. Finally I sysprep it (OOBE, generalize, shutdown).

Next, I convert the unmanaged disk from the VM to a managed disk (this may be an issue) to assign the VHD to a storage account that I can access with the Azure Storage Explorer tool to generate an SAS.

Then I reverse the process. I create a disk from the VHD, and a VM from the disk. The VM starts up fine but stops at the screen that says, "Hi there. Let's get some things out of the way.", where it wants me to provide the keyboard language and time zone. But I don't know how to connect to the VM to provide the answers.

1
After your sysprep it(after shutdown), you can capture a image from the source virtual machine setting panel in the portal. Then you can create a new VM from this image, refer to this.Nancy Xiong

1 Answers

0
votes

I have not found a way to get past that "Hi there" screen of death when the VM is running in Azure. The VM is not yet connected to network; one cannot RDP; serial console doesn't help much as well.

I have found a workaround to make a working copy of the VM using a fresh managed image. Yet it is not working perfectly, e.g. it refuses to execute stop/restart command from the Portal.

  1. Stop the VM
  2. Export it's managed OS disk to VHD.
  3. Mount VHD to Hyper-V VM.
  4. Get past the "Hi there" and finalize the Windows setup.
  5. Went through the checklist "Prepare a Windows VHD"
  6. Generalized the VM using sysprep.exe
  7. Push VHD to storage.
  8. Create new managed disk from the uploaded VHD.
  9. Create new managed VM image using OS disk from step 8 and original data disks (if any).
  10. Create new VM from the image. The provisioning failed in my case with message "Provisioning failed. OS Provisioning for VM 'VMNAME' did not finish in the allotted time.", yet the VM was running OK.

After that RDP to the new VM is working. Most of the installed soft seems to be functional as well.

I was using Dv3 VM to run Hyper-V in the Azure to reduce transfer cost and time.