LoginSignup
4
4

More than 3 years have passed since last update.

Windows10 proのVagrant+VirtualBoxでvagrant upできなくなったときのメモ

Posted at

状況

Windows10pro+Vagrant2.2.4+VirtualBox6.0.8で動かしていたVMを久々にvagrant upで起動

==> xxx: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "fe623649-8ae4-42fc-8725-d9a2049a4371", "--type", "headless"]

Stderr: VBoxManage.exe: error: Call to WHvSetupPartition failed: ERROR_SUCCESS (Last=0xc000000d/87) (VERR_NEM_VM_CREATE_FAILED)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole

え、なんかやったっけ????

やったこと

  1. Vagrantの再インストール
    Vagrantの最新バージョンが2.2.5になってるから再インストールしてみた結果ダメ

  2. VirtualBoxの再インストール
    なんか設定弄ったかな・・・再インストールしてもダメ

  3. VMがおかしくなったか・・・?
    VMをdestroyして再構築してもダメ

  4. Boxがおかしくなったか・・・?
    Boxを削除して再構築してもダメ

  5. ネットワークの設定か・・・?
    VirtualBox Host-Only Networkの設定見直したが問題なし

  6. ググる
    Windows Sandboxをインストールしてから、仮想化ソフトの仮想マシンが起動しなくなりました。【Ver1903】
    そういやwindowsを1903にしたりsandbox有効化したの忘れてた。
    sandboxを無効化して再起動後、実行してみたがダメ

  7. Hyper-V関連の機能を無効化
    管理者権限のpowershellで下記を実行してvagrant upを実行→ダメ

    Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All

  8. ここから再起動が必要?
    Windows10上のVirtualBoxがエラー吐いた時の備忘録

    コマンドの内容としては、Hyper-V関連すべての停止
    そして、また再起動。

4~5回目くらいの再起動を行う。

.........

できた!!

終わり

Hyper-V関連は業務上では使わないのでこれで良しとする。
Docker for Windowsを入れようか迷ったときに思ったけどやっぱりMacで開発&インフラ構築が良いね。。。

あとあと調べたらHyper-V使わずにDocker for Windows使う方法ってあるのね。
まーでもVagrant+VirtualBoxで構築したゲストOS上でDocker使うようにしたし、
Macだったらそもそもこの煩わしさはないのでやっぱりMacやなぁ・・・!

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4