如何清理损坏的 Virtualbox 快照(丢失的文件)?

如何清理损坏的 Virtualbox 快照(丢失的文件)?

我在 VirtualBox (VBox) 中创建了一个快照,然后在我的硬盘上找到了它。所以我在文件夹结构中将其删除。当我打开 VBox 时,我看到它仍然在那里,所以尝试将其删除,但出现错误。

我尝试在 CMD(具有管理员权限)中将其删除,但出现此错误:

D:\Program Files\Oracle\VirtualBox>VBoxManage snapshot "Server Name" delete "Extra HDD Added (no longer available)"
0%...
Progress state: E_FAIL
VBoxManage.exe: error: Snapshot operation failed
VBoxManage.exe: error: Could not open the medium 'D:\Virtual Machines\VirtualBox\UNIX Machines\Server Name\ExtraHDD.vdi'.
VBoxManage.exe: error: VD: error VERR_FILE_NOT_FOUND opening image file 'D:\Virtual Machines\VirtualBox\UNIX Machines\Server Name\ExtraHDD.vdi' (VERR_FILE_NOT_FOUND)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MediumWrap, interface IMedium
VBoxManage.exe: error: --------
VBoxManage.exe: error: Could not open the medium 'D:\Virtual Machines\VirtualBox\UNIX Machines\Server Name\Snapshots/{e3ef3706-6882-4404-8478-f085ca9f3b1e}.vdi'.
VBoxManage.exe: error: VD: error VERR_FILE_NOT_FOUND opening image file 'D:\Virtual Machines\VirtualBox\UNIX Machines\Server Name\Snapshots/{e3ef3706-6882-4404-8478-f085ca9f3b1e}.vdi' (VERR_FILE_NOT_FOUND)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MediumWrap, interface IMedium
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleSnapshot(struct HandlerArg *)" at line 532 of file VBoxManageSnapshot.cpp

所以基本上,我想在 VBox 中删除快照的“标签”(因为找不到实际文件)。

如果找不到,我该如何删除它?

答案1

我通过执行以下操作修复了第一个错误:

D:\Program Files\Oracle\VirtualBox>vboxmanage internalcommands sethduuid "D:\Virtual Machines\VirtualBox\UNIX Machines\Server Name\ExtraHDD.vdi" "7ee23ee6-2dd9-4ae0-ae1c-c5ee532fab95"
UUID changed to: 7ee23ee6-2dd9-4ae0-ae1c-c5ee532fab95

现在我只剩下一个错误。

D:\Program Files\Oracle\VirtualBox>VBoxManage snapshot "Server Name" delete "Extra HDD Added (no longer available)"
VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended info not available)
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Shared)" at line 331 of file VBoxManageSnapshot.cpp

最后更新:

我更改了快照的名称(我{在名称中漏掉了一个),现在我收到了更严重的错误:

D:\Program Files\Oracle\VirtualBox>VBoxManage snapshot "Server Name" delete "Extra HDD Added (no longer available)"
0%...
Progress state: E_FAIL
VBoxManage.exe: error: Snapshot operation failed
VBoxManage.exe: error: Could not open the medium 'D:\Virtual Machines\VirtualBox\UNIX Machines\Server Name\Snapshots/{e3ef3706-6882-4404-8478-f085ca9f3b1e}.vdi'.
VBoxManage.exe: error: VDI: error reading pre-header in 'D:\Virtual Machines\VirtualBox\UNIX Machines\Server Name\Snapshots/{e3ef3706-6882-4404-8478-f085ca9f3b1e}.vdi' (VERR_EOF).
VBoxManage.exe: error: VD: error VERR_VD_VDI_INVALID_HEADER opening image file 'D:\Virtual Machines\VirtualBox\UNIX Machines\Server Name\Snapshots/{e3ef3706-6882-4404-8478-f085ca9f3b1e}.vdi' (VERR_VD_VDI_INVALID_HEADER)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MediumWrap, interface IMedium
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleSnapshot(struct HandlerArg *)" at line 532 of file VBoxManageSnapshot.cpp

不幸的是,Google 上没有找到任何解决方案(据我所知)。

相关内容