4ヶ月くらい起動していなかったVirtualBoxで久々に開発をしようと思ったらエラーが発生しました。 ネット上の情報はあまりなく、下記のいずれかでした。Bはいつの時点に戻すか分からなかったので、Aでやることにしました。

(A)VirtualBoxを再インストール。

(B)Windowsの復元機能を使って、Windowsアップデート前の状態にする。

0. 環境

[OS] Windows7 (32bit)

[VirtualBox] 4.3.26 -> 5.2.32

[Vagrant] 1.7.2 -> 2.2.5

1. 問題

  • VagrantからVirtualBoxを起動する構成です。(詳細はこちら)

  • いつものようにvagrant upvagrant resumeでVirtualBoxを起動しようとしたところ、このエラーが出ました。

    error_22838

    • エラーメッセージ

      supHardenedWinVerifyProcess failed with VERR_ASN1_CURSOR_TAG_MISMATCH: (rc=-22838)
      

2. 対応

  • 内部エラーで複雑そうなので、一度VirtualBoxをアンインストールし、新しいバージョンをインストールしました。

    • 32bit OSに対応してて、新し目のバージョン5.2.32を選択しました。(5.2.32のWindows hostsをクリック)

    • 64bit OSを使ってる方は、もっと新しいバージョンの方がいいと思います。

  • VirtualBoxを再インストール後、vagrant upを実行すると下記エラーメッセージが表示されました。

    • エラーメッセージ

      The provider 'virtualbox' that was requested to back the machine
      'default' is reporting that it isn't usable on this system. The
      reason is shown below:
      
      Vagrant has detected that you have a version of VirtualBox installed
      that is not supported. Please install one of the supported versions
      listed below to use Vagrant:
      
      4.0, 4.1, 4.2, 4.3
      
    • 現在のVagrantのバージョン(1.7.2)だと、上記バージョンのVirtualBoxにしか対応できないようです。

    • VirtualBoxをバージョンダウンするより、Vagrantを上げた方がいいだろうと思って、一度Vagrantをアンインストールした後、下記から最新版を落としてきてインストールしました。(該当するOSとアーキテクチャのリンクからダウンロード。Download Vagrant)

  • Vagrantを再インストール後、再びvagrant upするとまたエラーが出ました。

    • エラーメッセージ

      Vagrant failed to initialize at a very early stage:
              
      The version of powershell currently installed on this host is less than the required minimum version. Please upgrade the installed version of powershell to the minimum required version and run the command again.
      
      Installed version: 2
      
      Minimum required version: 3
      
    • Vagrantをバージョンアップしたら今度はpowershellが対応できなくなったようです・・・

  • powershell ver3以上ということなので、下記の記事を参考にver4をインストールしました。(参考記事3-2、 3-3)

    • 参考記事3-3のインストール・ウィザードに関して、僕の環境は32bit OSだったので、Windows6.1-KB2819745-x86-MultiPkg.msuを選択。(64bit版の場合、Windows6.1-KB2819745-x64-MultiPkg.msu)

    • これでようやく復旧しました。

3. 参考にした記事