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 )
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:
- Snapshotted virtual machine cannot be deleted.
- Discarding a snapshot results in duplicated hard disk.
- Reverting and trying to discarding a snapshot results in another duplicated hard disk.
- After this point, snapshots cannot be discarded or reverted.
- One of the child hard disks can not be deleted or released regardless of the snapshot status by using Virtual Media Manager.
- Deleting snapshots by hand results in file not found error.
- 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 , 16 years ago
comment:2 by , 16 years ago
Description: | modified (diff) |
---|---|
Guest type: | Windows → other |
zhj1028, please post in English. Thank you!
comment:3 by , 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:8 by , 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 , 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 , 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 , 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 , 15 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:14 by , 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 , 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 , 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 , 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.
follow-up: 19 comment:18 by , 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.
comment:19 by , 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:21 by , 13 years ago
I am still encountering the same problem. Win7x64 host, problem occurs for Fedora 14 x32 and Fedora x64 guests.
comment:23 by , 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 , 12 years ago
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.
comment:25 by , 8 years ago
Description: | modified (diff) |
---|---|
Resolution: | → obsolete |
Status: | new → closed |
Please reopen if still relevant with a recent VirtualBox release.
删除备份文件后 就能正常删除了