1.若想删除挂载,可执行命令

umount -f /mnt/share
2.若想开机自动挂载,可以在 /etc/fstab 文件末添加一项    
sharing /mnt/share vboxsf defaults 0 0
sharing /mnt/share vboxsf rw,gid=100,uid=1000,auto 0 0

3.为了方便,可以在桌面上新建一个文件,内容为:

#!/bin/sh  sudo mount -t vboxsf sharing /mnt/share
以上资料是从网上摘录的,对于“开机自动挂载”模块,我试了好多遍都以失败告终,大部分网络资料都是说在 /etc/fstab 文件中追加
VirtualBox虚拟机文件夹共享挂载命令 “ sharing /mnt/share vboxsf defaults 0 0 ”,其实是错误的,
因为系统调用fstab的时候,Virtualbox的共享目录的模块还没有加载,所以每次加载都会失败,最终的解决方案如下:

在文件 /etc/rc.local 中(用root用户)追加如下命令

mount -t vboxsf sharing /mnt/share

最后重启系统,大功告成!!!

另外,在 VirtualBox 4.x 版本中,已有一个“自动挂载”功能,如下图所示:

再使用命令 mount ,得如下挂载信息:


[jianbao@localhost ~]$ mount
/dev/sda1 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda2 on /home type ext3 (rw)
sharing on /mnt/share type vboxsf (uid=1000,gid=100,rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
htdocs on /media/sf_htdocs type vboxsf (gid=501,rw)
sharing on /media/sf_sharing type vboxsf (gid=501,rw)

它自动把这些共享文件夹挂载到 /media/ ,目录下了,我想要说的是,这个挂载目录不是我想要的,

所以我没采用VirtualBox的自动挂载功能(因为挂载目录自己不可控)。

http://blog.csdn.net/u013394556/article/details/49894999

virtualbox下ubuntu共享文件夹自动挂载的更多相关文章

  1. 【转】VirtualBox下Ubuntu共享文件

    原文网址:http://www.it165.net/os/html/201209/3435.html 今天想从主机上拷贝几个文件到 VirtualBox 的 Ubuntu 下, 但是, Virtual ...

  2. Virtualbox虚拟机Ubuntu共享文件夹设置 自动挂载

    1. 安装增强功能包(Guest Additions) 安装好Ubuntu 14.04 后,运行Ubuntu并登录.然后在VirtualBox的菜单里选择"设备(D)" -> ...

  3. XP下Virtualbox虚拟Ubuntu共享文件夹设置

    环境:主机操作系统是Windows XP,虚拟机是Ubuntu 8.10,虚拟机是VirtualBox 2.1.0. 1. 安装增强功能包(Guest Additions) 安装好Ubuntu 8.1 ...

  4. win7/8下VirtualBox虚拟Ubuntu共享文件夹设置

    实验环境: 主机:win8.1 虚拟机软件:VirtualBox4.3 虚拟的主机:centos6.5 final 亲测可用! 1. 安装增强功能包(VBoxGuestAdditions)  打开虚拟 ...

  5. VirtualBox 设置共享文件夹自动挂载

    1.在VirtualBox中设置文件夹位置和名称,这里使用的名称是share 1.在ubuntu12.04的/etc/rc.local中加入自动挂载命令 sudo mount -t vboxsf sh ...

  6. Virtualbox虚拟Ubuntu共享文件夹设置

    1. 启动ubuntu, 然后先virtualbox的安装增强功能,菜单:“设备(D)”-> "安装增强功能":然后进入ubuntu 系统,安装Vboxadditions_. ...

  7. Windows7用VirtualBox虚拟Ubuntu共享文件夹的终极方式

    在Win7用VirtualBox虚拟机安装Ubuntu后,共享文件夹再也不用手工mount了 安装增强工具包 设置共享文件夹后 VB已经自动挂载Windows文件夹到 /media/sf_*** 目录 ...

  8. VirtualBox上Ubuntu 共享文件夹

    1. virtualbox 菜单栏中设备-->共享文件夹,添加一个共享文件夹,比如共享文件夹路径是D:/share,共享文件夹名称是share. 2. 进入虚拟Ubuntu,在命令行终端输入: ...

  9. 虚拟机下Ubuntu共享文件夹不能显示的一种解决方法

    原文链接:https://blog.csdn.net/huyangzhilin/article/details/70666937

随机推荐

  1. u-boot-2011.06在基于s3c2440开发板的移植之引导内核与加载根文件系统

    http://www.linuxidc.com/Linux/2012-09/70510.htm  来源:Linux社区  作者:赵春江 uboot最主要的功能就是能够引导内核启动.本文就介绍如何实现该 ...

  2. 34、uevent机制说明

    class_device_create(4.3.2内核是device_create->device_create_vargs->device_register->device_add ...

  3. VS提示SurfFeatureDetector不是cv的成员函数 .

    原因:没有把 opencv_nonfree243d.lib 加入lib库中. 还有两个头文件:#include <opencv2/nonfree/features2d.hpp>#inclu ...

  4. [TypeStyle] Add responsive styles using TypeStyle Media Queries

    Media queries are very important for designs that you want to work on both mobile and desktop browse ...

  5. php修改SESSION的有效生存时间

    如何修改SESSION的生存时间 我们来手动设置 Session 的生存期: <?phpsession_start(); // 保存一天 $lifeTime = 24 * 3600; setco ...

  6. Angular 2 HostListener & HostBinding

    原文 https://www.jianshu.com/p/20c2d60802f7 大纲 1.宿主元素(Host Element) 2.HostListener 3.HostListenerDecor ...

  7. 【37.38%】【codeforces 722C】Destroying Array

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  8. MySQL5.7 四种日志文件

    mysql 日志包括:错误日志,二进制日志,通用查询日志,慢日志等 一:通用查询日志: 记录建立的客户端连接和执行的语句 1)show variables like '%verision%'; 显示数 ...

  9. Matlab-------regexp正则表达式

    转自原文 Matlab-------regexp正则表达式 句点符号 '.' ——匹配任意一个(只有一个)字符(包括空格). 例如:t.n,它匹配tan. ten.tin和ton,还匹配t#n.tpn ...

  10. Android 圆角ListView

    方法一:定义 <?xml version ="1.0" encoding ="UTF-8" ?> <shape xmlns:android = ...