Blizz
Blizz

Reputation: 8400

Vagrant crashes b/c private network line in config

I am unable to specify an ip for the VM in my configuration, this makes vagrant crash.

My Vagrantfile at this point:

# -*- 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

There is more in there but I've reduced it to this. If I run 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>

If I disabled the private network line it works but then I don't have control over the IP.

I've tested the alternative writing method (yes, I'm that desperate):

 config.vm.network :private_network, :ip => "192.168.33.10"

Tried with and without the :netmask argument (as the stacktrace is about arguments)

My details:

I've tested this with several different boxes (all based on CentOS), the problem is the same with all of them, searched the internet for everything I could think of.

All to no avail. Don't know how to continue, please help?

Upvotes: 1

Views: 1458

Answers (2)

dasrick
dasrick

Reputation: 426

I had the same error with Vagrant 1.6.4 and it seems to be fixed in Vagrant 1.6.5.

Upvotes: 3

Ross Timson
Ross Timson

Reputation: 88

I have the same environment and have just encountered this too. It looks like this is a known bug: github.com/mitchellh/vagrant/issues/4458.

Until this bug is patched I'm afraid the only option you have is to either manually patch Vagrant yourself with the details included in the issue report or downgrade to Vagrant 1.6.3. I've already downgraded to 1.6.3 and can confirm that this works as expected.

Upvotes: 6

Related Questions