Vagrant在删除/project/.vagrant后出现“等待启动虚拟机的超时”错误

3

问题

我正在使用bento/centos7.2虚拟机,执行vagrant up启动虚拟机时,发现有更新提示,于是本能地取消了操作(我建议永远不要这样做!)。然后我执行了vagrant destroyrm -rf .vagrant,以确保之前的操作都被清除干净(同样,我建议永远不要这样做!)。之后我使用vagrant box remove bento/centos7.2移除了虚拟机,并尝试重新执行vagrant up,结果得到了如下错误信息:

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.

环境

  1. Ubuntu 16.04
  2. Vagrant 1.81
  3. Centos 7.2 Box

尝试过的方法

下面是我尝试过的线程:

  1. vagrant + virtualbox等待虚拟机启动超时
  2. vagrant up等待虚拟机启动超时
  3. Vagrant "等待虚拟机启动超时"

当我启用GUI时,我发现虚拟机正确启动;只是卡在登录界面(由于SSH中的错误?)。屏幕截图:

enter image description here

非常感谢您的帮助。


我认为这是bento/centos-7.2盒子中的一个错误。我已经添加了config.vm.box_version = "2.2.9"以回滚到旧版本的盒子,它可以正常工作。 - PseudoAj
2个回答

0

产生此问题的可能性有多种:

  1. 尝试运行:

    vagrant reload

这将在虚拟机中重新安装guest-additions。

  1. 尝试打开Virtualbox(GUI界面)并打开virtualbox(控制台)。例如,如果该框等待fsck(文件系统检查),则可能会出现以下情况:

i)如果它是不正常关闭,则登录到Virtualbox GUI上的框中使用默认用户名/密码(通常为vagrant/vagrant),并确定框上的ssh服务器是否正在运行。

  1. 运行

    vagrant ssh-config

并查看它正在尝试使用哪个端口和哪个ssh密钥。手动使用它们,例如:

ssh -i <identity_key_location> vagrant@localhost -p 2222

0
请确保您的虚拟机管理器已经打开。
如果您需要连接到VPN,请确保VPN正常工作。
如果您的计算机运行时间超过预期,请增加超时值。
通常,我在解决这个问题时遇到了以上三个问题。
如果一切正常,请尝试重新启动您的计算机。

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