vagrant + virtualbox 等待机器启动时超时

vagrant + virtualbox Timed out while waiting for the machine to boot

抱歉,我是 vagrant 的新手,我正在 运行ning vagrant 1.4.3 和 virtualbox 4.3.26。我的主机 OS 是 ubuntu 14.04.2.

我是一名 php 开发人员,我正在努力让我的开发环境为几个项目做好准备。

以及我从 vagrantbox.es 尝试的每个框,当 运行ning vagrant up 命令时,我得到同样的错误。 错误是:

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. This can
mean a number of things.

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.provider :virtualbox do |vb|
    vb.gui = true
  end

添加这些行后,我在我的框中获得了登录页面,因此它可以启动,我可以 运行 我在 GUI 界面中的命令。 但令人惊讶的是我得到了同样的错误。我自己想可能是因为来宾 OS 无法登录,我将这些行添加到我的 vagrant 文件

config.ssh.username   = "vagrant"
 config.ssh.password   = "vagrant"
 config.ssh.insert_key = "true"

但是我收到这个错误

There are errors in the configuration of this machine. Please fix
the following errors and try again:

SSH:
* The following settings shouldn't exist: insert_key, password

实际上我被搞砸了,我不知道我还能做什么。

我将我的 vagrant 升级到了 1.7.2,现在我的问题已经解决了。但是我在 virtualbox 界面中没有看到我的框 运行。毕竟我现在可以 ssh 到我的盒子了,没有问题。

转到虚拟框并停止 运行 连接。单击开始并等待用户登录并通过:vagrant。在里面写这个命令:

sudo vim /etc/systemd/system/network-online.targets.wants/networking.service

并更改文件末尾的以下行:

TimeoutStartSec=5min

至:

TimeoutStartSec=30sec

然后我重新启动了系统,它工作正常。