Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to repair a corrupt VDI file? The OS on the VDI (XP) doesn't boot at all, it just hangs at a black screen. I was getting file errors before on its last boot, but now its not working at all.

Sector viewer shows 'Invalid partition table Error loading operating system Missing operating system'. I tried mounting the file from the host OS, but it just says that the drive isn't formatted. I don't need to be able to run the VDI, but I do need some files that are on it.

Is there any way to recover files from the corrupt VDI file?

share|improve this question
last time you ran the VM was it shut down correctly? – madmaze Jan 21 '11 at 20:09
prolly not, I think it had a power out shutdown – Eric P Jan 21 '11 at 20:31
Can you boot it with an ISO then either repair the OS installation or retrieve your files? – Cheeto Jan 21 '11 at 21:44
up vote 11 down vote accepted

Most of the time a crash while running a VM with VirtualBox will corrupt the profile, not the VDI.

Try making a fresh profile and add the existing VDI as the disk. You could also try a scandisk on the host system if you haven't.

share|improve this answer
Can confirm this worked for me. Created a new VM using the same VDI. Up and running again. – user727382 Feb 4 '12 at 5:23
Well I'll be damned this actually worked. – Tek Aug 6 '14 at 19:52
This worked for my. I kept getting "read only" errors when trying to boot my VM. After several attempts, I switched it off and created a new VM with the troublesome VDI image. I was able to boot up! Then I shut down cleanly, and rebooted the broken VM - everything worked again!!! – Eamorr Feb 20 '15 at 19:23
In my case, I just removed the problematic VHD disk and then added it again. Worked. Runned scandisk and other tools just for sure. – EMBarbosa Oct 26 '15 at 13:39

In my case the VDI crashed within a new profile too.

Do the following steps to rescue data:

  1. create a new profile with your .vdi to rescue as a harddisk
  2. download a linux live CD (like puppy, xubunu...) and add it as a live-cd image to the new profile
  3. start the VM
  4. mount the .vdi file (in my case it was sda2) and rescue your files as you like (send them as email to yourself)

have fun

share|improve this answer
Could you explain this in more detail please? I would really appreciate it. – picxelplay Apr 5 '12 at 10:04
He "plugged" the VDI hard drive into a Linux OS and copied all the files he would still need. Then he setup a fresh new Windows XP installation and copied the files he had just rescued before. – Peter Wippermann Feb 2 at 8:16

mounting the drive somehow to retrieve your files would be your best option. I don't know of any repair solutions for a VDI file, but I did stumble across this:

share|improve this answer
I have also seen this to be a "false alarm!" Quite recently, VirtualBox ominously told me that the main-hard-drive VDI file of a Linux VM was "unavailable," and yet the VM subsequently booted just fine. There was, in fact, nothing wrong with the disk at all. – Mike Robinson Mar 14 at 14:47

You must log in to answer this question.

protected by Daniel Beck May 21 '13 at 18:19

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged .