Page 1 of 3
Snapshots unseen and cannot delete
Posted: 11. Sep 2017, 06:58
by chapeaurouge
Hi,
I am having an issue with a VM, which works fine (yet was moved around somewhat, but never used with different computers). For the story, I had done a snapshot prior to upgrading to win10 from a win7.
Now, I would like to delete the snapshot and thereby merge the 2 disks, which currently totals about a 100gb.
I am currently running 5.1.26, yet the VM has gone through all kind of 5.1.x I guess.
The problem is that, after recreating the VM and pointing it to the differencing disk (in order to boot from win10 and not win7), VirtualBox sees no snapshot at all.
The disks:
Code: Select all
$ VBoxManage list -l hdds
UUID: d7b56b52-4a3b-425a-85f1-cc0aa6803b29
Parent UUID: base
State: created
Type: normal (base)
Location: /home/fblaise/vms/virtualbox/FBI-corp-vm/VM14416.vdi
Storage format: VDI
Format variant: dynamic default
Capacity: 90000 MBytes
Size on disk: 51054 MBytes
Encryption: disabled
Child UUIDs: 9b85065f-248d-4530-832e-17cc73b4da5d
UUID: 9b85065f-248d-4530-832e-17cc73b4da5d
Parent UUID: d7b56b52-4a3b-425a-85f1-cc0aa6803b29
State: created
Type: normal (differencing)
Auto-Reset: off
Location: /home/fblaise/vms/virtualbox/FBI-corp-vm/Snapshots/{9b85065f-248d-4530-832e-17cc73b4da5d}.vdi
Storage format: VDI
Format variant: differencing default
Capacity: 90000 MBytes
Size on disk: 46895 MBytes
Encryption: disabled
In use by VMs: corpvm1 (UUID: 736c637c-c5f9-40f5-b43b-a13cfc3ed958)
My attempt at deleting the snapshot to merge:
Code: Select all
$ VBoxManage snapshot corpvm1 delete 9b85065f-248d-4530-832e-17cc73b4da5d
VBoxManage: error: This machine does not have any snapshots
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "FindSnapshot(Bstr(a->argv[2]).raw(), pSnapshot.asOutParam())" at line 515 of file VBoxManageSnapshot.cpp
The UI obviously sees no snapshot either.
I tried to clone the VM too. The clone operation works, but gives me also the 2 disks, with no snapshot visible by VirtualBox. I hoped it would merge during clone time (and reduce the size of the VM on disk) but apparently not.
Any idea?
Re: Snapshots unseen and cannot delete
Posted: 11. Sep 2017, 10:45
by mpack
That is NOT how one goes about getting rid of an unwanted snapshot. In fact what you did is pretty much guaranteed to kill the VM. You really should not mess with VirtualBox files when you clearly don't understand their purpose. Stick to using the UI only, and do NOT ask the UI to cross link files that already belong to an existing VM.
Snapshots give the ability to return to earlier states. If you no longer need a particular earlier state then just highlight that snapshot in the VM settings and delete it. Don't make the mistake of deleting the current state.
If you don't want to risk using the snapshots API (and in that case one is forced to wonder why you chose to create a snapshot in the first place), then simply clone the VM: current state only, don't reset the MAC. That creates a duplicate VM with a merged disk.
In future, if you want to be sure of the ability to revert to an earlier VM state then a simple VM folder backup is usually the best bet.
Re: Snapshots unseen and cannot delete
Posted: 11. Sep 2017, 11:19
by chapeaurouge
I didn't do much actually, except showing pieces of info. No snapshot was hurt in the footage. So I don't understand what you are referring to in your reply? (My VM still works right?)
Edit: I don't see where you've seen I was trying to cross-link files from different VMs?
Reading my post over, I think I was not clear enough, which is why your answer is probably not providing any useful clues.
While I do have a snapshot (taken a couple month ago prior to that win10 upgrade -- and via the UI since I don't seem to understand much

), VirtualBox does not see it, nor in the UI, nor in the CLI -- as shown in my initial post. But it is indeed there, as my VM works fine out of the 2 disks.
Can you please let me know how to get rid of a "ghost" snapshot then?
And I don't want to revert the machine to a previous state, I want to get rid of the previous state.
I hope my problem is now a bit clearer.
Thank you.
Re: Snapshots unseen and cannot delete
Posted: 11. Sep 2017, 12:34
by mpack
Well, there does seem to be a language problem, because it certainly seems to me that you
very clearly said you had created a new VM and mounted the difference image from the old VM in the new VM.
chapeaurouge wrote:
The problem is that, after recreating the VM and pointing it to the differencing disk
There was never a need to recreate the VM.There is no way to treat a differencing disk as if it was stand alone.
I gave two methods in my previous post for how to correctly eliminate an unwanted snapshot. Neither involved creating a new VM and mounting an existing disk. Both methods will require access to the original undamaged VM. Happily that must still be around, otherwise you could never have mounted a differencing image at all.
p.s. Although sometimes we use the term "snapshot" (incorrectly) as a shorthand to indicate the special VDI, in fact a snapshot is not just the disk image, and mounting a differencing image will NOT cause an actual snapshot to appear in the list of snapshots for the VM. A true shapshot consists of control information
plus the associated disk images. You did not describe any step that would have resulted in transferring the control info to the second VM.
Re: Snapshots unseen and cannot delete
Posted: 11. Sep 2017, 14:18
by chapeaurouge
OK. anyways.
So, given the current facts that
* My VM is running fine
* I have the base and differencing disks and the control info at hand (and obviously working -- how would you say it is "damaged"?)
* VirtualBox does not give me the opportunity -- neither in the UI, neither in the CLI -- to delete my previous state (mainly in order to reclaim some disk space) -- your "solutions" have for prerequisites that VB actually sees the snapshots or whatever you want to call them.
What do you advise then?
Re: Snapshots unseen and cannot delete
Posted: 11. Sep 2017, 14:23
by mpack
As I previously said, clone the VM, current state only. The clone will have a merged disk which therefore does not require control information. There is no way to maintain or manipulate the snapshot structure as is.
Re: Snapshots unseen and cannot delete
Posted: 11. Sep 2017, 14:25
by chapeaurouge
OK, will try again. However, I think I've tried that, and the clone operation still spitted out 2 disks and not one. Maybe I have overlooked something, or -- as my virtualbox limited understanding allows -- I have hit a corner case/issue.
Thank you for your help.
Re: Snapshots unseen and cannot delete
Posted: 11. Sep 2017, 14:34
by mpack
I assume you mean one disk in two parts, as I really hope you did not mount both the base VDI and the difference image at the same time.
I think it's about time I saw a VM log. With the VM fully shut down, right click and "Show Log" in the GUI, save "VBox.log" (no other file) to a zip, and attach the zip here.
Re: Snapshots unseen and cannot delete
Posted: 11. Sep 2017, 15:13
by chapeaurouge
What I mean is the output you can see in the initial post (VBoxManage list -l hdds).
No, I mounted only one (the one holding the latest set of changes, so uuid 9b85065f-248d-4530-832e-17cc73b4da5d) and started off the VM from it.
Attached!
Re: Snapshots unseen and cannot delete
Posted: 11. Sep 2017, 19:22
by mpack
This VM does not have two disks. The "list hdds" output does not show two disks. It has one disk in two or more VDI parts. A snapshot chain makes one disk. An base+difference gives two states for one disk. Base+difference+difference gives three potential states of one disk.
A difference image has no meaning without the base state that it is differenced from. Mounting the difference state by itself is nonsensical. It shouldn't have worked at all, I assume it only did because this or some other VM still has the base VDI registered.
Let's try this: zip up a copy of the .vbox file and attach it here.
Re: Snapshots unseen and cannot delete
Posted: 12. Sep 2017, 11:02
by chapeaurouge
Understood.
Please see attached vbox file.
Cheers,
fred
Re: Snapshots unseen and cannot delete
Posted: 12. Sep 2017, 13:45
by mpack
The .vbox file looks fine to me. It has the snapshot control information, it has both parent and child VDIs registered, and the base state and current states are each referencing the correct VDI file.
This ought to be working, i.e. a snapshot should be visible in the snapshots panel if this really is the .vbox file from the VM. Please show me a screenshot of the snapshots panel?
And cloning the current state ought to be working as well. Can you test it and give a clear description of what did and didn't work, with precise error messages?
Tip for the future: when you want to insert the Guest Additions CD, click the "Devices" menu of the VM and select "Insert Guest Additions CD image...". There is no need to go hunting for it, since the correct ISO is bundled with the VirtualBox download. You seem to have been collecting GAs ISOs from weird versions and places and mounting them in the VM.
Re: Snapshots unseen and cannot delete
Posted: 12. Sep 2017, 14:09
by socratis
Another thing that I didn't particularly like was that the snapshot {9b85065f...}, although it is properly declared as a child of the base {d7b56b52...}, in its properties is has:
In use by VMs: corpvm1 (UUID: 736c637c-c5f9-40f5-b43b-a13cfc3ed958)
That is
another VM altogether, named "corpvm1", not your original VM named "VMcorp2".
- Did you try to create a new VM and pointed it to an existing disk, with that disk being the snapshot?
- Why is the original VM called "VMcorp2", yet it resides in a folder called "FBI-corp-vm" with a HD named "VM14416.vdi"?
- Have you been creating new VMs pointing them to existing disks? At a minimum, you've been really messing around.
Re: Snapshots unseen and cannot delete
Posted: 12. Sep 2017, 15:44
by chapeaurouge
Hi Socratis,
* Your first bullet point is correct.
* That's probably after moving the thing around due to disk space issue on the host. The .vdi file was always called like that. Actually the path will change again as I move the underlying btrfs volume into its own subvol. I would not think folder names account for that much?
* Just that one VM. No other. We're still talking about the same VM and the same files. Believe me, I would not have messed with it, if I could have avoided it. Yet, I only "messed" with it either through the UI or through VBoxManage in CLI, nothing else.
So in the end, @mpack, I am sure I ought to see something -- rather VirtualBox should -- but it is not. As said multiple times, all is working fine, yet VB does not see the snapshots neither in the UI, nor in the CLI.
Re: Snapshots unseen and cannot delete
Posted: 12. Sep 2017, 16:12
by mpack
I am still waiting for the information I asked for.