help! How snapshots and inbreeding ruined my week.

This is for discussing general topics about how to use VirtualBox.
Post Reply
badwiz
Posts: 3
Joined: 16. Aug 2011, 23:41
Primary OS: MS Windows 7
VBox Version: OSE Debian
Guest OSses: Slackware Linux

help! How snapshots and inbreeding ruined my week.

Post by badwiz »

Please consider helping out my disfunctional virtualbox family of vdi files. Better then any The Hills Have Eyes horror story, I cloned a disk and had children with it. (needless to say we just call those children 'different'). Ok, ok, enough of the wise cracks, can you please help me sort out my family tree?



I have a linux guest on a windows 7 host. When I start the VM, it loads a snapshot I took 7 days ago. I don't want this, as 7 days of work are in the differencing images. The error I receive on trying to delete the snapshot is that:

Code: Select all

 Failed to delete the snapshot Snapshot 1 of the virtual machine slackware.

Hard disk 'H:\vm\slackware.vdi' has more than one child hard disk (3).

Result Code: E_FAIL (0x80004005)
Component: SessionMachine
Interface: IMachine {5eaa9319-62fc-4b0a-843c-0cb1940f8a91}
opening up my Virtual Disk Manager shows this:
Image
Children 1 and 3 are noted as "NOT ATTACHED", while child 2 is labeled as attached to "slackware" (does this reference the VM or VDI? they both have the same name unfortunately).
VDI "Clone of slackware" foreshadows things to come...

My Question(s):
Currently, when I boot the VM, all i get is the snapshot.
1) How can I remove this snapshot?
2) Alternatively, is it possible to create a copy of the VDI file that merges the difference images into the original VDI?
3) Lastly, if none of those are possible, is it possible to extract my work directly from the difference images + parent disk?
4) What steps would you recommend to create a backup of the current VDI, even broken as it is. (i.e. make copies of parent + children in their directories, to avoid any additional mistakes).
I just want my work by any means necessary and hope to cautiously proceed from here.
  • Here is an explanation of how I came to my current setup:
  • Created "slackware" and "slackware" vdi, installing (you guessed it) slackware 13.1 _64.
  • Ooooh this VM is AWESOME. Hey whats this "take a snapshot" button? Hit the "take a snapshot" button 7 days ago. (my downfall)
  • I let the VM run for a week, with no shutdowns etc, and putting in valuable amounts of work in the meantime.
  • Run out of disk space (really, 10GB. You thought that was enough?). So I shut down the machine.
  • Attempt to use "VBoxManage modifyhd slackware.vdi --resize=100gb to resize the hard drive. slackware.vdi is dynamically allocated.
  • --resize fails (neither slackware nor GParted recognize any new unpartitioned space).
  • Research the CloneVDI took by mpack to make a clone of slackware.vdi and resizing it in the process. Make "Clone of Slackware.vdi". This correctly resizes the disk. (slackware and GParted recognize new unpartitioned space).
  • remove slackware.vdi from my VM's SATA controller and connect "Clone of Slackware.vdi".
  • when I boot in I notice no new files are present. Here is when I finally notice that I am in the snapshot. (Note this is snapshot mistake #1)
  • I shutdown, remove "Clone of Slackware.vdi" and reconnect slackware.vdi to the virtual sata controller.
  • upon booting up, I realize I am still in the snapshot. (Note this is likely snapshot mistake #2)
This brings me to the current state of affairs: I have two VDI's present: "Clone of slackware.vdi" and slackware.vdi. They have both been, at separate times, attached to the same VM. Slackware.vdi currently has 3 child images. I assume 3 because it seems I get one each time I boot.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: help! How snapshots and inbreeding ruined my week.

Post by mpack »

I am ignoring your questions and giving you the solution instead.

1. Look in the <vm folder>/Snapshots subfolder, and identify the most recent snapshot file.
2. Clone that snapshot file using CloneVDI - do not repeat your previous mistake of cloning the base VDI.
3. Take the (now flattened) clone, rename it something sensible and build a NEW VM around it.
4. Consign your old VM to the dustbin of history.
5. Never use snapshots again.
badwiz
Posts: 3
Joined: 16. Aug 2011, 23:41
Primary OS: MS Windows 7
VBox Version: OSE Debian
Guest OSses: Slackware Linux

Re: help! How snapshots and inbreeding ruined my week.

Post by badwiz »

Thank you for the reply mpack,

following your directions. I used CloneVDI on the snapshot vdi file present in Snapshots/ directory:

Code: Select all

 Directory of C:\Users\cms\VirtualBox VMs\slackware\Snapshots

02/01/2012  11:11 AM    <DIR>          .
02/01/2012  11:11 AM    <DIR>          ..
01/24/2012  05:01 PM       151,560,800 2012-01-24T23-01-42-450662300Z.sav
02/01/2012  11:11 AM                 0 temp.txt
01/31/2012  06:30 PM        79,048,704 {1475be3c-9f91-49fc-884a-61c3a1a87418}.vdi
01/31/2012  07:19 PM           405,504 {21997a64-9bb4-4cba-a60f-457d38700108}.vdi
01/31/2012  06:10 PM     4,809,863,168 {49f50d25-fdcb-4918-b73d-a953a46300b7}.vdi
               5 File(s)  5,040,878,176 bytes
               2 Dir(s)  84,899,561,472 bytes free
Attempting to use CloneVDI on any of the above .vdi files results in an error:
Image
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: help! How snapshots and inbreeding ruined my week.

Post by mpack »

The error message means that not all needed files were present (*). It expects to find all snapshots in the "Snapshots" folder, and the base VDI in the parent folder. If that isn't true then copy all those files to a single folder and try again. Also you can try cloning earlier snapshots, since it's possible that links to the latest one were broken by the attempted merge.

(*) Needed files: the vdi file you select has a header inside which are UUID and ParentUUID fields. The latter is either 0 (meaning not a snapshot) or it's the UUID of the parent VDI. If CloneVDI sees that then it goes looking for the parent file with that UUID. If found then the same things happens again, terminating when it finds a VDI whose ParentUUID is 0 == the base VDI. If it can't find a match for a non-zero ParentUUID link then you get the error message.

ps. CloneVDI allows the source file to pass validation checks, even though you can't clone it, in order that the "Show Header" button will be available. This button allows you to see the ParentUUID field and check the chain of UUID connections yourself.
Post Reply