I'm running a CentOS 7 box, once after a yum update
, I got these errors when restart by vagrant reload
:
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
So I recognized that I should re-install the guest addition tools. In the console I have tried:
# /etc/init.d/vboxadd setup
Removing existing VirtualBox non-DKMS kernel modules [ OK ]
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
The missing package can be probably installed with
yum install kernel-devel-3.10.0-123.13.2.el7.x86_64
Building the main Guest Additions module [FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions [ OK ]
Something got wrong in building the guest additions. And also it told me that I should also update the kernel-devel
package. Off course I tried it:
yum install kernel-devel-3.10.0-123.13.2.el7.x86_64
Rerun the /etc/init.d/vboxadd setup
command after installed the kernel-devel
package, this time all were ok.