accidentally "released" my snapshot

Discussions related to using VirtualBox on Linux hosts.
Post Reply
smaring
Posts: 12
Joined: 29. Sep 2009, 15:01
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

accidentally "released" my snapshot

Post by smaring »

I was running out of hard drive space and playing around with copying my base VDI file before I learned anything about the clonehd command.

Long story short, I "released" my single snapshot in the Virtual Media Manager GUI before I really knew what I was doing. My base VDI is 5GB and my snapshot is 18GB. So, I had a great many changes in there, including a lot of important financial information.

In the Virtual Media Manager I see my snapshot hanging off my base, but the snapshot says that it is "not attached"

When I go to start up my VM, a WinXP OS, the VM says ... "FATAL: Could not read from the boot medium! System halted"

Is there a way I can re-attach my snapshot and get my VM working properly again?

And THEN I can merge the snapshot and do the proper clonehd I intended to do.

Thanks,
Steve Maring

Code: Select all

<?xml version="1.0"?>
<!-- Automatically converted from version '1.6-linux' -->
<!-- Automatically converted from version '1.5-linux' -->
<!-- Automatically converted from version '1.4-linux' -->
<!-- Automatically converted from version '1.3-linux' -->
<!-- Sun xVM VirtualBox Global Configuration -->
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.7-linux">
  <Global>
    <ExtraData>
      <ExtraDataItem name="GUI/LicenseAgreed" value="7"/>
      <ExtraDataItem name="GUI/UpdateCheckCount" value="156"/>
      <ExtraDataItem name="GUI/UpdateDate" value="1 d, 2009-11-05"/>
      <ExtraDataItem name="GUI/RegistrationData" value="005300740065007600650020004d006100720069006e0067007c00730074006500760065002e006d006100720069006e006700400067006d00610069006c002e0063006f006d007c006e006f000000003ce5d952"/>
      <ExtraDataItem name="GUI/LastWindowPostion" value="269,99,770,550"/>
      <ExtraDataItem name="GUI/LastVMSelected" value="b892bbd4-2e63-4f55-a170-2e717e9f0ef2"/>
      <ExtraDataItem name="GUI/SuppressMessages" value=",remindAboutAutoCapture,remindAboutMouseIntegrationOn,remindAboutMouseIntegrationOff,confirmGoingFullscreen,confirmInputCapture"/>
      <ExtraDataItem name="GUI/SUNOnlineData" value="triesLeft=0"/>
    </ExtraData>
    <MachineRegistry>
      <MachineEntry uuid="{b892bbd4-2e63-4f55-a170-2e717e9f0ef2}" src="Machines/winxp/winxp.xml"/>
    </MachineRegistry>
    <MediaRegistry>
      <HardDisks>
        <HardDisk uuid="{493cc110-c1f5-4b45-9f24-3c3d5cda3354}" location="/data/vm/winxp.vdi" format="VDI" type="Normal">
          <HardDisk uuid="{ec9b4369-edcb-4b5d-8ae3-4abae6e7f9f0}" location="Machines/winxp/Snapshots/{ec9b4369-edcb-4b5d-8ae3-4abae6e7f9f0}.vdi" format="VDI"/>
        </HardDisk>
      </HardDisks>
      <DVDImages>
        <Image uuid="{c89538ed-961b-498d-ac4e-a3c7e1190f4c}" location="/usr/share/virtualbox/VBoxGuestAdditions.iso"/>
      </DVDImages>
      <FloppyImages/>
    </MediaRegistry>
    <NetserviceRegistry>
      <DHCPServers>
        <DHCPServer networkName="HostInterfaceNetworking-vboxnet0" IPAddress="192.168.56.2" networkMask="255.255.255.0" lowerIP="192.168.56.3" upperIP="192.168.56.255" enabled="1"/>
      </DHCPServers>
    </NetserviceRegistry>
    <USBDeviceFilters/>
    <SystemProperties defaultMachineFolder="Machines" defaultHardDiskFolder="HardDisks" defaultHardDiskFormat="VDI" remoteDisplayAuthLibrary="VRDPAuth" webServiceAuthLibrary="VRDPAuth" LogHistoryCount="3"/>
  </Global>
