【问题标题】:Vagrant Machine stopped working流浪机器停止工作
【发布时间】:2016-01-25 14:11:32
【问题描述】:

我在 Laravel 中使用 Homestead 和 vagrant,一切正常,直到今天早上我试图启动机器并开始工作。 我收到此错误:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'laravel/homestead' is up to date...
==> 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 (guest) => 8000 (host) (adapter 1)
    default: 443 (guest) => 44300 (host) (adapter 1)
    default: 3306 (guest) => 33060 (host) (adapter 1)
    default: 5432 (guest) => 54320 (host) (adapter 1)
    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.

谁能帮我解决这个问题而无需重新安装?

我尝试过的:

  • 重新启动我的电脑
  • 关闭一些应用程序
  • 删除虚拟机
  • 关闭我的防火墙

VagrantFile content

【问题讨论】:

  • 你的端口对 Vagrant 来说是免费的吗?你的防火墙启用了吗?
  • @Schellingerht 如果我 100% 确定,我会告诉你是的,但它在上周工作。不知道有什么可以阻止 vagrant
  • 您可以尝试启用 gui 以查看是否可以发现启动时发生的情况。 vm.gui = true
  • 同样...==> default: VM not created. Moving on...

标签: php laravel frameworks vagrant homestead


【解决方案1】:

您的 vagrant 似乎无法使用私钥访问您的虚拟机:

  1. 在错误信息之后,尝试使用命令vagrant ssh 进入vagrant

--> 如果无需输入密码即可正常运行,则错误可能出在其他地方(请参阅使用config.vm.boot_timeout 的推荐设置)

  1. 也许您的私钥不在您 VM 的 known_hosts 列表中

    2.1 备份工作站中的私钥

a) 默认情况下,使用 UBUNTU-OS 时,文件位于~/.vagrant.d/insecure_private_key

b) 您也可以在vagrant up 之后运行命令vagrant ssh-config,以检索正在使用的private_key 的确切位置)

2.2 删除文件并重启vagrant

vagrant reloadvagrant reload --provision

vagrant 会尝试为你重新生成一个新的私钥。

  1. 已编辑

根据您添加的 vagrantfile : 您还应该类似于以下示例配置网络(删除 # 并检查您的 vagrantfile 的内容是否类似于下面的示例):

MY_IP_ADDRESS = '10.11.12.15'

Vagrant.configure(2) do |config|

    config.vm.box = "base"
    config.vm.network :private_network, ip: MY_IP_ADDRESS
    config.ssh.forward_agent = true

end
  1. 您应该选中您正在使用的框,可能该框不存在

示例"hashicorp/precise64"

请查看 vagrant-documentation @https://www.vagrantup.com/docs/boxes.html

【讨论】:

  • $ vagrant ssh VM must be created before running this command. Run 'vagrant up' first.
  • 看来我的 Vagrant 机器已经不在了。还是没找到,就真的知道这个幕后工作原理了$ vagrant reload --provision==> default: VM not created. Moving on...
  • 你能提供你的流浪文件的内容吗?如果你有 Virtualbox,你可以很容易地检查你的盒子是否正在运行
  • 查看编辑后的帖子,看看我的内容是否正确
  • 您从哪个目录运行vagrant up ?你应该会看到一个名为 Vagrantfile 的文件
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-04-01
相关资源
最近更新 更多