Cannot capture image of Azure VM [closed] Cannot capture image of Azure VM [closed] azure azure

Cannot capture image of Azure VM [closed]


Make one simple change to your workflow: during sysprep, choose to Quit instead of shutdown. This completes the sysprep process but then just exits the sysprep app.

tl;dr: run the following on the command line:

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

At this point, you can simply select your running VM in the portal and shut it down (which only takes a few moments). You can then view it, which will be shown as stopped (deallocated). At that point, create the image as described in the tutorial you pointed to. You'll give it a name (e.g. "my specialized image"), click the checkbox stating it's been sysprepped, and click Ok. Your image is created, your original vhd is removed (as now you have a generic version of it), the image is registered in your subscription as a choosable image in the gallery (this takes a few minutes), and you're done.

At this point, create a new image from gallery. View MY IMAGES - you'll see your brand new image listed (you may have to wait a minute or so before attempting this - it might not appear immediately in the list).

Now just give it a username and password, and you should be all set.

Note: If you're worried about losing your VM in this step (e.g. something goes wrong), you can always make a copy of your vhd first. You'll need to use PowerShell (or the cross-platform Node-based command line tool), both downloadable from the windowsazure.com downloads page. You can then copy the vhd to a brand new blob, which essentially makes a backup for you. Should something go wrong, you can either use the backed-up image as the basis for a new virtual machine (which won't be sysprepped yet), or make a copy of it (and so on). To do this, you'll need the url to the vhd, which is displayed in the Disks section of the Dashboard page of your running VM.