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 版本中,已有一個“自動掛載”功能,如下圖所示:
[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)
/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