linux - Vagrant 并重新加载 - 默认 : Warning: Connection timeout. 正在重试...

标签 linux vagrant virtualbox

我已经使用了三个月的功能齐全的 vagrant,但在过去的三天里,每当我尝试运行 vagrant up 或 vagrant reload 时,我都会遇到错误。

这是我在运行 vagrant reload 时遇到的错误

default: Attempting graceful shutdown of VM...
default: Guest communication could not be established! This is usually because
default: SSH is not running, the authentication information was changed,
default: or some other networking issue. Vagrant will force halt, if
default: capable.
default: Forcing shutdown of VM...
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: 80 => 8080 (adapter 1)
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.

我正在使用 Elementary OS Luna,并按照一些建议的答案更新了最新版本的 vagrant 和 virtualbox。但问题依然存在。

我已经尝试了大多数流行的解决方案,包括启用 GUI 和 this .我还尝试了给出的解决方案 here但不能,因为我的虚拟盒子没有登录。

但是,GUI 向我展示了这个:

 keys: press S to skip mounting or M for manual recovery

我一个一个地尝试了两个键,但问题仍然存在。

之前有没有人遇到过可以提供解决方案的人,vagrant 在网络上还没有被广泛覆盖,我找不到发生这种情况的原因。

最佳答案

在针对不同问题尝试了各种可用选项之后,我仍然面临同样的问题。 最后,我做了一个

vagrant destroy

其次是

vagrant up

然后我的系统又开始工作了。

注意:如果你也有直接关机的习惯,你可能很快就会遇到这个问题!在您的 vagrant 终端 (vagrant ssh) 中,始终执行以下操作:

sudo shutdown -h now

或者你可以直接输入

vagrant halt

从您的 ssh 注销后。

PS:对于那些可能害怕在 vagrant destroy 期间丢失数据/代码/任何东西的人,您可以放松一下!我对使用该命令犹豫不决,但根据文档,它所做的只是:

This command stops the running machine Vagrant is managing and destroys all resources that were created during the machine creation process. After running this command, your computer should be left at a clean state, as if you never created the guest machine in the first place.

这意味着您的代码将保持不变,下一个 vagrant up 会将您带到与离开时相同的状态,只是现在问题已解决。 :)

关于linux - Vagrant 并重新加载 - 默认 : Warning: Connection timeout. 正在重试...,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28211030/

相关文章:

linux - Bash:预期的整数表达式

linux - 在 Ubuntu 16.04 上模拟 SLURM

linux - VirtualBox(Ubuntu) 与实际 Ubuntu 的比较

vagrant - 从文件系统中删除 Vagrant 盒子后,如何从全局状态中删除该盒子?

linux - X11:以另一个用户身份运行 gnome 应用程序

linux - 在 Linux 中使用单词定界符拆分和重命名文件

Gitlab git push 因 Vagrant 管理的 Virtualbox 而失败

android - 是否可以在virtualbox中运行android studio?

linux - 堆栈中存储哪些系统数据

amazon-web-services - AWS、Packer、Vagrant 和 Chef 它们如何协同工作?