vagrant fails to bring up additional adapter for centos vm using virtual box provider
- by Anadi Misra
this is in continuation of the question asked here about host only adapter on dhcp
I upgraded to vagrant 1.6.3 and the updated Vagrantfile to following setting for multiple adapters
# add additional adapter for inter machine networking
dev.vm.network :private_network, :type => "dhcp", :adapter => "2", :netmask => "255.255.255.0"
it goes through creating adapters but then fails bringing up the mic on vm
Anadis-MacBook-Pro:full-stack-env anadi$ vagrant up
Bringing machine 'full-stack-env' up with 'virtualbox' provider...
==> full-stack-env: Clearing any previously set forwarded ports...
==> full-stack-env: Clearing any previously set network interfaces...
==> full-stack-env: Preparing network interfaces based on configuration...
full-stack-env: Adapter 1: nat
full-stack-env: Adapter 2: hostonly
==> full-stack-env: Forwarding ports...
full-stack-env: 22 => 4223 (adapter 1)
full-stack-env: 8080 => 8090 (adapter 1)
==> full-stack-env: Running 'pre-boot' VM customizations...
==> full-stack-env: Booting VM...
==> full-stack-env: Waiting for machine to boot. This may take a few minutes...
full-stack-env: SSH address: 127.0.0.1:4223
full-stack-env: SSH username: vagrant
full-stack-env: SSH auth method: private key
full-stack-env: Warning: Connection timeout. Retrying...
full-stack-env: Warning: Connection timeout. Retrying...
full-stack-env: Warning: Remote connection disconnect. Retrying...
==> full-stack-env: Machine booted and ready!
==> full-stack-env: Checking for guest additions in VM...
==> full-stack-env: Setting hostname...
==> full-stack-env: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
ARPCHECK=no /sbin/ifup eth 2> /dev/null
Stdout from the command:
Device eth does not seem to be present, delaying initialization.
Stderr from the command:
how ever when I log in to the environment I see two network interfaces as expected
Anadis-MacBook-Pro:full-stack-env anadi$ vagrant ssh
Last login: Wed Jun 4 12:54:47 2014 from 10.0.2.2
[vagrant@full-stack-env ~]$ ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:BD:39:57
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:febd:3957/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:511 errors:0 dropped:0 overruns:0 frame:0
TX packets:360 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:54574 (53.2 KiB) TX bytes:46675 (45.5 KiB)
eth1 Link encap:Ethernet HWaddr 08:00:27:A3:86:C9
inet addr:172.28.128.3 Bcast:172.28.128.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fea3:86c9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1360 (1.3 KiB) TX bytes:894 (894.0 b)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
I am bit confused here on why it is trying to add another mic (eth2)? In the VM I used for creating this vagrant box, I had added two NICs already.