Debian on VirtualBox共享win7文件夹

来源:互联网 发布:网络诈骗举报网站 编辑:程序博客网 时间:2024/06/05 06:27

原文地址:http://www.dbasoul.com/2010/694.html
http://www.cnblogs.com/hanxi/archive/2012/05/26/2519514.html
http://www.huomo.cn/os/article-19991.html

如果是一个全新的Debian系统,直接安装VirtualBox的Guest Additions,可能会失败,这是因为VirtualBox增强功能需要编译链接工具。
启动debian虚拟机时记得先加载debian安装光盘
aptitude install build-essential linux-headers-`uname -r` dkms
重启后加载增强功能光盘
cd /cdrom
sh ./VBoxLinuxAdditions.run
其中,有个警告说是系统不支持OpenGL。重启,增强功能包安装完成。

mkdir /mnt/shared
mount -t vboxsf share /mnt/shared
share是之前创建的共享文件夹的名字。
umount /mnt/shared

编辑/etc/fstab,自动挂载
share /mnt/shared vboxsf rw,gid=100,uid=1000,auto 0 0

安装时遇到提示:
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
 ...fail!
有可能是没有安装dkms。

如果共享文件夹名称和挂载点名称相同,在挂载时会出现如下的错误信息:
/sbin/mount.vboxsf: mounting failed with the error: Protocol error