How to setup a VM to boot to last good known configuration (RDFE)


Symptom:

  • VM stuck in Reboot Loop. Often due to Failed Windows Updates.

Resolution:

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.

untitled-picture

4) Once the disk is attached ensure that the disk is flagged as ONLINE in the Disk Management console.

4

5) Before doing any changes create a copy of the folder \windows\system32\config incase rollback is needed

6) On the recovery machine, open up registry editor (regedit)

7) Click on ‘HKEY_USERS’ and select File -> Load Hive

 5

8) Browse up to the file \windows\system32\config\SYSTEM 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_USERS\BROKENSYSTEM\Select\Current                                           From 1 to 2
HKEY_USERS\BROKENSYSTEM\Select\Default                                            From 1 to 2
HKEY_USERS\BROKENSYSTEM\Select\Failed                                               From 0 to 1
HKEY_USERS\BROKENSYSTEM\Select\LastKnownGood                          From 2 to 3
HKEY_USERS\BROKENSYSTEM\ControlSet002\Control\CrashControl\Autoreboot            From 1 to 0

12) Select ‘HKEY_LOCAL_MACHINE\BROKENSYSTEM’ and go to File -> unload the hive from the menu

6 7

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

 untitled-picture1

17) Continue to recreate the VM with the same name and add it to the same cloud service as before.


Comments (0)

Skip to main content