Opened 16 years ago

Closed 8 years ago

#2943 closed defect (obsolete)

Snapshotted virtual machine cannot be deleted

Reported by: Emrah Gunduz Owned by:
Component: virtual disk Version: VirtualBox 2.1.0
Keywords: removing, deleting, snapshot, child hard disk Cc:
Guest type: other Host type: Windows

Description (last modified by aeichner)

OS: Windows XP x64 Edition Version 2003 Service Pack 2
Computer: AMD Athlon 64 x2 Dual 4600+

While trying to delete a virtual machine which has a snapshot saved, VirtualBox throws this error (I changed the machine name, and disk location information with dummy text):

Cannot unregister the machine 'Machine name' because it has 1 snapshots.

It is not possible to discard a snapshot after this error. The new error is this :

Hard disk 'Disk location' has more than one child hard disk (2)
Result Code: E_FAIL (0x80004005)
Component: Harddisk1

Trying to revert to the "current state" and trying to discard the snapshot also creates an error, and creates a new hard disk child :

Hard disk 'Disk location' has more than one child hard disk (3)
Result Code: E_FAIL (0x80004005)
Component: Harddisk2

Virtual Media Manager lists 3 VDI files under the main VDI of the virtual machine with same virtual sizes, but only with 80,50 KB usages.

Trying to release the child hard disks, whatever the snaphot condition is, results in another error :

The machine is not mutable (state is 2)
Result Code: VBOX_E_INVALID_VM_STATE (0x80BB0002)
Component: Machine

If you delete the snapshot files/folder by hand, you still can not delete the snapshot from the VirtualBox. You just receive a "file not found" error. However, it is now possible to delete the locked child hard disk. After this point, you can remove the snapshot, and remove the virtual machine completely.

A summary:

  1. Snapshotted virtual machine cannot be deleted.
  2. Discarding a snapshot results in duplicated hard disk.
  3. Reverting and trying to discarding a snapshot results in another duplicated hard disk.
  4. After this point, snapshots cannot be discarded or reverted.
  5. One of the child hard disks can not be deleted or released regardless of the snapshot status by using Virtual Media Manager.
  6. Deleting snapshots by hand results in file not found error.
  7. After deleting snapshot files, removing the child hard disk, snapshots and virtual machine in this order is possible.

PS: Removing a virtual machine has to be simpler, and less complicated for the user. The process has to be automatic, and file removal must be asked to user. Throwing errors is not a good way.
PSS: It is not possible to copy/paste the text from the error screens in Windows Xp x64

Change History (25)

comment:1 by zhj1028, 16 years ago

删除备份文件后 就能正常删除了

comment:2 by Frank Mehnert, 16 years ago

Description: modified (diff)
Guest type: Windowsother

zhj1028, please post in English. Thank you!

comment:3 by rebroad, 16 years ago

I'm trying to delete my snapshot and am getting this error also. The only reason I'm trying to delete it is because it no longer works since I created a snapshot. The error I get when I try to run it is "Callee RC: E_FAIL (0x80004005)"

comment:4 by Ryan Steele, 15 years ago

I can confirm this issue occurs on an Ubuntu 9.04 host as well.

comment:5 by Andrew Ziem, 15 years ago

I get the same/similar on VBOX 2.2.2 on Fedora 10 32-bit host

comment:6 by Michal Pomorski, 15 years ago

I confirm for fedora 11 host and VirtualBox 2.2.4.

comment:7 by pongtawat, 15 years ago

I have the same problem with VirtualBox 2.2.4 on Ubuntu 9.04 host.

comment:8 by pongtawat, 15 years ago

I forget to mention that I could delete all child harddisks from Virtual Media Manager, then I could discard snapshot and remove the VM.

comment:9 by Andrew Ziem, 15 years ago

With pongtawat's tip about the VMM and after a relatively-long, non-intuitive process, I was finally able to delete the VM in VirtualBox 2.2.4 and host Fedora 10.

comment:10 by Emanuel Greisen, 15 years ago

On ubuntu 9.04 host, I found a quicker way:

  • rm -fr .VirtualBox/Machines/FooBarMachineXXX/
  • Start VirtualBox (then it gets all mad about things that are not as they should) click "Ignore"
  • Remove the Virtual machine (which has lots of errors on it)
  • Restart VirtualBox and click "Check"
  • Remove all snapshots (child items to hard discs)
  • Remove the hard disc.

comment:11 by spiralofhope, 15 years ago

