timeout - Vagrant 超时

标签 timeout vagrant virtualbox vagrantfile

有一些问题让我的 Vagrant 起床,
拿到盒子,跑 vagrant init之后 vagrant up命令我收到此消息。

Bringing machine 'default' up with 'virtualbox' provider...
    ==> default: Importing base box 'precise32'...
    ==> default: Matching MAC address for NAT networking...
    ==> default: Setting the name of the VM: virtm_default_1400193131859_61200
    ==> default: Fixed port collision for 22 => 2222. Now on port 2201.
    ==> default: Clearing any previously set network interfaces...
    ==> default: Preparing network interfaces based on configuration...
        default: Adapter 1: nat
    ==> default: Forwarding ports...
        default: 22 => 2201 (adapter 1)
    ==> default: Booting VM...
    ==> default: Waiting for machine to boot. This may take a few minutes...
        default: SSH address: 127.0.0.1:2201
        default: SSH username: vagrant
        default: SSH auth method: private key 
    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.

有什么建议?

最佳答案

有几个不同的问题会导致这个超时问题。跟踪它的一个好技巧是启用 GUI 模式。这将显示 VirtualBox 机器 UI,这可能会提供有关问题的更好线索。

要启用 GUI 模式,请确保您的 Vagrantfile 中的此部分未注释:

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

然后做一个vagrant reload .这应该会打开 VirtualBox 应用程序,显示您的虚拟机 UI。通常问题会变得很明显,无论是网络问题还是 grub 引导加载程序问题。

解决问题后,您可以再次注释掉,然后再做一次 vagrant reload返回 headless 模式。

引用:Vagrant docs

关于timeout - Vagrant 超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23690124/

相关文章:

Raspberry Pi 3 上的 Bluetoothctl 配对超时

linux - Vagrant,只下载一次包而不是为 linux 中的每个项目下载包

macos - 使用带有 Vagrant 的 Docker 中的编辑器编辑文件(在 Mac 上)

google-chrome - chrome 在最小的 Centos7+Xvfb 中失败并显示 "Illegal instruction"

nginx - 增加504超时错误

php - Openshift MySQL Cartgridge 上的连接超时

vagrant - 如何在 Puppet 配置的 Vagrant 项目中跨环境共享 list

performance - Symfony2 缓慢的初始化时间

nginx - Kubernetes-如何使用NodePort服务从集群外部访问Nginx负载平衡

java - 如何确定可以延长其响应时间的 Web 服务之外所花费的时间