Share via


Can't RDP to VM after running sysprep

Question

Thursday, December 11, 2014 9:27 AM

I have lost quite a bit of time and money on this issue which Microsoft are pretty aware of for a number of years and haven't fixed yet.

If I create a Windows Server 2008 R2 VM and run sysprep (part of the VM image capture process) on it, i will not be able to RDP to it afterwards.

Following the official Microsoft instructions on how to capture a VM image you have to run sysprep. There are a couple of options on the sysprep Shutdown options.

Any of these options will end up with the same result, I have tried all three options.

So, from my experience and looking at the many posts in the forums and on Google, I need to go back to my boss and un-sell the whole Azure offering?

All replies (2)

Thursday, December 11, 2014 11:46 AM âś…Answered

Hi,

Note that you must always remember to shutdown the VM from the portal before you capture the VM. If you restart the VM before capturing, it will not be in the correct state when captured and VMs created from the image will end up in provisioning timeout.

When capturing an image, the guest needs to remain shutdown for it to be captured in the correct state. If you capture a VM that has been started after sysprep has been run, the guest OS is not in the correct state. The capture operation will succeed, but VMs created from the image will fail to provision successfully, and will ultimately show status Provisioning timed out. This is because the VM was captured when the setup state was IMAGE_STATE _UNDEPLOYABLE instead of the desired IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE (see also

http://technet.microsoft.com/en-us/library/cc721913(v=ws.10).aspx )

To workaround this issue, specify Quit instead of Shutdown when running sysprep, and once sysprep completes, shutdown the VM from the Shutdown option in the Windows Azure management portal instead of from within the RDP session.

  • Create a second user account that you add to the local Administrators group to use for troubleshooting if needed.
  • Run Sysprep, selecting Enter System Out-of-Box Experience (OOBE) and Generalize checked but select Quit instead of Shutdown.

  

 

Or from a command-line:

c:\windows\system32\sysprep\sysprep.exe /generalize /oobe /quit

  • Wait for the C:\Windows\System32\sysprep\Sysprep_succeeded.tag file to be created before doing anything else, as that indicates sysprep completed.

  • Log off from the VM, leaving it running. Do not shut it down from within the RDP session.
  • Click Shutdown for the VM in the Windows Azure management portal.
  • When the Status under Quick Glance on the Dashboard of the VM in the portal shows Stopped (Deallocated), then you can click Capture at the bottom to create the image.

Hope this helps !

Regards,

Sowmya


Friday, December 12, 2014 8:49 AM

Hi Tony,

Firstly, would you please answer the questions below so that I can better analyze your scenario and test on my VMs?

Since you could not RDP into the VM, are you talking about the orginal VM or the new VM created from the captured image?

If you captured the VM, what is the status of the VM when you captured an image? Did you choose "I have run Sysprep on the virtual machine" when you capture the VM? (If you select this option, the original VM would be deleted.)

I ran sysprep on my VM with the shutdown option, then the VM is in the stopped status. After that, I restarted it and could not RDP into it.

Best regards,

Susie

Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected].