如何使用快照删除 VirtualBox VM?

如何使用快照删除 VirtualBox VM?

我有一台虚拟机,上面有很多快照。我不再需要这台机器了,我需要磁盘空间。快照占用了大量的磁盘空间。

但是当我尝试通过 VirtualBox 方式删除它时,出现了一个愚蠢的死锁。

$ VBoxManage unregistervm VmName --delete
Oracle VM VirtualBox Command Line Management Interface Version 3.2.14
(C) 2005-2011 Oracle Corporation
All rights reserved.

ERROR: Cannot unregister the machine 'VmName' because it has 84 snapshots
Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Machine, interface IMachine, callee nsISupports
Context: "UnregisterMachine(uuid, machine.asOutParam())" at line 164 of file VBoxManageMisc.cpp

如果我只想删除 vdi,我会得到

$ VBoxManage --nologo closemedium disk path-to-disk.vdi
ERROR: Medium 'path-to-disk.vdi' is attached to 1 virtual machines
Details: code VBOX_E_OBJECT_IN_USE (0x80bb000c), component Medium, interface IMedium, callee nsISupports
Context: "Close()" at line 1617 of file VBoxManageDisk.cpp

我从虚拟机中分离了介质,但仍然出现相同的错误。可能是因为介质在机器的过去快照中使用过。磁盘的任何快照都存在同样的问题。

删除 Virtualbox 时不应停止它(我上面有许多应该打开的虚拟机),所以这stop-edit VirtualBox.xml-start不是解决办法。

我是否应该从文件系统中删除 vdis?除了 VM 之外,它是否会破坏我不需要的某些东西?

相关内容