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

时间:2015-03-28 17:55:09

标签: php ubuntu vagrant virtual-machine virtualbox

抱歉,我是流浪汉的新手,我正在运行流浪汉1.4.3和virtualbox 4.3.26。我的主机操作系统是ubuntu 14.04.2。

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

我从vagrantbox.es尝试的每一个盒子我在运行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界面中运行我的命令。 但令人惊讶的是我得到同样的错误。我认为可能是因为客户操作系统无法登录,我将这些行添加到我的流浪文件

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

实际上我搞砸了,我不知道还应该做些什么。

2 个答案:

答案 0 :(得分:2)

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

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

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

TimeoutStartSec=5min

为:

TimeoutStartSec=30sec

然后我重新启动了系统,它运行正常。

答案 1 :(得分:0)

我将我的流浪汉升级到1.7.2,我的问题现在解决了。但是我没有看到我的盒子在虚拟盒界面中运行。毕竟我现在可以ssh到我的盒子里,没有问题。