xse*_*rat 36 linux virtualbox vagrant ubuntu-13.10
我有一个Ubuntu 13.10,我安装了Vagrant 1.5.4和VirtualBox 4.3.10r93012.当我vagrant up第一次正确编写虚拟机脚本时编写命令时,会出现问题.但在执行vagrant halt并vagrant up再次编写命令后,会出现问题:
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> 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: 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.
Run Code Online (Sandbox Code Playgroud)
有什么解决方案吗?谢谢.
小智 41
我增加了使用时间config.vm.boot_timeout.但对我而言,这不是原因,尽管错误告诉了超时.
我使用vim打开Vagrantfile并添加以下行,为VM启用GUI.
config.vm.provider :virtualbox do |vb|
vb.gui = true
end
Run Code Online (Sandbox Code Playgroud)
重新运行后,vagrant up我看到了GUI中的真正原因.有一个错误对话框,它一直在等待.这就是连接超时的原因.
要解决此问题,我必须在系统BIOS中进行一些配置.我不得不打开英特尔VT-x设置.请检查AMD-V设置.这些设置有助于硬件虚拟化
Hed*_*shy 12
我在Windows 10上遇到了同样的问题,我的解决方案是启用Intel虚拟化.
我担心我不能给你具体说明,因为BIOS菜单选项因计算机而异,具体取决于制造商.但是,通常您应该按照以下步骤操作:
1 - 打开机器电源并打开BIOS.
2-打开处理器子菜单.处理器设置菜单可能隐藏在芯片组,高级CPU配置或北桥中.
3 - 根据处理器的品牌,启用Intel虚拟化技术(也称为Intel VT)或AMD-V.
4-保存更改并重新启动.
我用"vagrant destroy"解决了这个问题.
此命令停止正在运行的计算机Vagrant正在管理和销毁在计算机创建过程中创建的所有资源.运行此命令后,您的计算机应处于干净状态,就好像您从未创建过客户机一样.
您需要能够使用GUI.删除Vagrant文件中此行的注释:
config.vm.provider :virtualbox do |vb|
vb.gui = true
end
Run Code Online (Sandbox Code Playgroud)
在您需要关闭机器并重新开始之后:
vagrant halt
vagrant up
Run Code Online (Sandbox Code Playgroud)
我还收到错误消息Timed out while waiting for the machine to boot.通过 vagrant 文件启用 GUI 后,我可以看到 vagrant tp 要求输入登录名和密码。提供vagrant/vagrant工作,但机器仍然没有启动。
终于,Vagrant destroy工作了。在这台 vagrant up 配置的机器之后,现在我可以进行 ssh 了。