如果.vagrant中的所有文件丢失,如何启动或暂停流浪者?

时间:2015-05-09 07:19:54

标签: vagrant virtualbox vagrantfile vbox vagrant-windows

first_vagcode是在文件夹f:\ vagvms \ vagcode中创建的vm,它仍然可以从vbox gui启动,但我现在无法使用vagrant up启动它,似乎vagrant status甚至无法发现现在,我入侵了,发现里面的所有元数据.vagrant丢失了,我知道发生了什么,我的问题是如何使用vagrant up启动这个vm,如果我在.vagrant中为这个vm重新生成文件?或者我应该向Vagrantfile添加一些东西?但是怎么做呢?

不过,我正在使用win7 x64

    F:\vagvms\vagcode>vagrant status
    Current machine states:

    default                   not created (virtualbox)

    The environment has not yet been created. Run `vagrant up` to
    create the environment. If a machine is not created, only the
    default provider will be shown. So if a provider is not listed,
    then the machine is not created for that environment.

    F:\vagvms\vagcode>vboxmanage list vms
    "first_vagcode" {3a1c41f3-3c01-4fa7-bb25-d68a66292b00}
    "vagtwo_default_1431119083293_66111" {03ee5819-dfc3-4bdd-bd10-a2e4e44350c5}

1 个答案:

答案 0 :(得分:0)

你可以:

  • 从GUI启动vm
  • 使用vagrant box create BOX_ID
  • 从vm中创建一个基本框
  • 使用流浪环境中的方框

但是,您需要执行此操作意味着您手动对vm进行了一些更改。我建议使用ChefPuppet配置VM。这样做,你可以简单地扔掉盒子并设置一个新盒子。