</VirtualBox>
MarkCranness
Volunteer
Posts: 875
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows Server 2008 R2; Ubuntu 11.04; Windows 2000 Server; Windows XP

Re: accidentally "released" my snapshot

Post by MarkCranness »

Backup/copy all of your XML files: VirtualBox.xml + machine.xml (in case), and:

(select VM)>Settings>Hard Disks>'Show Differencing Disks' check ON>Change the selection for your 'winxp.vdi' in the dropdown (or the Slot that WAS 'winxp.vdi', or re-Add a new slot...) to be the {hexUUID}.vdi that is currently "Not attached".
(Hopefully there is not a blue star icon to the left of that file: If there is, then probably that's OK also.)

If that gets it back, then I would probably directly clone the 'snapshot' to a new flattened VDI: Cloning a VM with multiple snapshots

You might instead (after backing the VDIs up!) 'merge' the snapshot by using the 'Discard Snapshot' button.
(DO NOT use the 'Discard Current Snapshot and State' button, and do not be worried when VirtualBox says that it is: 'Discarding hard disk (Your Main Disk)'. It is not actually discarding your disk, it is actually Updating it...)
smaring
Posts: 12
Joined: 29. Sep 2009, 15:01
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Re: accidentally "released" my snapshot

Post by smaring »

The merge (discard snapshot) from the GUI didn't seem to improve the situation any.

However, I cloned the original snapshot and it did seem to create (based on the size) a flattened VDI of the snapshot merged back into the base. I created a new WinXP VM and it booted up the cloned snapshot without so much as a hiccup! WOW ... what a relief!

I've lost no less than 5 VMs to VMWare in the past and spent about 10 hours trying to recover each. My opinion that VirtualBox is a better product has just been reaffirmed!!!! :D :D :D

Cheers,
Steve Maring
MarkCranness
Volunteer
Posts: 875
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows Server 2008 R2; Ubuntu 11.04; Windows 2000 Server; Windows XP

Re: accidentally "released" my snapshot

Post by MarkCranness »

I'm glad it worked out.

Make sure that the clone includes the changes that were been made since you made the snapshot (if there were any, and assuming you want those changes): I should have said 'clonehd the Current State' according to my link.
Valea
Posts: 1
Joined: 11. Jun 2015, 19:47

Re: accidentally "released" my snapshot

Post by Valea »

I also accidentily "released" my current snapshot.

The snapshot was still visible in the Media Manager, with it's dependancy. And the vdi file for that snapshot was still in myVM/Snapshots folder. All the data was there and I guessed I had only modified a configuration file when "releasing" the snapshot.

I opened myVM.vbox xml file. At the begining of the file, I found the <HardDisks> xml element which contained all the information about the disks and snapshots dependancies for the myVM. I just copied the hex-uuid of the detached snapshot.

At the end of the file, I looked at the <StorageControllers> element. There, I could see that the <StorageController> element for my virtual SATA controller was empty (self closing element). All I had to do is modify this element, adding the expected xml description of the detached snapshot. I had a look at a "working" VM .vbox file to check the syntax.

For those who are not fluent in XML here is the content of the bottom section of the file, before (not working, detached) and after (repaired, re-attached).

Not working

Code: Select all

  <StorageController name="Contrôleur SATA" type="AHCI" PortCount="1" useHostIOCache="false" Bootable="true" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3"/>
Repaired

Code: Select all

      <StorageController name="Contrôleur SATA" type="AHCI" PortCount="1" useHostIOCache="false" Bootable="true" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3">
        <AttachedDevice type="HardDisk" port="0" device="0">
          <Image uuid="{XXXXXXXXXXXXXXX}"/>
        </AttachedDevice>
      </StorageController>
Of course, replace "XXXXXXX" by the hex-uuid of your snapshot, the one you got at the begining of the file (or through media manager interface). Have a look at the .vbox file of a working VM, on your system, since the added definitions may differ.

I saved myVM.box file, launched VirtualBox, checked in the myVM storage settings that the snapshot was back, and just started the VM.

I hope it can help.

Valea.
Post Reply