代码之家  ›  专栏  ›  技术社区  ›  borism

如何使用Hyper-V作为提供程序删除缓存的不存在的Virtualbox机器?

  •  1
  • borism  · 技术社区  · 7 年前

    我首先在Windows 10 Pro下使用Vagrant和Virtualbox provider,并创建了几个盒子。然后,因为我想测试Docker是否成功,我不得不切换到Hyper V并卸载Virtualbox。过了一段时间,我手动删除了一些Virtualbox机器,或者重新定位了文件夹,这样它们就不再有Vagrantfile了。

    当我试着跑的时候
    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.

    在我的例子中,有没有办法从注册表中删除缓存框?

    2 回复  |  直到 7 年前
        1
  •  4
  •   Frederic Henri    7 年前

    vagrant将其管理的机器列表保存在以下位置(也就是说,对于Mac,您需要为windows查找,因为我不完全确定路径)

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

    index

        2
  •  0
  •   Sudhakar Mangipudi    6 年前

    我已经卸载了virtual box,但每次尝试运行“vagrant up”时都会出现相同的错误

    请求支持计算机的提供程序“virtualbox” “默认”是指报告它在此系统上不可用。原因 如下所示:

    流浪者无法检测到VirtualBox!确保VirtualBox正确 VBoxManage 随附的二进制文件 VirtualBox,并要求它在路径上可用。如果 VirtualBox已安装,请查找 Vbox管理 二进制和加法

    所以下面的过程救了我。

    第1步:在vagrantfile的“config.vm.box”行下方添加行

    config.vm.define "hyperv"
    

    vagrant up --provider=hyperv
    

    它应该有效。我让流浪汉跟着这些台阶跑。 它必须是作为虚拟盒保存在缓存或注册表中某处的提供程序。 enter code here

    https://willmurphyscode.net/2017/01/16/a-very-simple-vagrant-deployment/