vagrant 1.0.3不为仅主机网络debian 6创建设备

vagrant 1.0.3不为仅主机网络debian 6创建设备,debian,vagrant,Debian,Vagrant,我在文件中创建了一个hostonly网络,其行如下 config.vm.network :hostonly, "10.1.1.15" 我可以看到它设置了/etc/network/interfaces文件 #VAGRANT-BEGIN # The contents below are automatically generated by Vagrant. Do not modify. auto eth1 iface eth1 inet static address 10.1.1.15

我在文件中创建了一个hostonly网络,其行如下

config.vm.network :hostonly, "10.1.1.15"
我可以看到它设置了/etc/network/interfaces文件

#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
auto eth1
iface eth1 inet static
      address 10.1.1.15
      netmask 255.255.255.0
#VAGRANT-END

但是,当我运行ifconfig时,我只看到eth0和lo设备。为什么流浪汉没有为eth1安装设备?解决这个问题的办法是什么?

好吧,在进一步挖掘之后,我找到了一个办法

如果有必要,以下是有关我的环境的一些详细信息:

Ubuntu 12.10
Vagrant 1.0.3 install from the Ubuntu repos using apt-get
Virtualbox 4.1.24 downloaded from the virtualbox website
据我所知,我使用过并有此问题的盒子(vagrantup.com上的precise32以及vagrantbox.es上的挤压64盒)在装运时附带了一些在/etc/udev/rules.d/70 persistent net.rules文件中设置的规则。它们通常在每次启动时都会更新,但由于某些原因,这种情况不会发生。这导致像eth1这样的设备(通常用于在vagrant中设置hostonly网络)永远不会被设置,并且操作系统认为它没有被配置

您可以删除文件中的相关规则,也可以只删除文件。然后重新启动,问题应该得到解决。每次你做一个流浪者销毁或创建一个新的流浪者虚拟机时,你都必须这样做。不过,多亏了#vagrant freenode频道上的simonmcc指出了一个更持久的解决方案

您可以在不重新启动的情况下删除该文件,然后使用vagrant包以这种方式重新打包该框。否则,请从头开始创建您自己的长方体(使用veewee或不使用veewee),并确保此文件设置正确,然后将其打包