My days of...

生活のことなど

VagrantでCentOSのyum updateしたらエラーが出るようになった


Vagrantでエラーが出ました

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

 

こちらで紹介されている内容によると、アップデートしたことが原因のようです。

現在の環境
VirtualBox 5
Vagrant
にCentOS7をインストール。

yum updateをして、カーネルアップデート、GuestAdditionにエラー、vboxsfが変だよ、みたいな感じらしい。

解決方法もそのまま上記の通り行いました。
vagrant upし、vagrant sshでゲストOS側へ
$ sudo yum install kernel-devel
$ sudo yum install gcc make

ログアウトし、vagrant haltしてから、ホストOS側で
vagrant plugin install vagrant-vbguest
vagrant vbguest


GuestAdditions versions on your host (5.0.0) and guest (4.3.20) do not match.
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.jaist.ac.jp
* epel: ftp.tsukuba.wide.ad.jp
* extras: ftp.jaist.ac.jp
* remi-safe: remi.kazukioishi.net
* updates: ftp.jaist.ac.jp
Package kernel-devel-3.10.0-229.7.2.el7.x86_64 already installed and latest version
Package gcc-4.8.3-9.el7.x86_64 already installed and latest version
Package 1:make-3.82-21.el7.x86_64 already installed and latest version
Package 4:perl-5.16.3-285.el7.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
mount: /dev/loop0 is write-protected, mounting read-only
Installing Virtualbox Guest Additions 5.0.0 - guest version is 4.3.20
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.0.0 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.3.20 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
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[ OK ]
Doing non-kernel setup of the Guest Additions[ OK ]
Starting the VirtualBox Guest Additions [ OK ]
Installing the Window System drivers
Could not find the X.Org or XFree86 Window System, skipping.
An error occurred during installation of VirtualBox Guest Additions 5.0.0. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.

こんな風になりましたが、多分大丈夫っぽい。Windowsの場合はわかんないけど、みたいな状況のようです。

 

 

実践 Vagrant

実践 Vagrant