Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vagrant up fails with config.vm.network :hostonly #1628

Closed
hex opened this issue Apr 18, 2013 · 13 comments
Closed

vagrant up fails with config.vm.network :hostonly #1628

hex opened this issue Apr 18, 2013 · 13 comments

Comments

@hex
Copy link

hex commented Apr 18, 2013

When I run vagrant up with config.vm.network :hostonly, "33.33.33.33" I recieve the following error:

C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/plugins/kernel_v2/config/vm.rb:137:in `[]': can't convert Symbol into Integer (TypeError)
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/plugins/kernel_v2/config/vm.rb:137:in `network'
        from C:/Users/dev/Vm/Vagrantfile:18:in `block in <top (required)>'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/lib/vagrant/config/v2/loader.rb:37:in `call'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/lib/vagrant/config/v2/loader.rb:37:in `load'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/lib/vagrant/config/loader.rb:104:in `block (2 levels) in load'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/lib/vagrant/config/loader.rb:98:in `each'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/lib/vagrant/config/loader.rb:98:in `block in load'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/lib/vagrant/config/loader.rb:95:in `each'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/lib/vagrant/config/loader.rb:95:in `load'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/lib/vagrant/environment.rb:261:in `config_global'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/lib/vagrant/environment.rb:495:in `block in action_runner'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/lib/vagrant/action/runner.rb:28:in `call'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/lib/vagrant/action/runner.rb:28:in `run'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/lib/vagrant/environment.rb:274:in `hook'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/lib/vagrant/environment.rb:135:in `initialize'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/bin/vagrant:62:in `new'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.1/bin/vagrant:62:in `<top (required)>'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/bin/vagrant:23:in `load'
        from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/bin/vagrant:23:in `<main>'

If I go with config.vm.network :public_network everything works fine.

Windows 7 x64
Vagrant 1.2.1
Oracle VirtualBox 4.2.12 r84980

@mitchellh
Copy link
Contributor

The new syntax is

config.vm.network :private_network, ip: "33.33.33.33"

I need to do a better job of catching this sort of misuse.

@adriancdperu
Copy link

just went through the same thing, didnt know the syntaxis change
i guess its because many blogs out there are not updated, like this blog shows how to use fluentd with vagrant and still uses old syntaxis "hostonly" http://dev.classmethod.jp/server-side/server/fluentd-clustering/

@luizsignorelli
Copy link

The Vagrant: Up and Running book uses the old syntax too: http://chimera.labs.oreilly.com/books/1234000001668/ch04.html#_basic_usage_2

@therobyouknow
Copy link

Why was the syntax changed in the first place? This is causing people pain, I have to rewrite my Vagrant scripts. What was the benefit.? It seems like using Vagrant has gained the pitfalls of 'works for me' problems that it was supposed to solve by precisely defining VMs. Sorry but I just want to get on and debug my actual website code, not debug the tools that setup my LAMP stack i.e Vagrant.

@mitchellh
Copy link
Contributor

@therobyouknow If you're unhappy with the new syntax you can stick with the old syntax and it works just fine, just make sure it is in a V1 (Vagrant.configure("1") or Vagrant::Config.run) block. I'm sorry. The syntax was changed so that it would be less confusing in the long run with multiple providers.

@therobyouknow
Copy link

@mitchellh - thanks so much for responding, honoured to hear from the creator of Vagrant! Thanks for the V1 tip - that will help, it's appreciated. Though I'd like to move with the times and rework my scripts. I will also update my end-to-end start from scratch setting up Vagrant guide, here: http://stackoverflow.com/a/15067918/227926

@chrisduong
Copy link

Hi, I tried the new synxtax. It worked. But I still need 'host-only' network interface, because I need to connect to host network, not between virtual machines internally. I cannot ping from host to guest's internal IP.
Could someone tell me how to do that in Vagrant, not in Virtualbox GUI. Thanks

@kikitux
Copy link
Contributor

kikitux commented Apr 22, 2014

config.vm.network :private_network, ip: "192.168.56.10"

that works for me.

On Sat, Apr 19, 2014 at 4:45 PM, chrisd notifications@github.com wrote:

Hi, I tried the new synxtax. It worked. But I still need 'host-only'
network interface, because I need to connect to host network, not between
virtual machines internally. I cannot ping from host to guest's internal IP.
Could someone tell me how to do that in Vagrant, not in Virtualbox GUI.
Thanks


Reply to this email directly or view it on GitHubhttps://github.com//issues/1628#issuecomment-40860688
.

@chrisduong
Copy link

I mean I don't see my host IP for subnet 192.168.56.0/24 as host-only network as usual. For host-only network, I usually get a IP like 192.168.56.100 for my host. So how would I access to private network of guess without a valid IP.

@kikitux
Copy link
Contributor

kikitux commented Apr 22, 2014

in Virtualbox, you have, nat, bridge, private, and host only.

can past the line you have in your vagrant file and a screesshot how the network look in Virtualbox gui once the vm is created?

@muk302
Copy link

muk302 commented Aug 1, 2014

Vagrant crashing on:
config.vm.network :private_network, :auto_config => true, :ip => "10.0.0.5", :netmask => "255.255.255.0"

top of the stack:
.vagrant.d/gems/gems/vagrant-windows-1.6.0/lib/vagrant-windows/windows_machine.rb:62:in winrmshell': undefined methodwinrmshell' for #VagrantPlugins::CommunicatorWinRM::Communicator:0x00000002d6d560 (NoMethodError)
from /home/usernamehere/.vagrant.d/gems/gems/vagrant-windows-1.6.0/lib/vagrant-windows/guest/cap/configure_networks.rb:19:in `configure_networks'

I have tried this in different spots of my Vagrantfile. I have tried without the netmask and auto_config false. Always the same. Any clue?

@sneal
Copy link
Contributor

sneal commented Aug 1, 2014

@muk302 You need to uninstall the vagrant-windows plugin

@muk302
Copy link

muk302 commented Aug 1, 2014

I don't remember installing that plugin. Thank you.

Now that I look at the path, it all makes sense now. I know...noobs.

Tamini referenced this issue in Tamini/vagrant-hadoop-cluster Sep 3, 2014
@hashicorp hashicorp locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants