我无法在配置中为VM指定ip,这会使流浪者崩溃。
此时我的Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "puphpet/centos65-x64"
config.vm.network "private_network", ip: "192.168.33.10"
end
还有更多,但我已经减少了。
如果我运行vagrant up
:
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'puphpet/centos65-x64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'puphpet/centos65-x64' is up to date...
==> default: Setting the name of the VM: website_default_1409831132235_3604
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
GuestAdditions versions on your host (4.3.14) and guest (4.3.10) do not match.
<snipped - guest additions installation>
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/guests/redhat/cap/configure_networks.rb:31:in `configure_networks_default': wrong number of arguments (1 for 2) (ArgumentError)
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/guests/redhat/cap/configure_networks.rb:19:in `configure_networks'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/capability_host.rb:111:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/capability_host.rb:111:in `capability'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/guest.rb:43:in `capability'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/network.rb:132:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/clear_network_interfaces.rb:26:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
<snipped>
如果我禁用了专用网络线路,它可以工作但我无法控制IP。
我已经测试了替代写作方法(是的,我是绝望的):
config.vm.network :private_network, :ip => "192.168.33.10"
尝试使用和不使用:netmask参数(因为stacktrace是关于参数)
我的详细信息:
我用几个不同的盒子(都是基于CentOS)对它进行了测试,所有这些问题都是一样的,在互联网上搜索我能想到的一切。
一切都无济于事。不知道怎么继续,请帮帮忙?
答案 0 :(得分:6)
我有相同的环境,也遇到过这种情况。看起来这是一个已知的错误:github.com/mitchellh/vagrant/issues/4458。
在修补此错误之前,我担心您唯一的选择是使用问题报告中包含的详细信息手动修补Vagrant或降级到Vagrant 1.6.3。我已经降级到1.6.3并且可以确认这是按预期工作的。
答案 1 :(得分:3)
我和Vagrant 1.6.4有同样的错误,似乎在Vagrant 1.6.5中修复了。