有一些问题让我的 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/