$ 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主體中分離):
- 安裝‘Oracle VM VirtualBox Extension Pack’
- 在虛擬機設(shè)置中禁用USB 2.0 (只能用USB 1.1)
這就好辦了,這里我使用的是第二種方法。找到

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