Repairing a corrupted VirtualBox VDI files from an unexpected restart or shutdown is easier than you think. Just follow the steps below.
1. Locate the drive where the corrupted VirtualBox VDI are stored.
2. Go to My Computer, click the target drive to select.
3. Right click the selected drive to open the context menu then choose Properties.
4. Go to Tools tab, under Error Checking, click Check now… button.
5. Check All options in Check disk options then press Start button.
6. If the drive is not currently being used by the system, the check disk will start right away.
6b. If the drive is being used by the system, you will be prompt by this dialog. You will be asked if you want to dismount the drive volume first. Press Cancel button.
7. Next you will be asked if you want to schedule disk check on the next time you start your computer. Choose Schedule disk check button. Then restart your pc to start the disk check.
8. After the disk check is done. Your corrupted VirtualBox VDI file should now be fixed. Try loading the Virtual Machine to test the result.