Edit

Share via


Fix registry hive corruption in an Azure VM running Windows

Applies to: ✔️ Windows VMs

This article shows how to fix registry hive corruption in an Azure virtual machine (VM) running Windows.

How to fix registry hive corruption

Fix the corrupted hive by following these steps:

  1. Delete the VM.

    Important

    When you're prompted to confirm the VM deletion, make sure that you clear the Delete with VM option that's associated with the OS disk resource type.

  2. Attach the OS disk as a data disk to another VM (a troubleshooting VM). For more information, see Attach a managed data disk to a Windows VM by using the Azure portal.

  3. Connect to the troubleshooting VM.

  4. Select Start, and then search for and select Computer management. In the console tree of the Computer Management app, select Disk management. Make sure that the OS disk is online and that its partitions have drive letters assigned.

  5. On the OS disk that you attached, navigate to the \Windows\System32\config folder. Copy all the files to a backup folder in case a rollback is required.

  6. Select Start, and then search for and select Registry Editor (regedit.exe).

  7. In the Registry Editor app, select the HKEY_USERS subtree, select File > Load Hive on the menu, and then load the \Windows\System32\config\SYSTEM file.

  8. If the hive loads without issues, this means that the hive wasn't closed correctly. In this situation, unload the hive to unlock the file and fix the issue.

    Note

    If you receive the following error message, contact Azure Support:

    Cannot load <drive>:\Windows\System32\config\SYSTEM: Error while loading hive

  9. Detach the repaired OS disk from the troubleshooting VM. Then, create a new VM from the OS disk.

Contact us for help

If you have questions or need help, create a support request, or ask Azure community support. You can also submit product feedback to Azure feedback community.