如何使用Hyper-V作为提供者来移除缓存的不存在的Virtualbox机器?

问题描述:

我在Windows 10 Pro下首先使用Vagrant与Virtualbox提供商并创建了几个框。然后,因为我想测试Docker for Win,我不得不切换到Hyper V并卸载Virtualbox。过了一段时间,我手动删除了一些Virtualbox机器或重新设置了文件夹,以便它们不再有Vagrantfile。如何使用Hyper-V作为提供者来移除缓存的不存在的Virtualbox机器?

当我尝试运行任何
vagrant global-status --prune

vagrant destroy -f XXXYYYZZZ
我得到这个错误:
The provider 'virtualbox' that was requested to back the machine 'default' is reporting that it isn't usable on this system. The reason is shown below: Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed. Vagrant uses the VBoxManage binary that ships with VirtualBox, and requires this to be available on the PATH. If VirtualBox is installed, please find the VBoxManage binary and add it to the PATH environmental variable.
我明白流浪是想说:安装VirtualBox二进制文件,因此它可以管理的框。但实际上并没有虚拟机开始,所以它应该足以将其从注册表中删除,并且不需要Virtualbox。
有没有办法在我的情况下从注册表中删除缓存的盒子?

流浪汉是保持其管理下的以下位置的计算机列表(即适用于Mac,你需要找到窗口,因为我不完全肯定的路径)

~/.vagrant.d/data/machine-index 

,并在此文件夹中,您会找到一个index文件,该文件将列出它在缓存中存在的所有机器。它的一个JSon文件和该机器的提供商已列出,因此您可以删除任何不是VirtualBox

+0

是的,这也是我最初的想法,我只是希望有一些更优雅的解决方案。 – borism