偶然出现错误:
Failed to mount folders in Linux guest. This is usually becausethe "vboxsf" file system is not available. Please verify thatthe guest additions are properly installed in the guest andcan work properly. The command attempted was:mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrantmount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrantThe error output from the last command was:/sbin/mount.vboxsf: mounting failed with the error: No such device
[root@localhost ~]# yum update -y[root@localhost ~]# yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) dkms -y#再來就是安裝 VirtualBox Guest Additions kernel modules[root@localhost ~]# /etc/init.d/vboxadd setupRemoving existing VirtualBox DKMS kernel modules [ OK ]Removing existing VirtualBox non-DKMS kernel modules [ OK ]Building the VirtualBox Guest Additions kernel modules [ OK ]Doing non-kernel setup of the Guest Additions [ OK ]Starting the VirtualBox Guest Additions [ OK ][root@localhost ~]#
再來就可以重新啟動 Guest OS 確認啟動過程,應該就可以正常掛載 /vagrant 目錄了。
$ vagrant reload