Bring a Windows Server’s disk back to life with these two commands
If you have the misfortune of having to troubleshoot and repair boot issues on a virtual machine after a physical host crash, these two commands might help you.
First of all, try to get into the advanced settings on boot (it should be the F11 key), or after a while Windows (Server or 10/11) might automatically go into the menu when it cannot boot from disk. Alternatively a Windows ISO image can be used.
Once in the advanced settings, run the good old checkdisk command:
chkdsk /f C:
After completion, restart the VM and check if you are able to boot. If the issue persists, try restoring the registry database (once again through the advanced settings or a Windows ISO). A scheduled task regularly backs up the registry and puts it the folder C:\Windows\System32\config\Regbak.
copy C:\windows\system32\config\RegBack\* C:\windows\system32\config
Restart the VM and check if you are able to boot into Windows. If you still have issues, you should consider restoring from a backup (it sucks but sometimes it is unavoidable).