vagrant box 副本效果不佳
vagrant box copy not working well
我无法顺利启动 vagrant box 副本。
我用的是"hashicorp/precise32"(我的机器安装不了"ubuntu/trusty64"或者32,我什么都试过了。我猜是因为我的电脑太旧了,2009)。
我可以vagrant up
使用默认添加框"hashicorp/precise32"。
一切正常。
然后,我 vagrant halt
复制了一个 vagrant box 的副本:
vagrant package --base myprojectvm_default_1437507203066_25705 --output mybox.box
vagrant box add mybox.box --name mybox
那我vagrant destroy
.
然后我更改 Vagrantfile :config.vm.box = "hashicorp/precise32"
至 config.vm.box = "mybox"
然后我 运行 vagrant up
几分钟后我在客人身上看到了这个:
“正在等待网络配置...
等待网络配置最多 60 秒....
在没有完整网络配置的情况下启动系统..."
然后是一些 "Starting..." 行和其他行...最后,机器启动了。
为什么 "without full network configuration"?
来自流浪书
It is very common for Linux-based boxes to fail to boot initially.
This is often a very confusing experience because it is unclear why it
is happening. The most common case is because there are persistent
network device udev rules in place that need to be reset for the new
virtual machine. To avoid this issue, remove all the persistent-net
rules. On Ubuntu, these are the steps necessary to do this:
$ rm /etc/udev/rules.d/70-persistent-net.rules
$ mkdir /etc/udev/rules.d/70-persistent-net.rules
$ rm -rf /dev/.udev/
$ rm /lib/udev/rules.d/75-persistent-net-generator.rules>
在centos box上,这是命令我是运行
cd /etc/sysconfig/network-scripts/
sudo rm -f ifcfg-eth1
cd /etc/udev/rules.d/
sudo rm -f 70-persistent-net.rules
它对我来说一直很好用
我无法顺利启动 vagrant box 副本。
我用的是"hashicorp/precise32"(我的机器安装不了"ubuntu/trusty64"或者32,我什么都试过了。我猜是因为我的电脑太旧了,2009)。
我可以vagrant up
使用默认添加框"hashicorp/precise32"。
一切正常。
然后,我 vagrant halt
复制了一个 vagrant box 的副本:
vagrant package --base myprojectvm_default_1437507203066_25705 --output mybox.box
vagrant box add mybox.box --name mybox
那我vagrant destroy
.
然后我更改 Vagrantfile :config.vm.box = "hashicorp/precise32"
至 config.vm.box = "mybox"
然后我 运行 vagrant up
几分钟后我在客人身上看到了这个:
“正在等待网络配置... 等待网络配置最多 60 秒.... 在没有完整网络配置的情况下启动系统..."
然后是一些 "Starting..." 行和其他行...最后,机器启动了。
为什么 "without full network configuration"?
来自流浪书
It is very common for Linux-based boxes to fail to boot initially. This is often a very confusing experience because it is unclear why it is happening. The most common case is because there are persistent network device udev rules in place that need to be reset for the new virtual machine. To avoid this issue, remove all the persistent-net rules. On Ubuntu, these are the steps necessary to do this:
$ rm /etc/udev/rules.d/70-persistent-net.rules $ mkdir /etc/udev/rules.d/70-persistent-net.rules $ rm -rf /dev/.udev/ $ rm /lib/udev/rules.d/75-persistent-net-generator.rules>
在centos box上,这是命令我是运行
cd /etc/sysconfig/network-scripts/
sudo rm -f ifcfg-eth1
cd /etc/udev/rules.d/
sudo rm -f 70-persistent-net.rules
它对我来说一直很好用