Recently I wanted to share a VirtualBox Appliance with a colleague. So I tried to export the created appliance. Unfortunate this failed with a:
VBoxManage.exe: error: Code VBOX_E_FILE_ERROR (0x80BB0004) – File not accessible or erroneous file contents (extended info not available)
So I thought why not just copy it… Oh wait, first compact it to save some space and time using
VBoxManage modifyvdi some.vdi compact:
>VBoxManage modifyvdi Windows7.vdi compact 0%...10%...20%...30%...40%...50%...60%...70%...80%... Progress state: VBOX_E_FILE_ERROR VBoxManage.exe: error: Code VBOX_E_FILE_ERROR (0x80BB0004) - File not accessible or erroneous file contents (extended info not available)
When I tried to copy or zip the file there were errors accessing it. Somehow the VirtualBox Appliance was still running fine. The files that make up the appliance weren’t locked.
My laptop (the host of the appliance) is is running Windows7 and I decide to run
chkdsk and found:
CHKDSK controleert de bestandsgegevens (stap 4 van 5)... Leesfout met status 0xc0000185 op offset 0x17410c9000 voor 0x10000 bytes. Leesfout met status 0xc0000185 op offset 0x17410d6000 voor 0x1000 bytes. Er zijn beschadigde clusters in bestand 37907 met naam \Users\ppvdbeek\VIRTUA~2\Windows7\Windows7.vdi vervangen.
This is Dutch stating that there were bad sectors in the vdi file that had to be corrected. After that, I could run the appliance, compact the disk and export the appliance successful.
On Linux you could use fsck (for “file system check”) in a similar case.