Crosslinked snapshot vdi file after clone.

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Anteaus
Posts: 19
Joined: 7. Sep 2012, 16:35

Crosslinked snapshot vdi file after clone.

Post by Anteaus »

errormsg.png
errormsg.png (45.35 KiB) Viewed 1492 times
Host: Debian 8.2
Client: Windows 7.1
Vbox: 5.0.12 r104815

I made a full unlinked clone of a working Windows 7.1 VM in order to do some software update checks. The original VM had three snapshots, the third of which was outside of the current state tree.

After cloning I tried to remove the snapshots from the clone, but found that whilst the two snapshots in the state tree were deletable, the one outside of the state tree was not. On closer examination it seems that this snapshot has NOT been cloned, instead it has been double-linked back to the same-named file in the original VM. In Media Manager, the UUID for this snapshot file shows both VMs as owners, and all options are grayed.

I don't actually need this snapshot, but I do need to find a way to get rid of it without damaging either VM. Nothing I can do in Media Manager or Virtualbox Manager will release the lock on the file. I've tried editing the .vbox for the new VM to remove the offending storage entry, but the system just keeps reinstating it. I could try renaming the vdi file itself to stop it being accessed, but I'm wary of causing a malfunction that way.

I'm thinking this must be a bug, since this doesn't seem to be logical behavior, or even a permissible situation. Question is, how to break the crosslink between these two VMs without damaging either?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Crosslinked snapshot vdi file after clone.

Post by mpack »

I see no evidence of a VirtualBox bug so far: if one existed then surely many more people would be reporting it. I suspect that you created a linked clone, or the disk is marked as immutable, something of that nature.

A clue is that a difference image which is stored outside of the snapshots tree is not a snapshot, it's just a difference image, meaning that it must be a linked clone, immutable disk etc.

If you just drop out to the command line and clone the base disk then you ought to be able to construct a new VM around the clone disk.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Crosslinked snapshot vdi file after clone.

Post by socratis »

How about if you attached the "vm71-32.vbox" file as a zipped attachment? Right-click on the VM and choose "Show in ... <whatever>". Zip it and attach it.

Also, could you post the output of the command "VBoxManage list hdds". That could give us a clearer picture of the structure of your VM.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Anteaus
Posts: 19
Joined: 7. Sep 2012, 16:35

Re: Crosslinked snapshot vdi file after clone.

Post by Anteaus »

Relevant sections of .vbox file:

Code: Select all

<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.14-linux">
  <Machine uuid="{eded814d-cab8-4348-a530-4a398456f429}" name="vm10-32" OSType="Windows10" stateFile="Snapshots/2016-01-01T21-46-24-944548000Z.sav" currentSnapshot="{820b9fa7-f07b-4d38-b761-60b5a0d546d4}" snapshotFolder="Snapshots" lastStateChange="2016-01-04T16:18:15Z">
      ...
      <HardDisks>
        <HardDisk uuid="{da5ce377-c489-4072-b524-dea30474fd27}" location="vm10-32.vdi" format="VDI" type="Normal">
          <HardDisk uuid="{e43f218f-53ad-4e9c-8e8c-2236ddb8946f}" location="Snapshots/{e43f218f-53ad-4e9c-8e8c-2236ddb8946f}.vdi" format="VDI">
            <HardDisk uuid="{b55aa2a2-bedd-4516-a823-43bfb85d5e54}" location="Snapshots/{b55aa2a2-bedd-4516-a823-43bfb85d5e54}.vdi" format="VDI"/>
          </HardDisk>
        </HardDisk>
      </HardDisks>
      ...
      <StorageControllers>
        <StorageController name="IDE Controller" type="ICH6" PortCount="2" useHostIOCache="true" Bootable="true">
          <AttachedDevice passthrough="false" type="DVD" port="0" device="0">
            <Image uuid="{ee299a37-878c-45b3-b939-eec4cc422a2c}"/>
          </AttachedDevice>
          <AttachedDevice passthrough="false" type="DVD" port="1" device="0"/>
        </StorageController>
        <StorageController name="SATA Controller" 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="{4529765c-454a-4c91-9e4c-af0b95a5a970}"/>
          </AttachedDevice>
        </StorageController>
      </StorageControllers>
   ...
   <Snapshot uuid="{b79adb8d-49a1-40e9-96bb-9f97404ff0f9}" name="Fully Configured" timeStamp="2014-11-10T10:52:57Z" stateFile="Snapshots/2014-11-10T11-50-36-180444000Z.sav/Snapshots/2014-11-10T11-48-16-178764000Z.sav/Snapshots/2014-11-10T10-52-57-098854000Z.sav">
      <Snapshots>
        <Snapshot uuid="{c73e96a0-8653-4b2f-8e0b-5bee3acdc70c}" name="Pre JOS" timeStamp="2014-11-18T19:57:47Z" stateFile="Snapshots/2014-11-18T19-57-47-603869000Z.sav">
        ...
        <StorageControllers>
            <StorageController name="IDE Controller" type="ICH6" PortCount="2" useHostIOCache="true" Bootable="true">
              <AttachedDevice passthrough="false" type="DVD" port="0" device="0">
                <Image uuid="{ee299a37-878c-45b3-b939-eec4cc422a2c}"/>
              </AttachedDevice>
              <AttachedDevice passthrough="false" type="DVD" port="1" device="0"/>
            </StorageController>
            <StorageController name="SATA Controller" type="AHCI" PortCount="1" useHostIOCache="false" Bootable="true" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3">
              <AttachedDevice type="HardDisk" port="0" device="0">
