在执行 vagrant up 时出现下面的错误

1
2
3
4
5
6
7
Failed to mount folders in Linux guest. This is usually beacuse
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 apache | cut -d: -f3`,dmode=777,fmode=777 /vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g apache`,dmode=777,fmode=777 /vagrant /vagrant

解决方法:

1
2
3
4
sudo /etc/init.d/vboxadd setup
# 中略 结果应全部ok
vagrant halt
vagrant up

中间如果有问题会提示你查看日志,可能会出现的问题有:没有安装kernel-devel,或者是没有安装编译环境等。