无法启动 vagrant 实例

无法启动 vagrant 实例

我已经在 vagrant 中安装了 trusty64,但在尝试启动时vagrant up无法通过 SSH 连接。它说的是关于 SSH Time 但我确信它与 SSH 连接无关

请检查下面的日志

sniper@openstackm1:/playbooks$ 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: Forwarding ports...
    default: 22 (guest) => 2222 (host) (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

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

有同样的问题。注意到我的 VirtualBox 选项列表中没有 64 位 Linux。尝试转到 Bios 并启用 Intel 虚拟化技术。对我有用。

答案2

提供Vagrantfile有关 Vagrant 提供者的信息会更容易。配置 Vagrant、providers 和大量盒子的方法有很多种。


我假设您正在使用默认的 VirtualBox 提供程序

最重要的消息是等待机器启动时超时。。 Vagrant 正在尝试连接到机器(通过 127.0.0.1:2222),但由于某种我们尚不知道的原因而无法连接。

诊断的一些步骤:

  1. 打开 VirtualBox GUI,打开您的访客计算机并验证其已启动并准备好登录。

  2. vagrant 您可能应该使用登录名和密码登录机器控制台vagrant。 (一些 Ubuntu 盒子使用登录ubuntu.

  3. 如果您能够以vagrant用户身份登录,请检查虚拟机中的网络。网络应该已启动,您应该能够连接到外部世界。

  4. 检查您的虚拟机是否正在运行 ssh 并接受端口 22 上的连接。

  5. 检查到 127.0.0.1:2222 的 TCP 连接(在您的主机上)是否已转发到您的访客。它应该在 VirtualBox 机器设置(网络中的某个位置)中设置。

  6. 测试另一个 Vagrant 盒子。我更喜欢吉尔林盖伊/ubuntu1404就我个人而言,因为我不喜欢 Ubuntu 不使用标准用户的方法vagrant

如果其中某些步骤显示失败,请尝试找出问题隐藏的位置。

相关内容