0

I have a VM with two hard drives connected.

Using this setup I made 7 snapshots and wanted to delete the third one.

During the merge process VBoxSvc crashed leaving me with one (hopefully successfully) merged Hard Drive 2, one unmerged Hard Drive 1 and a VM, that is still listing the Snapshot as present.

  1. I can't delete the Snapshot again, because Hard Drive 2 is missing the related snapshot-vdi now.
  2. I can't use Hard Drive 2, because the VM think it needs the removed snapshot-vdi for that.

Is it possible, to merge Hard Drive 1 in the same way Hard Drive 2 was, then manually edit the .vbox file to remove the Snapshot from it and therefore complete the Snapshot-Removal process?

Screenshots: https://imgur.com/a/zmH6LSM

0

I think I solved the problem using the following procedure:

VM name:Workbench64
Complete Hard Drive with snapshot parts: HDD1
Already Merged Hard Drive without that particular snapshot part: HDD2

  1. I backed up the VM directory of Workbench64, in case of further damage
  2. I checked the broken snapshot in the VBox Gui to find the UUID of the missing vdi-part, by right clicking it and selecting "Snapshot details". In case an attached storage device is not accessible its UUID will be shown in bold. Mine was {5c95...}
  3. I closed the VBox Gui, so that it wouldn't override the Workbench64.vbox file.
  4. I moved the HDD2.vdi file out of the Workbench64 VM directory. (maybe unnecessary)
  5. I opened the Workbench64.vbox file in a text editor and searched for occurrences of {5c95...} (the entire UUID, obviously). The first occurrence is in the <HardDisks> section. It will look something like this:
    <HardDisk uuid="{5c95...}" location="Snapshots/{5c95...}.vdi" format="VDI">
    If there is a /> at the end, just delete that entire line. If there is no /> at the end, like in my example, delete the entire line and one </HardDisk> below (which one shouldn't matter, but to be extra sure, use the one that has the same level of indentation (spaces in front) as the line you deleted).

  6. The next occurrence should be in an <Image> tag similar to this:
    <AttachedDevice type="HardDisk" hotpluggable="false" port="0" device=0"> <Image uuid="{5c95...}" /> </AttachedDevice">
    Delete the <Image> tag and the surrounding <AttachedDevice>[...]</AttachedDevice> tag. Only of the UUID you are searching for, leave the other ones alone!) This will remove the missing snapshot vdi-part from the VM-Snapshot.

  7. Save the file and quit your text editor.
  8. Open the VBox Gui and check the details of the Snapshot in your VM again to see, if it is still complaining about a missing vdi-part. (It shouldn't.)
  9. Try deleting/merging the snapshot now. It should merge the vdi-part of (in my case) HDD1 into it and remove the Snapshot from the VM.

If everything worked out you now have HDD1 merged as well and a VM without the broken snapshot. Move HDD2.vdi back into the VM folder if you followed step 4 and it should boot into the latest state/snapshot you have on that VM.

I don't seem to have lost any data, since the Snapshot merge crashed in between the actual merging, so maybe I was just lucky.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.