Windows 安裝 Homestead 遇到的一些坑點

yhs603發表於2020-02-18

安裝完VirtualBox及Vagrant,並在終端執行

vagrant box add laravel/homestead

後提示無法連線到的vagrantcloud-files-production.s3.amazonaws.com,很顯然是國外亞馬遜伺服器域名,被牆了…

C:\Users\SXZC>vagrant box add laravel/homestead
==> box: Loading metadata for box 'laravel/homestead'
    box: URL: https://vagrantcloud.com/laravel/homestead
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.

1) hyperv
2) parallels
3) virtualbox
4) vmware_desktop

Enter your choice: 3
==> box: Adding box 'laravel/homestead' (v9.2.0) for provider: virtualbox
    box: Downloading: https://vagrantcloud.com/laravel/boxes/homestead/versions/9.2.0/providers/virtualbox.box
    box: Download redirected to host: vagrantcloud-files-production.s3.amazonaws.com
    box:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Failed to connect to vagrantcloud-files-production.s3.amazonaws.com port 443: Timed out

解決方案:

  • 要麼使用第三方工具,比如迅雷,充會員的那種無需關注域名
  • 要麼更改本地hosts,將ip地址與ping後的域名一起解析,沒會員又用迅雷(檔案大),
  • 可能需要手動更改幾次本地hosts指向的ip,原因在於對於同一域名指向的固定ip若長時間請求,對方會拒絕,出現超時現象的假象或部分資料丟失

修改host檔案,新增一下內容:

52.216.113.203 s3-1-w.amazonaws.com

ping通後再次執行命令,如下:

C:\Users\SXZC>ping vagrantcloud-files-production.s3.amazonaws.com

正在 Ping s3-1-w.amazonaws.com [52.216.131.107] 具有 32 位元組的資料:
來自 52.216.131.107 的回覆: 位元組=32 時間=256ms TTL=33
來自 52.216.131.107 的回覆: 位元組=32 時間=264ms TTL=33
來自 52.216.131.107 的回覆: 位元組=32 時間=258ms TTL=33

52.216.131.107 的 Ping 統計資訊:
    資料包: 已傳送 = 3,已接收 = 3,丟失 = 0 (0% 丟失),
往返行程的估計時間(以毫秒為單位):
    最短 = 256ms,最長 = 264ms,平均 = 259ms
Control-C
^C
C:\Users\SXZC>vagrant box add laravel/homestead
==> box: Loading metadata for box 'laravel/homestead'
    box: URL: https://vagrantcloud.com/laravel/homestead
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.

1) hyperv
2) parallels
3) virtualbox
4) vmware_desktop

Enter your choice: 3
==> box: Adding box 'laravel/homestead' (v9.2.0) for provider: virtualbox
    box: Downloading: https://vagrantcloud.com/laravel/boxes/homestead/versions/9.2.0/providers/virtualbox.box
    box: Download redirected to host: vagrantcloud-files-production.s3.amazonaws.com
    box: Progress: 1% (Rate: 38395/s, Estimated time remaining: 8:03:55)  

等待下載完畢即可…

本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章