vagrantfile - Vagrant networking error with 2 networks cards (1 inactive) -


i've got 2 network cards on linux host machine. eth0 flaky, don't use (ifconfig eth0 down). eth1 set dhcp.

in vagrantfile, have

  config.vm.network :private_network, type: 'dhcp' 

this works. sort of. windows guest machine comes working networking on "ethernet 2". has inactive "ethernet" connection. error on vagrant up, , doesn't run chef recipes. vagrant error is

==> win10: configuring , enabling network interfaces... following winrm command responded non-zero exit status. vagrant assumes means command failed!  netsh interface ip set address "ethernet 2" dhcp if ($?) { exit 0 } else { if($lastexitcode) { exit $lastexitcode } else { exit 1 } }  stdout command:    stderr command: 

i've tried config.vm.network :private_network, type: 'dhcp', adapter: '2'

but gives

 undefined method '+' nil:nilclass (nomethoderror)  

from call stack of

blah/configure_networks.rb:25:in `each' blah/configure_networks.rb:25:in `configure_networks' blaah/lib/vagrant/capability_host.rb:111:in `call' blaah/lib/vagrant/capability_host.rb:111:in `capability' 

from vagrant networking doc

vagrant.configure("2") |config|   config.vm.network "private_network", auto_config: false    # manual ip   config.vm.provision "shell",     run: "always",     inline: "ifconfig eth1 192.168.0.17 netmask 255.255.255.0 up"  end 

Comments