一尘不染

在无所事事的情况下等待机器启动时超时

linux

我有一个Ubuntu 13.10,并安装了Vagrant 1.5.4和VirtualBox 4.3.10r93012。我vagrant up第一次在虚拟机上正确编写脚本时编写命令时会出现我的问题。但是在完成vagrant haltvagrant 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.

有什么解决办法吗?谢谢。


阅读 528

收藏
2020-06-03

共1个答案

一尘不染

我使用会增加时间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设置。这些设置有助于硬件虚拟化。

2020-06-03