記一次 vagrant up 報錯解決

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> 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: 22 (guest) => 2200 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.

If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run `vagrant up` while the
VirtualBox GUI is open.

The primary issue for this error is that the provider you're using
is not properly configured. This is very rarely a Vagrant issue.

vargant up啟動的時候遇到上述報錯,無法啟動虛擬機。

報錯了咋辦呢,按照提示去解決唄……

Valid states are 'starting, running'. The machine is in the 'poweroff' state.

If the provider you're using has a GUI that comes with it, it is often helpful to open that and watch the machine。

The primary issue for this error is that the provider you're using is not properly configured. This

VirtualBox是Vagrant默認的Provider,提示信息是讓打開Vagrant的GUI排查看看,為啥虛擬機一直處于‘關(guān)機狀態(tài)’。原因八九成就是VirtualBox設(shè)置不正確。

那就打開VirtualBox唄,找到對應(yīng)的虛擬機,在GUI界面上點啟動看看。

image.png

點啟動,看到上述警告,出了個警告,說沒有找到USB 2.0控制器,以及2個解決問題的方法(據(jù)說USB 2.0組件不開源,所以必須從完全開源的VirtualBox主體中分離):

  1. 安裝‘Oracle VM VirtualBox Extension Pack’
  2. 在虛擬機設(shè)置中禁用USB 2.0 (只能用USB 1.1)

這就好辦了,這里我使用的是第二種方法。找到

image.png

再回到終端,執(zhí)行 vagrant up,發(fā)現(xiàn)ok了。

總結(jié):很多時候,遇到問題不必馬上借助搜索引擎,照著報錯信息提示試試,說不定很簡單就解決了。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容