I confirm for PCLinuxOS 2007 and VirtualBox 2.2.4. This appears to not be a host-specific issue.

oak's instructions worked for me.

comment:12 by AC, 14 years ago

This just happened to me on VirtualBox 3.1.4r57640, with the added behavior that the VM process crashes if you try to run the machine after the failed delete.

comment:13 by thomasb, 14 years ago

This bug is still present in 3.1.6. Very annoying.

comment:14 by Brian Wright, 14 years ago

I am also confirming that this bug is still present in 3.1.6r59338. Actually, though, I'm not trying to delete the virtual machine. I'm trying to delete the snapshot so that I can bring it up to date to the current changed state. Note that this uses a vmdk and not a vdi file. I was able to delete and create snapshots several times before this attempt.

comment:15 by Brian Wright, 14 years ago

Ok, I found the issue. For some reason, the GUI wrote the VirtualBox.xml file with an incorrect snapshot entry for the machine. Not only did the entry for the hard disk not exist, it was named incorrectly for the machine. I'm not even sure how this entry would have come into existence. The guest machine for which it claimed to have been created had never had a snapshot created. But, more than this, it put the entry for the HardDisk into an incorrect machine's area. Once I deleted the incorrect line from the xml file, I was able to merge the snapshot fine.

Odd bug.

comment:16 by Magicloud, 14 years ago

I'd like to add that this happens in 3.2.6. I have a vm with snapshots that cannot be discard or unregister. And the broken vm often makes the GUI die.

comment:17 by Steffen Schaumburg, 14 years ago

I've experienced a similiar error in vbox 3.2.6 on Gentoo-amd64 with a Win7-64 guest. I found the immediate root cause to be that I had only one snapshot, yet the Virtual Media Manager said I had two. So I deleted the spare one and that fixed the problem. Now the important part - I think I probably caused this by starting to create a snapshot with the VM running, but then aborting the process.

comment:18 by Rxt, 14 years ago

I have the same problem (Ubuntu 10.4 host, XP client). I had created a new snapshot with name XP100727, then needed to change one small thing, created another snapshot with exactly the same name. I can start the vm, but it cannot restore to the snapshot.

in reply to:  18 comment:19 by Rxt, 14 years ago

Replying to rxt:

I have the same problem (Ubuntu 10.4 host, XP client). I had created a new snapshot with name XP100727, then needed to change one small thing, created another snapshot with exactly the same name. I can start the vm, but it cannot restore to the snapshot.

Btw, if it's not allowed to use the same name, then it shouldn't be possible to do this.

comment:20 by Technologov, 14 years ago

This is a big limitation for me.


comment:21 by Thomas, 13 years ago

I am still encountering the same problem. Win7x64 host, problem occurs for Fedora 14 x32 and Fedora x64 guests.

comment:22 by Thomas, 13 years ago

Note, I am on VBox 4.1.0.

comment:23 by Jim Avera, 13 years ago

Bug is still in VBox 4.1.6 (host: Ubuntu 11.20 amd64).

Must be timing related, as the bug is not reproducible on demand. I had previously deleted all snapshots, run the VM on the base .vdi only, and then did a few more steps, some combination of making new snapshots and snap deletes (always while the VM was shut down, I think). After just a few iterations, there were two children of the base .vdi.

The Media Manager said that one of the children was attached to the VM, the other was not attached.

I had to manually edit the <vmname>.vbox XML file to remove the "not attached" snapshot entry. Then I could delete the other snapshot as usual.

comment:24 by speedingcheetah, 12 years ago

This issue is also in VBox 4.2.6 r82870 Windows 7 Ultimate SP1.

I didn't want to delete the VM, just all snapshots, while retaining 'current machine state'. VBox threw this error:

Hard disk 'Disk location' has more than one child hard disk (2)

Not sure how the VM got 2 child disks, but I was able to get around it by cloning the VM using Type 'Full clone' and Snapshot 'current machine state' to get a snapshot-less VM.

To reclaim disk space from the old VM, I was able to remove each child virtual disk one-at-a-time, then the parent virtual disk, and finally the VM itself from VBox ... before manually deleting the VM directory from the host disk.

Version 1, edited 12 years ago by speedingcheetah (previous) (next) (diff)

comment:25 by aeichner, 8 years ago

Description: modified (diff)
Resolution: obsolete
Status: newclosed

Please reopen if still relevant with a recent VirtualBox release.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use