VirtualBoxのバージョンとGuest additionsのバージョンが一致せず、共有フォルダのマウントに失敗する際の対処法。
エラー内容
vagrant up すると以下のような共有フォルダのマウントに失敗したエラーメッセージが表示される。
GuestAdditions versions on your host (5.0.10) and guest (4.3.6) do not match.
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.
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:
mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant
The error output from the last command was:
/sbin/mount.vboxsf: mounting failed with the error: No such device
対処法
vagrant-vbguest の自動更新をOFFになるようVagrantfile内で設定する。
Vagrantfile
# 以下を追記。
config.vbguest.auto_update = false
(※vagrant up済みの場合は、vagrant destoryで破棄し、再upする必要があります。)