How to scan and repair Windows virtual machine if its system files are corrupted

1589 users found this article helpful



Windows file system/registry corruption.


  1. Open Windows Start menu, in Search bar type cmd, right-click on the appeared Command Prompt application and choose Run as Administrator.

  2. In Command Prompt execute the command below:

    chkdsk /f /r
  3.  When asked to schedule checking disk, type y, and press "Enter" again. Reboot Windows and wait until the CHKDSK finishes to check disk and fix the detected errors.
  4.  Open Command Prompt again as Administrator and execute the following command:

    sfc /scannow 

  5. Wait for the scanning and the repairing processes to finish.

  6. There is a chance you might get the following message at the end of the scanning procesure:

        Windows Resource Protection found corrupt files but was unable to fix some of them. Details are included in the CBS.Log windir\Logs\CBS\CBS.log. For example C:\Windows\Logs\CBS\CBS.log. Note that logging is currently not supported in offline servicing scenarios

    It means that typical scanning/repairing utility is not enough to fix Windows files corruption, to be able to fix it, please do not close Command Prompt window and proceed with the instructions:

  7. In Command Prompt execute:

    DISM /Online /Cleanup-Image /RestoreHealth
  8. In case you have Windows installation media (CD/DVD disk or .iso image), please do the following:

  9. Make sure Windows is connected to the Internet.

  10. Insert CD/DVD or put .iso to the easiest Mac location to find.

  11. Actions > ....

  12. In Command Prompt execute:

    DISM /Online /Cleanup-Image /RestoreHealth
  13. Go to

    DISM /Online /Cleanup-Image /RestoreHealth /source:wim:D:\sources\install.wim:1 /limitaccess

    where D: is the Windows installation image mounted in a virtual drive.

    Wait until the operation is completed. This usually takes 20-30 minutes.

  14. Restart the virtual machine.

  15. If the situation did not change after the restart, the only thing left is to refresh Windows.

If Windows updates fail to install, the operating system repair method from the official Microsoft knowledge base may help.

Was this article helpful?

Tell us how we can improve it.