Vagrant 无法启动 ubuntu/vivid32。 在启动过程中,vagrant 尝试连接多次并最终超时。 如果我通过 VirtualBox 管理器连接到盒子,ifconfig 显示 eth0 已启动但未为其分配 IP。 然后我做
sudo ifdown eth0 && sudo ifup eth0
之后,ifconfig 显示eth0 有一个IP 地址。 然后我可以使用 vagrant ssh 从 vagrant 连接 如果我使用 VirtualBox 管理器关闭并打开 guest 电源, guest 会正常运行(带有 IP 地址)并且 Vagrant ,ifconfig 显示 eth0 有一个 IP 地址。 然后我可以使用 vagrant ssh 从 vagrant 连接。
如果我使用 VirtualBox 管理器关闭并打开客户机,客户机正常运行(具有 IP 地址)并且 vagrant 可以通过 vagrant ssh 连接。
如果我通过 vagrant (vagrant halt) 关闭电源并打开电源 (vagrant up),我会遇到同样的问题(vagrant 端超时并且没有 IP 地址)并且无法通过 vagrant ssh 连接到访客。
当 vagrant 尝试连接时, guest 显示:
cloud-init-nonet[4.54]: waiting 10 seconds for network device
cloud-init-nonet[14.57]: waiting 120 seconds for network device
cloud-init-nonet[134.57]: gave up waiting for a network device
我在 guest 端尝试了几个建议的解决方案,例如 this .
无论我尝试什么,都对 vagrant 方面没有帮助。
在对 guest 中的 IP 地址进行初始修复后,VirtualBox 管理器可以启动该框,现在多次都没有问题。 但是,如果我通过 vagrant (vagrant halt) 关闭电源并打开电源 (vagrant up),我会遇到同样的超时问题,无法通过 vagrant ssh 连接到客户机。 我怀疑“vagrant up”清除了网络接口(interface)并重新设置,在此过程中导致问题再次出现。
(这也发生在 guest :ubuntu/trusty32)
f:\Programs\HashiCorp\Vagrant\bin>vagrant up
Bringing machine 'vivid32' up with 'virtualbox' provider...
==> vivid32: Checking if box 'ubuntu/vivid32' is up to date...
==> vivid32: Clearing any previously set forwarded ports...
==> vivid32: Clearing any previously set network interfaces...
==> vivid32: Preparing network interfaces based on configuration...
vivid32: Adapter 1: nat
==> vivid32: Forwarding ports...
vivid32: 22 => 2222 (adapter 1)
==> vivid32: Booting VM...
==> vivid32: Waiting for machine to boot. This may take a few minutes...
vivid32: SSH address: 127.0.0.1:2222
vivid32: SSH username: vagrant
vivid32: SSH auth method: private key
vivid32: Warning: Connection timeout. Retrying...
vivid32: Warning: Connection timeout. Retrying...
...
vivid32: Warning: Connection timeout. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
- Vagrant 1.7.4
- VirtualBox - VirtualBox-5.0.0-101573
- 主机 - Windows Vista
- 访客 ubuntu/vivid32
最佳答案
至少对于 ubuntu/trusty32,问题似乎是默认的 VirtualBox Intel 网络适配器与图像不兼容。
解决方案是将网络适配器更改为 AMD 替代品:
PCnet-FAST III (Am79C973)
您可以使用 VirtualBox UI 或通过更改 Vagrantfile 来执行此操作,如 this GitHub issue 所示.
关于ubuntu - Vagrant up 无法在云图像上启动网络接口(interface),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31739755/