linux - vagrant up 时等待机器启动时超时

标签 linux virtualbox vagrant ubuntu-13.10

我有一个 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/

相关文章:

linux - Linux 中的 .NET Core 不读取环境变量

c - 如何在 Linux 上检测程序的启动?

vagrant box 复制效果不佳

ruby-on-rails - 为什么添加这样的 Rails 中间件会导致无休止的重定向?

linux - 以特定用户身份启动时出现 AWK 错误

linux - 在命令链中输入 sudo 命令的密码

jenkins - Jenkins是否有一个稳定的插件可以在VM上运行构建?

java - 如何调试部署在虚拟盒中的应用程序和主机操作系统中的源代码

kernel - Virtualbox 6.1.10、Ubuntu 20.04 错误返回状态构建在内核 5.8.0 上,包 virtualbox-dkms 错误

linux - 在 vagrant 上排序需要 2 小时 - 大约 100m 行