mount -t vboxsf php,VirtualBox 升级到 5.0.16,遇到 共享文件夹挂载失败的错误:/sbin/mount.vboxsf: mounting failed with t...

如题:

Virtual Box 从 4.3.36 升级到 5.0.16 时,遇到 “共享文件夹挂载失败错误”:

/sbin/mount.vboxsf: mounting failed with the error: No such device

stackoverflow.com 上也有人遇到过这个问题:

Ubuntu 中的解决方案:

sudo vim /etc/rc.local

增加内容:

modprobe -a vboxguest vboxsf vboxvideo

还有注意的是,升级 VirtualBox 的时候,最好是先卸载老版本,再安装新版本,而不是直接安装新版本!

我本机 /etc/rc.local 文件内容汇总:

#!/bin/sh -e

#

# rc.local

#

# This script is executed at the end of each multiuser runlevel.

# Make sure that the script will "exit 0" on success or any other

# value on error.

#

# In order to enable or disable this script just change the execution

# bits.

#

# By default this script does nothing.

modprobe -a vboxguest vboxsf vboxvideo

mount -t vboxsf ubuntu /www -o uid="1000",gid="1000"

service nginx start

service mysqld start

exit 0