Laravel Homestead hangs at SSH auth method: privat

2019-01-30 19:50发布

I can't seem to get Homestead running. It hangs at SSH auth method: private key.

The Homestead VM starts. I can go to VirtualBox and open the terminal window and login with vagrant:vagrant.

I can't vagrant ssh, ssh vagrant@127.0.0.1:2204 or ssh vagrant@127.0.0.1 -p 2204.

None of my folders show up in the VM, but the VirtualBox says they are mapped.

Every time I vagrant up, I get:

vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Checking if box 'laravel/homestead' is up to date...
==> homestead-7: Clearing any previously set forwarded ports...
==> homestead-7: Fixed port collision for 80 => 8000. Now on port 2200.
==> homestead-7: Fixed port collision for 443 => 44300. Now on port 2201.
==> homestead-7: Fixed port collision for 3306 => 33060. Now on port 2202.
==> homestead-7: Fixed port collision for 5432 => 54320. Now on port 2203.
==> homestead-7: Fixed port collision for 22 => 2222. Now on port 2204.
==> homestead-7: Clearing any previously set network interfaces...
==> homestead-7: Preparing network interfaces based on configuration...
    homestead-7: Adapter 1: nat
    homestead-7: Adapter 2: hostonly
==> homestead-7: Forwarding ports...
    homestead-7: 80 (guest) => 2200 (host) (adapter 1)
    homestead-7: 443 (guest) => 2201 (host) (adapter 1)
    homestead-7: 3306 (guest) => 2202 (host) (adapter 1)
    homestead-7: 5432 (guest) => 2203 (host) (adapter 1)
    homestead-7: 22 (guest) => 2204 (host) (adapter 1)
==> homestead-7: Running 'pre-boot' VM customizations...
==> homestead-7: Booting VM...
==> homestead-7: Waiting for machine to boot. This may take a few minutes...
    homestead-7: SSH address: 127.0.0.1:2204
    homestead-7: SSH username: vagrant
    homestead-7: 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.

I replaced the homestead insecure private key with my key on my box. I see a lot of people get Warning: Connection timeout. Retrying..., but I don't get that far.

I'm on a mac 10.11.6

Any help would be greatly appreciated!

7条回答
叼着烟拽天下
2楼-- · 2019-01-30 20:21

Nothing here worked for me. I got into the situation of SSH auth method: private key because my mac black screened and crashed.

All that worked for me was a vagrant destroy then vagrant up --provision. Beware this will of course trash anything in your VM. but you should be using ephemeral principles anyway...

查看更多
Animai°情兽
3楼-- · 2019-01-30 20:22

I had to do a fsck. (disclaimer, I typed the commands from memory)

  1. Open VirtualBox UI and enter the virtual machine.
  2. If you see (initramfs), type exit
  3. fsck /dev/mapper/vagrant-vg-root -y
  4. reboot

Go back to your normal terminal and try a:

vagrant halt
vagrant up

For me, things were back to normal from here.

查看更多
Luminary・发光体
4楼-- · 2019-01-30 20:27

Enable "Virtualization Technology" in BIOS settings

查看更多
Anthone
5楼-- · 2019-01-30 20:35
  1. Open VirtualBox UI and enter the virtual machine.
  2. press Enter key to make system continue to boot.

And then you can see the vagrant up going on.

查看更多
兄弟一词,经得起流年.
6楼-- · 2019-01-30 20:39

I had this problem. I enabled Vt-x in the bios and it cleared it.

查看更多
相关推荐>>
7楼-- · 2019-01-30 20:42

Vagrant 2.1.2

vagrant destroy then vagrant up --provision worked for me.

I have noticed that it usually happens when new version of vagrant released

查看更多
登录 后发表回答