无法“删除”或“销毁”干净的 Vagrant Box

Bre*_*ias 4 virtualbox vagrant vagrant-windows

我在 Windows 10 上使用 Vagrant 1.8.1。当尝试删除或销毁盒子时,我得到了这些矛盾的结果:

baria@DESKTOP-057K4L5 /c/repos/hub/vtc/linphone-windows-dependencies
$ vagrant box list
hashicorp/precise64  (virtualbox, 1.1.0)
windows_2012_r2_core (virtualbox, 0)

baria@DESKTOP-057K4L5 /c/repos/hub/vtc/linphone-windows-dependencies
$ vagrant box remove windows_2012_r2_core
Box 'windows_2012_r2_core' (v0) with provider 'virtualbox' appears
to still be in use by at least one Vagrant environment. Removing
the box could corrupt the environment. We recommend destroying
these environments first:

vagrant-windows-2012-r2-core (ID: 00d3488f41fa40998bfe16ada2ebfd31)

Are you sure you want to remove this box? [y/N] N

baria@DESKTOP-057K4L5 /c/repos/hub/vtc/linphone-windows-dependencies
$ vagrant destroy windows_2012_r2_core
The machine with the name 'windows_2012_r2_core' was not found configured for
this Vagrant environment.
Run Code Online (Sandbox Code Playgroud)

我在谷歌上搜索了“流浪环境”是什么的解释,但一无所获。所以我不知道如何“破坏环境”。

即便如此,我希望该destroy命令能够确认我的盒子的存在windows_2012_r2_core,因为listremove命令承认它的存在。

这里发生了什么?如何干净地摆脱这个框,而不出现警告或错误?

Fré*_*nri 6

您只需销毁引用的虚拟机vagrant destroy 00d3488f41fa40998bfe16ada2ebfd31即可销毁正在使用此框的虚拟机,然后您就可以删除该框。

正如 @Brandon Davis 提到的,您可以运行vagrant global-status查看创建的 vagrant VM 的列表(来自 vagrant 1.6+),您会看到哪个 VM 是 00d3488f41fa40998bfe16ada2ebfd31