VBox crashed saving snapshot - now cannot delete it

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
PBear
Posts: 5
Joined: 29. Apr 2008, 17:43

VBox crashed saving snapshot - now cannot delete it

Post by PBear »

Using VirtualBox 5.1.22 on a Mac Mini running macOS Sierra with both Ubuntu and Windows 10 guests -- no problems whatsoever up until a couple of days ago when I was saving a snapshot of my Windows guest. The process crashed just as it was completing (I suspect after it had finished and was writing the snapshot information to the configuration file -- the Creating Snapshot progress bar had reached 100%). Snapshot that crashed did not show up in my list of snapshots (should have been Snapshot #3), so tried doing another snapshot. This time, I did not get a Snapshot #4 but just a tiny little changed file that was recorded as Snapshot #3. I have this huge file that was supposed to be Snapshot #3 but no reference to it in my snapshots list.

Today tried to delete my snapshots, starting with the last snapshot in my list (called Snapshot #3 but actually Snapshot #4). Got the following error message:

Code: Select all

Failed to delete the snapshot Snapshot 3 of the virtual machine Windows 10 Professional x64.

Hard disk '/Users/XXXXX/VirtualBox/Windows 10 Professional x64/Snapshots/{34e3a9b1-7d4a-4864-93fe-4c862a03ae93}.vdi' has more than one child hard disk (2).

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: SessionMachine
Interface: IMachine {b2547866-a0a1-4391-8b86-6952d82efaa0}
How can I fix this up?
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: VBox crashed saving snapshot - now cannot delete it

Post by socratis »

Unless your username is "XXXXX", please do NOT obfuscate any other messages or diagnostics. It does not reveal anything about you and it most certainly does not help us.

Right-click on the VM in the VirtualBox Manager, Show in Finder, zip it and attach it to your response (see the "Upload attachment" tab below the reply form). I will also need the output of the following command:
  • ls -alR "/Users/XXXXX/VirtualBox/Windows 10 Professional x64/"
substituting of course in the command line your actual username. I will need that output with the command line included please.

One thing I noticed is that you've modified the default location of your VMs. Anything else that you might have modified? Not that it hurts, it's simply not the norm...
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.
PBear
Posts: 5
Joined: 29. Apr 2008, 17:43

Re: VBox crashed saving snapshot - now cannot delete it

Post by PBear »

I'm sorry, zip what? You don't want me to zip everything in that directory, including my 33 GB .vdi file and 78 GB worth of snapshots, and attach all of it, do you? Which files and/or directories should I upload?

I don't recall what the default location for VMs is, so I don't remember why I modified it (unless the default is to place the VMs under the Documents directory, then I certainly would have changed it to avoid having all of my VMs, including their enormous hard disk files, uploaded over wi-fi to my iCloud backup!). I don't recall changing any other defaults.
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: VBox crashed saving snapshot - now cannot delete it

Post by socratis »

PBear wrote:I'm sorry, zip what? You don't want me to zip everything in that directory, including my 33 GB .vdi file and 78 GB worth of snapshots, and attach all of it, do you? Which files and/or directories should I upload?
No, of course not ;). I should have been more specific about that. When you right-click the VM and select "Show in Finder", a .vbox file is selected. That's the one I was talking about, the "recipe" of the VM. It's a couple of KB, but I'm not sure that the forum will let you upload that extension, that's why the zipping...
PBear wrote:I don't recall what the default location for VMs is, so I don't remember why I modified it
The default in (for example) my case is "/Users/socratis/VirtualBox VMs", which I've changed to "/Users/Shared/VirtualBox/Machines" for similar reasons. Maybe you changed it because of the "space" in the name. It's OK...
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.
PBear
Posts: 5
Joined: 29. Apr 2008, 17:43

Re: VBox crashed saving snapshot - now cannot delete it

Post by PBear »

OK, here we go. Output of the command you told me to run:

Code: Select all

Mac-Mini-5-1:~ PBear$ ls -alR "/Users/PBear/VirtualBox/Windows 10 Professional x64/"
total 63613096
drwxr-xr-x  8 PBear  staff          272 Jun 26 13:20 .
drwxr-xr-x  6 PBear  staff          204 Jun 24 20:09 ..
-rw-r--r--@ 1 PBear  staff         8196 Jun 26 15:44 .DS_Store
drwx------  6 PBear  staff          204 Jun 26 13:00 Logs
drwx------  9 PBear  staff          306 Jun 24 04:17 Snapshots
-rw-------  1 PBear  staff        33184 Jun 26 13:20 Windows 10 Professional x64.vbox
-rw-------  1 PBear  staff  32569819136 Jun 22 20:47 Windows 7 Ultimate x64.vdi

/Users/PBear/VirtualBox/Windows 10 Professional x64//Logs:
total 1496
drwx------  6 PBear  staff     204 Jun 26 13:00 .
drwxr-xr-x  8 PBear  staff     272 Jun 26 13:20 ..
-rw-------  1 PBear  staff  141168 Jun 26 13:17 VBox.log
-rw-------  1 PBear  staff  144482 Jun 24 04:23 VBox.log.1
-rw-------  1 PBear  staff  331876 Jun 24 03:50 VBox.log.2
-rw-------  1 PBear  staff  138218 Jun 23 13:33 VBox.log.3

/Users/PBear/VirtualBox/Windows 10 Professional x64//Snapshots:
total 154820680
drwx------  9 PBear  staff          306 Jun 24 04:17 .
drwxr-xr-x  8 PBear  staff          272 Jun 26 13:20 ..
-rw-------  1 PBear  staff    879129917 Jun 22 20:47 2017-06-23T03-47-18-689093000Z.sav
-rw-------  1 PBear  staff   1230421738 Jun 23 04:32 2017-06-23T11-31-30-619980000Z.sav
-rw-------  1 PBear  staff   1585661846 Jun 24 04:18 2017-06-24T11-17-52-724311000Z.sav
-rw-------  1 PBear  staff   2557476864 Jun 26 13:17 {26d9b538-d256-432b-a6d4-6d6c95b5a83e}.vdi
-rw-------  1 PBear  staff  42248175616 Jun 24 04:17 {34e3a9b1-7d4a-4864-93fe-4c862a03ae93}.vdi
-rw-------  1 PBear  staff  30765219840 Jun 23 04:31 {92c22099-0e23-43f4-84fd-b63593992bdb}.vdi
-rw-------  1 PBear  staff      2097152 Jun 24 03:50 {d33d19b7-a0bc-479b-a0e0-4db4830be8e1}.vdi
and the .vbox file, attached.
Attachments
Windows 10 Professional x64.vbox.zip
(4.68 KiB) Downloaded 7 times
Last edited by socratis on 27. Jun 2017, 01:31, edited 1 time in total.
Reason: Enclosed the information in [code] tag for better readability
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: VBox crashed saving snapshot - now cannot delete it

Post by socratis »

Here's what's going on. It could help you if you opened the VirtualBox Media Manager (Cmd-D by default) and follow this. Just navigate to your VM and expand all the children.

You'll see that the "Snapshot 3" ({34e3a9b1-...) has two children (I'm cutting several digits, for the sake of clarity):
  • {d33d19b7..., and
  • {26d9b538
You can also see that in the part of the .vbox file that contains a list of the VDIs and you can see that they're in the same indent level, i.e. they're both children of the same parent (the red arrows don't actually exist in the .vbox file, neither is the text bold for that matter):
<HardDisks>
  <HardDisk uuid="{eeb7130f-...}.vdi" format="VDI">
    <HardDisk uuid="{92c22099-...}.vdi" format="VDI">
      <HardDisk uuid="{34e3a9b1-...}.vdi" format="VDI">
>>>>>>  <HardDisk uuid="{d33d19b7-...}.vdi" format="VDI">
>>>>>>  <HardDisk uuid="{26d9b538-...}.vdi" format="VDI">
      </HardDisk>
    </HardDisk>
  </HardDisk>
</HardDisks>
Now, the "{d33d19b7-...}.vdi" in your filesystem is exactly 2 MB (2097152 bytes), which means that it's an empty, unused VDI. This must have been created when the snapshot process crashed. Which means pretty much that it's useless (at this point) and you can safely remove it. BTW, the crash happened at 03:50 in the morning?

So, in the VirtualBox Media Manager, select that "{d33d19b7-...}.vdi" disk and select Remove. You might be asked if you want to delete the file, select Yes.

Now, I've noticed that you take your snapshots while the VM is running. It's not a great idea. Unless you're really familiar with how snapshots work, I'd try to learn a little bit more before going live snapshot, after live snapshot, after live snapshot, after live snapshot. If anything goes bad during any of the steps, your VM might not be repairable. Not that VirtualBox crashes when taking snapshots, but I think you got really lucky this time.
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.
PBear
Posts: 5
Joined: 29. Apr 2008, 17:43

Re: VBox crashed saving snapshot - now cannot delete it

Post by PBear »

Yes, that did the trick all right. Thanks very much for your help.
Post Reply