VM not usable after VirtualBox crash

This is for discussing general topics about how to use VirtualBox.
Post Reply
mrchip
Posts: 3
Joined: 1. Feb 2023, 02:02

VM not usable after VirtualBox crash

Post by mrchip »

Have a VirtualBox that just crashed. In the vm folder it has a 30GB vmdk file, 6kb .vbox-prev and a 0kb .vbox file. It also has a snapshot folder with a 60gb vmdk file and 3 .save files. I have copied over the files into a new vm folder and created a new machine pointing to used the hd of the 30gb vmdk file. I can't seem to get the snapshots to carry over. I thought maybe becuase It's a vmdk I could just rename the 60gb vm to the 30gb vm but that doesn't work. I then tried using clone vdi and for Source I chose the 60gb vmdk file but the program throws and error in Validation result: Source file corrupt - block map contains errors.

How do I get that 60gb snapshot over into the newly created VM? Thanks

If this helps, when I tried adding the 60gb vmdk file in virtual media manager it threw the following error if I did not firstly have the 30Gb vdmk file in there. If I do have the 30GB than I can add the 60gb which is appended under it but I cant seem to access the data in the 60gb file. Here's the error:
Result Code: E_FAIL (0x80004005)
Component: MediumWrap
Interface: IMedium {ad47ad09-787b-44ab-b343-a082a3f2dfb1}
Callee: IVirtualBox {d0a0163f-e254-4e5b-a1f2-011cf991c38d}
Callee RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)

EDIT**************
I have tried to create a new vdmk file from the large 60gb by running vboxmanage clonehd but that threw an error. Here is what I ran and the error:
E:\Program Files (x86)\oracle\virtualbox>vboxmanage clonehd "e:\VirtualBox VMs\myfile\myfile_s.vmdk" "e:\Virtualbox VMs\myfile\myfile_s-main1.vmdk"
0%...10%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Failed to clone medium
VBoxManage.exe: error: Could not create the clone medium 'E:\Virtualbox VMs\myfile\myfile_s-main1.vmdk' (VERR_EOF)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCloneMedium(struct HandlerArg *)" at line 1071 of file VBoxManageDisk.cpp
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VM not usable after VirtualBox crash

Post by mpack »

Split off from "CloneVDI Discussion" topic since the Q is not relevant to CloneVDI in any way. Title changed to reflect problem. Please create your own topics, do not hijack others topics.

Cloning the VM is not necessary. Just rename the xxx.vbox-prev file to be xxx.vbox. That's what the .vbox-prev is there for, i.e. a backup in case of disaster. I hope that the other thrashing around you describe didn't do any further damage, because snapshots are notoriously fragile.
mrchip
Posts: 3
Joined: 1. Feb 2023, 02:02

Re: VM not usable after VirtualBox crash

Post by mrchip »

mpack wrote:Split off from "CloneVDI Discussion" topic since the Q is not relevant to CloneVDI in any way. Title changed to reflect problem. Please create your own topics, do not hijack others topics.

Cloning the VM is not necessary. Just rename the xxx.vbox-prev file to be xxx.vbox. That's what the .vbox-prev is there for, i.e. a backup in case of disaster. I hope that the other thrashing around you describe didn't do any further damage, because snapshots are notoriously fragile.

My apologies. However I chose this thread because it was "CloneVID" that I noticed the error. I refer to the last sentence in my 1st paragraph "I then tried using clone vdi and for Source I chose the 60gb vmdk file but the program throws and error in Validation result: Source file corrupt - block map contains errors"

I am trying to resolve that issue but noticed other ppl requesting help in this thread generated requests for more information from those trying to help the original OP's questions. Mostly requiring more information explaining the problem and resolution steps. I though it might be helpful to provide the additional information, hence the other information on the steps I performed. Thought it would help anyone trying to help me not detract. Sorry

If it helps, kindly allow me to reiterate the original problem which is "clone vdi didnt work. Gave me an error of Source file corrupt - block map contains errors" I believe this fits within the confines of this thread. As to the thrashing...I have made backups before doing any work. I will attempt the fix and post the result so others who run into the problem will know how to fix/resolution. Will it be okay to post that back in here?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VM not usable after VirtualBox crash

Post by scottgus1 »

You apparently had two problems: the failed vmdk file and the 0kB .vbox file.

Mpack's info above shows how to recover the .vbox file by using the .vbox-prev file.

The error message from CloneVDI shows that the vmdk file may also not have survived the crash.

You can't add snapshot disk files from a VM folder to a new VM. Snapshots don't work that way, so there's no Virtualbox method that processes such a desire.

You can clone the final snapshot using CloneVDI to make a single new disk file that contains the final state of the VM in the snapshot chain, if the files in the chain are good. That the 30GB disk file errored out may mean that the only way for you to recover this VM is to restore from your VM or host backups.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VM not usable after VirtualBox crash

Post by mpack »

I see - I didn't appreciate that "I tried using clone vdi" (describing a generic action) was intended to be read as "I tried using CloneVDI" (the name of a specific tool).

I suspect that this VM is gone. If both the VMDK and the .vbox file were lost then obviously something catastrophic happened to the drive or the data. Snapshots are not stand alone, they are just fragments of a disk describing changes only. A list of "changes only" is useless without a readable base disk. Note however that any backup at all would include the base VMDK... though it's hard to imagine how this catastrophe would affect the .vbox and base VMDK and leave the rest of the VM files alone. Also note that the repair feature in CloneVDI only works on VDIs, the native VirtualBox format - it does not work for foreign formats, which are supported for reading only.
mrchip
Posts: 3
Joined: 1. Feb 2023, 02:02

Re: VM not usable after VirtualBox crash

Post by mrchip »

Good news...got it back! Thank you scottgus1 & mpack. I went a little to deep in my google searches & opened up pandoras box. For those in the same boat...my vm wouldn't start. I had the original vmdk and a snapshot with alot of data. I tried creating new VM's and attaching the vmdk which I had success with for the base (pre snapshot - which is missing a bunch of data). I was trying to append the snapshot into the base vmdk or attempt to run off the larger snapshot vmdk. All I had to do was copy the original folder that had my VM in it. Delete the Myvm.vbox file as it was corrupted at 0 bytes. Rename the Myvm.vbox-prev to Myvm.vbox. Then simply go into Virtualbox Manager/Machine/Add!

I was overthinking by creating a new vm and trying to merge. I hope it helps someone else or future me if I do it again. Thank you again. Sorry about posting to the wrong forum :?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VM not usable after VirtualBox crash

Post by mpack »

Well done, but I would suggest that you clone this VM to one with a single VDI (i.e. not VMDK, and no snapshots). Then regularly backup the entire VM folder to an external drive. That pretty much guarantees that no single disaster can cause your data to be lost. Of course safer still would be to keep the external drive offsite, but that makes it inconvenient to access.
Post Reply