- VM stuck in Reboot Loop. Often due to Failed Windows Updates.
1) Delete the isolated VM, keeping the disks associated with it.
2) Wait for the disk lease to expire. (About 3 mins)
3) Attach the OS disk of the broken VM to a recovery VM located in the same Region and Cloud Service.
4) Once the disk is attached ensure that the disk is flagged as ONLINE in the Disk Management console.
5) Before doing any changes create a copy of the folder windowssystem32config incase rollback is needed
6) On the recovery machine, open up registry editor (regedit)
7) Click on ‘HKEY_USERS’ and select File -> Load Hive
8) Browse up to the file windowssystem32configSYSTEM of the attached affected VMs OS Disk. Most likely this will be Drive E: or F:
9) When opening it will ask for a name, put ‘BROKENSYSTEM’ and select okay
10) Unfold HKEY_USERS and there will be a folder called ‘BROKENSYSTEM’
11) In there, make the following changes:
HKEY_USERSBROKENSYSTEMSelectCurrent From 1 to 2
HKEY_USERSBROKENSYSTEMSelectDefault From 1 to 2
HKEY_USERSBROKENSYSTEMSelectFailed From 0 to 1
HKEY_USERSBROKENSYSTEMSelectLastKnownGood From 2 to 3
HKEY_USERSBROKENSYSTEMControlSet002ControlCrashControlAutoreboot From 1 to 0
12) Select ‘HKEY_LOCAL_MACHINEBROKENSYSTEM’ and go to File -> unload the hive from the menu
13) Remove the disk from the troubleshooting VM
14) Recreate the machine using the now restored OS disk
15) Navigate to OS Disks (Classic) in the Azure Portal
16) Select the now fixed OS disk and select Create VM
17) Continue to recreate the VM with the same name and add it to the same cloud service as before.