2016-12-05 47 views
17

我似乎無法讓宅基地運行。它掛在SSH身份驗證方法:私鑰。Laravel Homestead掛在SSH身份驗證方法:在Mac上的私鑰

Homestead VM啓動。我可以去VirtualBox並打開終端窗口並使用vagrant登錄:vagrant。

我不能無業遊民SSH,SSH [email protected]:2204或ssh [email protected] -p 2204

無我的文件夾在虛擬機上顯示,但VirtualBox的說,他們是映射。

每次我無業遊民了,我得到:

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. 

我代替我在我的箱子鑰匙宅基地不安全的私鑰。我看到很多人得到警告:連接超時。正在重試...,但我沒有那麼遠。

我在Mac 10.11.6

任何幫助將不勝感激!

+0

您可以打開virtualbox並檢查虛擬機在虛擬機中的狀態,它是否已完成啓動? –

+0

它被啓動。我可以打開VirtualBox VM屏幕並以流浪者身份登錄,無密碼。 –

回答

77

我今天在macOS 10.12上遇到了同樣的問題,並且試圖找到修復程序失去了6個小時。最後,一些的重新安裝,重新啓動,並經過反覆試驗,我不知怎麼把它按照以下步驟完全卸載工作...

  1. 並重新安裝放浪,VirtualBox的,和家園。
  2. 確保homestead-7框關閉VirtualBox的UI內
  3. 右鍵單擊homestead-7框,選擇設置
  4. 點擊「網絡」
  5. 在「適配器1」,這應附NAT,點擊「高級」
  6. 勾選「連接電纜」
  7. 保存設置旁邊的複選框,並另配宅基地與vagrant up --provision
  8. 運行vagrant reload --provision另配馬赫ine

這應該是!在此之後,我能夠通過SSH登錄,但無法通過瀏覽器查看Homestead網站(即使我配置了/etc/hosts文件),但Mac的簡單重新啓動似乎解決了這個問題。

鑑於我不知道究竟是什麼造成了這一點,這可能只是我的情況有點運氣,但讓我知道你如何繼續。

+17

步驟3-6爲我解決了這個問題!你是@Jack的救星! – schystz

+9

步驟3-6爲我解決了這個問題 - 但只是暫時的。銷燬和重新創建虛擬機需要每次執行步驟3-6。在我的Homestead dir中更新Vagrantfile對我來說是最好的解決方案:https://github.com/mitchellh/vagrant/issues/7648#issuecomment-235282382 –

+3

步驟3-6。你救了我的一天!我不能給你+50正面選票嗎? – oskarko

0

這裏什麼都沒有爲我工作。我遇到了SSH auth method: private key的情況,因爲我的mac黑屏蔽和崩潰。

所有爲我工作的是vagrant destroy然後vagrant up --provision。當心這當然會在你的VM中垃圾。但無論如何,你應該使用短暫的原則...

3

我有這個問題。我在BIOS中啓用了Vt-x並清除了它。

+0

Windows 10用戶在這裏,做了同樣的事情,它的工作 – Julien

0
  1. 打開VirtualBox UI並輸入虛擬機。
  2. 按Enter鍵使系統繼續啓動。

然後你可以看到陰道上升。