Failed to mount folders in Linux guestのエラー対応

Vagrant でCentOS7環境を作ってたら、vagrant up時にvboxエラーが発生したので対応したメモ

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`,dmode=777,fmode=666 vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant`,dmode=777,fmode=666 vagrant /vagrant

The error output from the last command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device

対応

$ vagrant destroy
$ vim ~/.vagrant.d/Vagrantfile
Vagrantfileに書き込み
Vagrant.configure("2") do |config|
  config.vbguest.auto_update = false
end
$ vagrant up

そもそも何故出るのか?

  • Guest Addition という、hostとguestの共有フォルダをサポートするモジュールのようです。
  • そのモジュールがhostとguestでバージョンが違う事でエラーが出ているのか?
  • 対応としては、vbguestの更新を行わないという対応

参考とさせて頂きました

http://www.utano.jp/entry/2014/11/vagrant_guest_additions_update_error

vagrant起動で"Failed to mount folders in Linux guest"のエラーが出た件 - めもめも のーと