Error loading operating system

After a restore a virtual machine failed to start, the screen remained black and the following error was displayed: “Error loading operating system

Error_loading_Operating_System

All standard solutions like “chkdsk /r”, “chkdsk /p”, fixmbr, fixboot,… did not work.

After some deeper research I noticed that there may be a problem with the disk geometry of the virtual disk. I guess that this occured when we aligned a lot of virtual machines some times ago or something happend during the restore.

Fortunately I found a tool that helped to clean up the mess and made the virtual machine bootable.

Solution:

  • Attach the broken boot disk (vmdk) to another virtual machine
  • download the tool “Testdisk
  • unzip the tool and start testdisk_win.exe on the virtual machine you use for repair

Select “No Log”:
testdisk1

Select the disk you want to repair:
testdisk2

Select “Intel/PC partition”:
testdisk3

Now select “MBR Code – Write TestDisk MBR code to first sector”:

testdisk4

  • confirm “Write a new copy of MBR code to first sector” with y (yes)
  • confirm “Write a new copy of MBR code, confirm” with y (yes)

Select OK after the new copy of MBR code has been written successfully.

Now select “Advanced – Filesystem Utils”:

testdisk5

In the next window select “Boot”:

testdisk6

If there are mismatches or problems you will get a view like this:

testdisk7

to solve this, select “Rebuild BS”

  • when the rebuild was successfull, leave the tool using “quit” till all windows are closed
  • unattach the virtual disk from the virtual machine
  • power on your broken Virtual machine – it should now boot without any problems!

Error loading operating system