*** BUG ***     <Image uuid="{58cfffe4-91d2-42ee-9ca0-10f9806e1b60}"/>
              </AttachedDevice>
            </StorageController>
          </StorageControllers>
        ...
        </Snapshot>
        <Snapshot uuid="{820b9fa7-f07b-4d38-b761-60b5a0d546d4}" name="Windows 10" timeStamp="2016-01-01T19:16:01Z" stateFile="Snapshots/2016-01-01T19-16-01-865932000Z.sav">
        </Snapshot>
      </Snapshots>
   </Snapshot>
   ...
 </Machine>    
</VirtualBox>   
Disks used in each VM:

Code: Select all

Win7-32 disks: 

UUID:           ff8c74b9-bcd3-4ac8-8a4e-e1961d2f6684
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       /data/vm/vm71-32/vm71-32.vdi
Storage format: VDI
Capacity:       103931 MBytes
Encryption:     disabled

UUID:           4529765c-454a-4c91-9e4c-af0b95a5a970
Parent UUID:    ff8c74b9-bcd3-4ac8-8a4e-e1961d2f6684
State:          created
Type:           normal (differencing)
Location:       /data/vm/vm71-32/Snapshots/{4529765c-454a-4c91-9e4c-af0b95a5a970}.vdi
Storage format: VDI
Capacity:       103931 MBytes
Encryption:     disabled

UUID:           58cfffe4-91d2-42ee-9ca0-10f9806e1b60
Parent UUID:    4529765c-454a-4c91-9e4c-af0b95a5a970
State:          created
Type:           normal (differencing)
Location:       /data/vm/vm71-32/Snapshots/{58cfffe4-91d2-42ee-9ca0-10f9806e1b60}.vdi
Storage format: VDI
Capacity:       103931 MBytes
Encryption:     disabled

UUID:           0ec155df-d151-497f-afc8-6884db9d74ec
Parent UUID:    4529765c-454a-4c91-9e4c-af0b95a5a970
State:          created
Type:           normal (differencing)
Location:       /data/vm/vm71-32/Snapshots/{0ec155df-d151-497f-afc8-6884db9d74ec}.vdi
Storage format: VDI
Capacity:       103931 MBytes
Encryption:     disabled

-------------------------

Win10-32 disks:

UUID:           da5ce377-c489-4072-b524-dea30474fd27
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       /data/vm/vm10-32/vm10-32.vdi
Storage format: VDI
Capacity:       103931 MBytes
Encryption:     disabled

UUID:           e43f218f-53ad-4e9c-8e8c-2236ddb8946f
Parent UUID:    da5ce377-c489-4072-b524-dea30474fd27
State:          created
Type:           normal (differencing)
Location:       /data/vm/vm10-32/Snapshots/{e43f218f-53ad-4e9c-8e8c-2236ddb8946f}.vdi
Storage format: VDI
Capacity:       103931 MBytes
Encryption:     disabled

UUID:           b55aa2a2-bedd-4516-a823-43bfb85d5e54
Parent UUID:    e43f218f-53ad-4e9c-8e8c-2236ddb8946f
State:          created
Type:           normal (differencing)
Location:       /data/vm/vm10-32/Snapshots/{b55aa2a2-bedd-4516-a823-43bfb85d5e54}.vdi
Storage format: VDI
Capacity:       103931 MBytes
Encryption:     disabled
I think you will see that the problem is with snapshot b79adb8d... in the Win10 VM, which contains a crosslink to a virtual disk in the Win7 VM, 58cfffe4...
I don't see how anything I have done could/should have created this situation; all the vdisks are of the standard type, and even if I'd inadvertently created a linked clone then it's hard to see why ONE snapshot should be crosslinked, but no others. The Win10 VM correctly lists da5ce... as its base disk, and this is NOT crosslinked.

When I get time I'll see if I can replicate the issue with a smaller virtual machine.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Crosslinked snapshot vdi file after clone.

Post by mpack »

If you can put together a sequence which reproduces this problem (I see the important features as being two HD controllers, N snapshots, then full clone) then I'm sure the devs would be pleased if you raised a bugtracker ticket for it.

Tips: when calling something a snapshot be clearer that you're referring to a branch in one of the VBox files, and not one of the snapshot files you've given hdinfo for immediately above that sentence. Also, clarify what "the third of which was outside of the current state tree" means. AFAIK a snapshot can't be outside the tree, but it can be on a different branch - the latter is what I assume you mean.
Anteaus
Posts: 19
Joined: 7. Sep 2012, 16:35

Re: Crosslinked snapshot vdi file after clone.

Post by Anteaus »

Current state of testing is that I've created a small VM with similar hardware and a variety of snapshots. It clones perfectly every time, so I cannot duplicate the issue that way.

Also cloned the original Windows 7 VM again and the new clone shows the same problem, a crosslinked snapshot file. I can only imagine it's something fairly specific in the original VM that's triggering the problem, though at the moment I'm not sure what.

I tried a to repair the new clone's .vbox file by deleting the AttachedDevice containing the 58cfffe... UUID reference whilst vboxdrv was stopped. This seemed to cure the problem in that I could then delete the offending snapshot. However, I cannot merge the other in-branch snapshots because any attempt fails with reference to another UUID item being missing, this time one which doesn't seem to be listed anywhere in Media Manager. Think the only way out of this is to mount a new virtual disk and the offending one on Knoppix, and do a partition copy.
Anteaus
Posts: 19
Joined: 7. Sep 2012, 16:35

Re: Crosslinked snapshot vdi file after clone.

Post by Anteaus »

Few days back, found some corruption on the server volume hosting these VMs so decided to take no chances and downed the server till I could get a replacement disk. Back online today. fsck didn't find any issues in this particular VM, but it might be that the problem was created by the disk, which I think is failing. If so, apologies for red herring. :wink:
Post Reply