VirtualBox

Ticket #2943 (new defect)

Opened 5 years ago

Last modified 16 months ago

Snapshotted virtual machine cannot be deleted

Reported by: emrahgunduz Owned by:
Priority: major 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 frank) (diff)

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.
Result Code: VBOX_E_INVALID_OBJECT_STATE (0x80BB0007)

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

comment:1 Changed 5 years ago by zhj1028

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

comment:2 Changed 5 years ago by frank

  • Description modified (diff)
  • Guest type changed from Windows to other

zhj1028, please post in English. Thank you!

comment:3 Changed 5 years ago by rebroad

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 Changed 5 years ago by rgsteele

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

comment:5 Changed 5 years ago by andrewz

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

comment:6 Changed 5 years ago by misiu_mp

I confirm for fedora 11 host and VirtualBox 2.2.4.

comment:7 Changed 5 years ago by pongtawat

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

comment:8 Changed 5 years ago by pongtawat

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 Changed 5 years ago by andrewz

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 Changed 5 years ago by oak

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 Changed 5 years ago by spiralofhope

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 Changed 4 years ago by ac

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 Changed 4 years ago by thomasb

This bug is still present in 3.1.6. Very annoying.

comment:14 Changed 4 years ago by commorancy

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 Changed 4 years ago by commorancy

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 Changed 4 years ago by magicloud

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 Changed 4 years ago by steffen123

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 follow-up: ↓ 19 Changed 4 years ago by 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.

comment:19 in reply to: ↑ 18 Changed 4 years ago by rxt

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 Changed 4 years ago by Technologov

This is a big limitation for me.

-Technologov

comment:21 Changed 3 years ago by tparikka

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

comment:22 Changed 3 years ago by tparikka

Note, I am on VBox 4.1.0.

comment:23 Changed 2 years ago by jimav

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 Changed 16 months ago by speedingcheetah

This issue is also in VBox 4.2.6 r82870 (host 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.

Last edited 16 months ago by speedingcheetah (previous) (diff)
Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use