以前、mountエラーがあったときに、Vagrant mountエラーここに書いた方法で解決できたが、これをやっても解決できない。
vagrant reloadしても下記エラーがでる。
あと、もう一つ解決策がのってた。 vagrantでmountエラーの解決方法
vboxをリビルドする必要があるということで、vagrant sshして、下記を実行する。
sudo /etc/init.d/vboxadd setup Removing existing VirtualBox non-DKMS kernel modules [ OK ] Building the VirtualBox Guest Additions kernel modules Building the main Guest Additions module [ OK ] Building the shared folder support module [ OK ] Building the OpenGL support module [失敗] (Look at /var/log/vboxadd-install.log to find out what went wrong) Doing non-kernel setup of the Guest Additions [ OK ] exit
でも、これは以前の解決策でも、vagrant reload中に勝手に実行してくれる内容と一緒っぽい。上記は、Building the main Guest Additions moduleが成功しているが、現在自分の環境だと失敗する。
下記で、ログを見ると下記のようになっている。
vi /var/log/vboxadd-install.log
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
/tmp/vbox.0/Makefile.include.header:97: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=
もう一つ、解決策につながりそうなサイトがあった。 ヾ(o゚ω゚o)ノ゙Vagrantの共有ディレクトリ設定でものすっごい躓いた!
vagrant-vbguestというプラグインがあると、vbguestコマンドが使えるようになる。
$ vagrant vbguest --status
$ vagrant vbguest --auto-reboot
これでも、Building the main Guest Additions module[FAILED]になる。
参考:CentOSへGuest Additionsをインストールしたときのエラー対処方法
カーネルと必要なパッケージをインストールします。
$ yum -y update kernel $ yum -y install kernel-devel kernel-headers dkms gcc gcc-c++
インストール後にOSを再起動します。
これで、vagrant reloadしたらmountエラーがなくなった。