Don*_*ito 26 virtualbox timeout vagrant vagrantfile
有一些问题让我的流浪汉,得到了框,运行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.
Run Code Online (Sandbox Code Playgroud)
有什么建议?
Bri*_*anC 17
有几个不同的问题可能导致此超时问题.跟踪它的一个好方法是启用GUI模式.这将打开VirtualBox机器UI,它可以提供更好的线索来解决问题.
要启用GUI模式,请确保Vagrantfile取消注释您的此部分:
config.vm.provider "virtualbox" do |vb|
vb.gui = true
end
Run Code Online (Sandbox Code Playgroud)
然后做一个vagrant reload.这应该会显示VirtualBox应用程序,显示您的虚拟机UI.通常问题将变得明显,无论是网络问题还是grub引导加载程序问题.
解决问题后,您可以再次对此进行评论,然后再做一次vagrant reload以返回无头模式.
参考:Vagrant docs
这里优雅地描述了一个解决方案。它是唯一一个在 i686 上对我有用的 Ubuntu 16.04.2、Vagrant 1.9.3 和 Virtualbox 5.1.18 试图运行 ubuntu/trusty32。
您要做的是修复服务器上的网络并为启动添加一些额外的时间:
启动VM,通过GUI登录服务器(用户名:vagrant,密码:vagrant)并运行以下命令
$ sudo ifdown eth0
$ sudo ifup eth0
Run Code Online (Sandbox Code Playgroud)然后将以下内容添加到文件 /etc/rc.local
ifdown eth0
ifup eth0
Run Code Online (Sandbox Code Playgroud)在主机上,将以下内容添加到 Vagrantfile
config.vm.boot_timeout = 600
Run Code Online (Sandbox Code Playgroud)现在停止虚拟机。下次你做一个“流浪者”的时候就可以了。
| 归档时间: |
|
| 查看次数: |
41473 次 |
| 最近记录: |