我有一个 Ubuntu 13.10,我安装了 Vagrant 1.5.4 和 VirtualBox 4.3.10r93012。当我第一次编写命令 vagrant up
脚本正确启动虚拟机时,就会出现我的问题。但是在做了vagrant halt
并再次编写命令vagrant up
之后,出现了问题:
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: 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.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
有什么解决办法吗?谢谢。
最佳答案
我使用 config.vm.boot_timeout
增加时间。但对我来说,这不是原因,尽管错误表明超时。
我使用 vim 打开了 Vagrantfile 并添加以下行来打开 VM 的 GUI。
config.vm.provider :virtualbox do |vb|
vb.gui = true
end
重新运行 vagrant up
后,我在 GUI 中看到了真正的原因。有一个错误对话框,它一直在等待。这就是连接超时的原因。
为了解决这个问题,我必须在系统 BIOS 中进行一些配置。我不得不打开英特尔 VT-x 设置。请同时检查 AMD-V 设置。这些设置有助于硬件虚拟化。
关于linux - vagrant up 时等待机器启动时超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23293071/