Vagrant怎么知道机器已经启动了?

时间:2017-02-13 12:15:16

标签: vagrant

我正在使用VMWare Fusion提供商设置Vagrant盒子。我正在使用加载Ubuntu 16.04 LTS服务器64位框。我无法启动机器,我想知道,Vagrant如何检测到机器已启动?

1 个答案:

答案 0 :(得分:0)

vagrant只是使用ssh命令循环到VM,看看这个命令的答案是什么。

您可以查看source code了解具体实施情况

您可以在运行vagrant up时看到默认输出;它会重试几次,直到它可以发出ssh命令

==> app1: Booting VM...
==> app1: Waiting for machine to boot. This may take a few minutes...
    app1: SSH address: 127.0.0.1:2222
    app1: SSH username: vagrant
    app1: SSH auth method: private key
    app1: Warning: Remote connection disconnect. Retrying...
    app1: Warning: Remote connection disconnect. Retrying...
    app1: Warning: Remote connection disconnect. Retrying...
==> app1: Machine booted and ready!