您的位置:首页 > 运维架构 > Linux

virtualbox中ubuntu与主机共享文件夹设置

2015-04-27 17:31 471 查看
[一]

virtualbox4.3.12版(ubuntu14.04)增强功能安装中如果遇到以下错误:

可以尝试下载4.3.16版增强功能,挂载到系统中后重新安装。

重装显示:

Removing existing VirtualBox DKMS kernel modules ...done.

Removing existing VirtualBox non-DKMS kernel modules ...done.

Copying additional installer modules ...

Installing additional modules ...

Removing existing VirtualBox DKMS kernel modules ...done.

Removing existing VirtualBox non-DKMS kernel modules ...done.

Building the VirtualBox Guest Additions kernel modules ...done.

Doing non-kernel setup of the Guest Additions ...done.

You should restart your guest to make sure the new modules are actually used

Installing the Window System drivers

Installing X.Org Server 1.16 modules ...done.

Setting up the Window System to use the Guest Additions ...done.

You may need to restart the hal service and the Window System (or just restart

the guest system) to enable the Guest Additions.

Installing graphics libraries and desktop services components ...done.

成功。

[二] (转自http://blog.csdn.net/wzwind/article/details/6656331)

如果在Building VirtualBox Guest Additions kernel modules的时候,缺少kernal的头文件,

使用下面的命令安装(否则跳至[三]):

引用

sudo apt-get install dkms build-essential linux-headers-$(uname -r)

其实build-essential linux-headers已经是最新的了,只是缺少dkms(Dynamic Kernel Module Support),当有新的kernal安装的时候,它能让kernal的设备驱动自动的重新构建。
详情见:http://en.wikipedia.org/wiki/Dynamic_Kernel_Module_Support
之后再

引用

sudo /etc/init.d/vboxadd setup

成功

[三](部分参考http://www.linuxidc.com/Linux/2011-12/50241.htm)

挂载共享文件夹

进入虚拟Ubuntu,在命令行终端下输入:

sudo mkdir /mnt/share

sudo mount -t vboxsf download /mnt/share

其中"download"是之前创建的共享文件夹的名字,也就是在分配数据空间的时候显示的名称。

要想自动挂载的话,可以在/etc/fstab中添加一项(记得更换相应文件夹名称)

download /mnt/share vboxsf rw,gid=100,uid=1000,auto 0 0

卸载命令:

sudo umount -f /mnt/share
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息