mount: unknown filesystem type 'vboxsf' centos ubuntu 处理方案

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=1000,gid=1000 vagrant /vagrant

The error output from the command was:

mount: unknown filesystem type 'vboxsf'

可能大家在使用vagrant的时候经常遇到以上提示,这个时候只是共享目录无法使用,虚拟机已经在运行了

vagrant ssh # 进入虚拟机

下面是我处理的方法,贴出来与大家分享;

以下的方案都需要进入虚拟机里面执行

ubuntu系统处理方案

sudo apt-get update

sudo apt-get install virtualbox-guest-utils

以上两条代码,ubuntu系统我就处理好了。

centos系统处理方案(mac版)

sudo yum update
sudo yum install gcc
sudo yum install kernel-devel

exit #退出虚拟机
vagrant halt # 关闭虚拟机

加载 VBoxGuestAdditions.iso 镜像并挂载

该镜像位于VirtualBox安装文件夹下,可以全文件搜索

sudo find / -name VBoxGuestAdditions.iso 

将CD进行挂载

mount /dev/cdrom /cdrom #(该cdrom是我在/目录下创建的文件夹)

进入cdrom并运行相关程序。

cd /cdrom; 
sh ./VBoxLinuxAdditions.run

等待程序安装完毕,VirtualBox增强功能软件就在系统中安装完毕

重启虚拟机

vagrant up

这个时候再次启动,应该就不会再报这个错误了、、、