【エラー】vagrant upで起動しようとすると「The guest additions on this VM do not match the installed version」と怒られる

スポンサーリンク

コンテンツ

エラーメッセージ 全文

==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.

適当な翻訳

PCで使用しているVirtualBOXのguest additionsのバージョンと、vagrantで起動しようとしているイメージのguest additionsのバージョンが違います。
このエラーが出ても多くの場合問題はありません。しかし、まれにVirtualBOXの共有フォルダーの機能を使うときにエラーが出るかもしれません。
もし共有フォルダーの機能を使おうとしてエラーが出た時は、vagrantで起動しようとしているイメージのguest additionsのバージョンと、
PCで使用しているVirtualBOXのguest additionsのバージョンを同じものにした上で、イメージを再起動してください。

原因

使用しているVirtualBOXのguest additionsのバージョンと、vagrantで作っているイメージの中のguest additionsのバージョンが違うので怒っています。
致命的なエラーではないみたいです。

対処

以下のコマンドを実行するとOKでした

vagrant plugin install vagrant-vbguest
vagrant vbguest

以下のページが参考になりました。ありがとうございます!
VagrantのboxのGuest Additionsのアップデート方法 – Qiita