I've got 2 network cards on my Linux host machine. eth0 is flaky, so I don't use it (ifconfig eth0 down). eth1 is set up for DHCP.
In my Vagrantfile, I have
config.vm.network :private_network, type: 'dhcp'
This works. Sort of. The windows guest machine comes up with working networking on "Ethernet 2". It also has an inactive "Ethernet" connection. But I get an error on vagrant up, and it doesn't run my Chef recipes. The vagrant error is
==> win10: Configuring and enabling network interfaces...
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
netsh interface ip set address "Ethernet 2" dhcp
if ($?) { exit 0 } else { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } }
Stdout from the command:
Stderr from the command:
I've tried config.vm.network :private_network, type: 'dhcp', adapter: '2'
but that gives
undefined method '+' for nil:NilClass (NoMethodError)
from a 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'