Vagrant 系列二: 錯誤處理

問題一

clipboard.png

clipboard.png
解決方法:ssh-keygen -t rsa
clipboard.pnggit

問題二

遇到這個問題,折騰很久,終於找到方法能夠解決,記錄一下。github

==> localvm2: Importing base box 'bigdatavm'...
==> localvm2: Matching MAC address for NAT networking...
==> localvm2: Setting the name of the VM: localvm2
==> localvm2: Fixed port collision for 22 => 2222. Now on port 2200.
==> localvm2: Clearing any previously set network interfaces...
==> localvm2: Preparing network interfaces based on configuration...
    localvm2: Adapter 1: nat
    localvm2: Adapter 2: hostonly
==> localvm2: Forwarding ports...
    localvm2: 22 (guest) => 2200 (host) (adapter 1)
==> localvm2: Running 'pre-boot' VM customizations...
==> localvm2: Booting VM...
==> localvm2: Waiting for machine to boot. This may take a few minutes...
    localvm2: SSH address: 127.0.0.1:2200
    localvm2: SSH username: vagrant
    localvm2: SSH auth method: private key

一直卡在SSH auth method: private key 而後就是timeoutssh

clipboard.png

第一步:打開cmd 進入Homestead 目錄,執行vagrant ssh-config查看IdentityFile路徑。spa

clipboard.png

刪除IdentityFile目錄下的private_key文件。命令行

第二步:執行 vagrant up 。不過又會遇到另外一個問題:
截圖不太完整,大概就是圖中內容,一堆的Retrying...vagrant

clipboard.png

這個時候雖然命令行界面卡住不動了,其實virtualbox 裏的虛擬機已經啓動了。這個時候打開虛擬機,輸入帳戶密碼進入~/.ssh目錄,執行如下命令:code

#進入.ssh目錄
cd ~/.ssh  

wget http://github.com/mitchellh/vagrant/raw/master/keys/vagrant

wget http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub

mv vagrant.pub authorized_keys

執行完成之後。回到cmd下,執行 vagrant reload --provision 能夠看到從新初始化界面,啓動成功。ip

相關文章
相關標籤/搜索