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
這個時候再次啟動,應該就不會再報這個錯誤了、、、