エラー内容
/vagrant
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:
mount -t vboxsf -o uid=500,gid=500 vagrant /vagrant
The error output from the command was:
/sbin/mount.vboxsf: mounting failed with the error: No such device
原因
hostOSとguestOSのバージョンが一致しない
vbguestプラグインをインストール
vagrant plugin install vagrant-vbguest
バージョン情報を確認
vagrant vbguest --status
[default] GuestAdditions versions on your host (5.2.4) and guest (4.3.30) do not match.
上記の場合、GuestOSのバージョンが古いことが確認できる
guestOSを更新する場合
vagrant vbguest
実行結果例
[default] GuestAdditions versions on your host (5.2.4) and guest (4.3.30) do not match.
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.cat.net
* epel: repo.ugm.ac.id
* extras: mirrors.cat.net
* remi-safe: ftp.riken.jp
* updates: mirrors.cat.net
Package kernel-devel-2.6.32-754.2.1.el6.x86_64 already installed and latest version
Package kernel-devel-2.6.32-754.2.1.el6.x86_64 already installed and latest version
Package gcc-4.4.7-23.el6.x86_64 already installed and latest version
Package binutils-2.20.51.0.2-5.48.el6.x86_64 already installed and latest version
Package 1:make-3.81-23.el6.x86_64 already installed and latest version
Package 4:perl-5.10.1-144.el6.x86_64 already installed and latest version
Package bzip2-1.0.5-7.el6_0.x86_64 already installed and latest version
Nothing to do
Copy iso file /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
Mounting Virtualbox Guest Additions ISO to: /mnt
Installing Virtualbox Guest Additions 5.2.4 - guest version is 4.3.30
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.2.4 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 4.3.30 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Starting.
/etc/init.d/vboxadd: line 256: : No such file or directory
Unmounting Virtualbox Guest Additions ISO from: /mnt
AttelanoMini:vagrant attela$ vagrant vbguest --status
[default] GuestAdditions 5.2.4 running --- OK.
hostOSを更新する場合
https://www.virtualbox.org/wiki/Downloads で最新版をインストール
vagrantを再起動
vagrant reload