Windows doesn't start. Instead, the system generates the following error:
Info: The operating system could not be loaded because the system registry file is missing or contains errors.
This issue occurs because either the hive is corrupted or it is not closed correctly.
How to fix
To fix the issue, follow these steps.
Repair the corrupted hive
- Delete the virtual machine (VM). Make sure that you select the Keep the disks option when you do this.
- Attach the OS disk as a data disk to another VM (a troubleshooting VM). For more information, see How to attach a data disk to a Windows VM in the Azure portal.
- Connect to the troubleshooting VM. Open Computer management > Disk management. Make sure that the OS disk is online and that its partitions have drive letters assigned.
- On the OS disk you attached, navigate to \windows\system32\config. Copy all the files as a backup in case a rollback is required.
- On the OS disk you attached, copy the files in \windows\system32\config\regback and replace the files in \windows\system32\config.
- Detach the repaired OS disk from the troubleshooting VM. Then, create a new VM from the OS disk.