这是问题的延续在此处询问有关 dhcp 上的主机专用适配器
我升级到了 vagrant 1.6.3,并将 Vagrantfile 更新为以下针对多个适配器的设置
# add additional adapter for inter machine networking
dev.vm.network :private_network, :type => "dhcp", :adapter => "2", :netmask => "255.255.255.0"
它创建了适配器,但无法在虚拟机上启动麦克风
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:
但是当我登录到环境时,我看到了预期的两个网络接口
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)
我有点困惑,为什么它要尝试添加另一个麦克风 (eth2)?在我用于创建这个 vagrant box 的 VM 中,我已经添加了两个 NIC。