Vagrant box: default: 警告:连接超时。正在重试。

9

我无法让vagrant box运行起来。我尝试了这个帖子中的解决方案: Vagrant stuck connection timeout retrying。但并没有成功。我还尝试增加config.vm.boot_timeout的值。也没用。请帮忙!

$ vagrant destroy && vagrant up
    default: Are you sure you want to destroy the 'default' VM? [y/N] y
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
==> default: Running cleanup tasks for 'shell' provisioner...
==> default: Running cleanup tasks for 'shell' provisioner...
==> default: Running cleanup tasks for 'shell' provisioner...
==> default: Running cleanup tasks for 'shell' provisioner...
==> default: Running cleanup tasks for 'shell' provisioner...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: Homestead_default_1404542131789_93737
==> 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: 80 => 9000 (adapter 1)
    default: 3306 => 33060 (adapter 1)
    default: 5432 => 54320 (adapter 1)
    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.

提前感谢您!


在这个问题中,第二个答案对我起作用。 - victormfv
可能的情况是VirtualBox未能重定向端口,尽管它说 '==> default: Forwarding ports... default: 22 => 2222 (adapter 1)' 您可以在我的问题[链接](http://stackoverflow.com/questions/36529651/virtualbox-nat-failed-to-redirect-tcp-127-0-0-12222-10-0-2-1522)中查看完整的描述。 我仍然不知道如何解决重定向失败( 如果您成功了,请在我的帖子中留言并分享您的方法! - WebComer
3个回答

3

0

您在此处发布的消息基本上是在VM启动结束时打印的。

因此,我认为有两个主要原因:

  1. 您有防火墙,因此甚至无法从本地主机访问vagrant机器。我建议尝试禁用防火墙并重新运行。

  2. 您的客户机太重了,在实际可用之前,启动时发生了很多事情,因此vagrant超时了。在这种情况下,请按照vagrant的指示更新vm配置文件中config.vm.boot_timeout的值。

希望这可以帮助到您。


-1

在你的 Vagrant 配置文件中启用 GUI 键盘输入

config.vm.provider :virtualbox do |vb|
  vb.gui = true
end

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接