设为首页 收藏本站
查看: 839|回复: 0

[经验分享] win7 Host 与virtualbox 中的 ubuntu 11.10 共享文件夹

[复制链接]

尚未签到

发表于 2015-10-12 09:55:14 | 显示全部楼层 |阅读模式

  环境是: 主机是windows7,虚拟机是VirtualBox的ubuntu11.10
  
  
  1.开始安装增强工具
  首先要运行虚拟机上的ubuntu,点设备---》安装增强功能。
  
  
DSC0000.png
  
  之后会在桌面多出一个光盘图标。
  
DSC0001.png
  
  
[java] view plaincopyprint?

  • 接着启动终端,输入如下命令  
  •   
  • cd /media/VBOXADDITIONS_4.0.8_71778
  •   
  • sudo ./VBoxLinuxAdditions.run  
  •   
  • 安装完后,要重启ubuntu.  
  • 第一步End。  
接着启动终端,输入如下命令cd /media/VBOXADDITIONS_4.0.8_71778sudo ./VBoxLinuxAdditions.run安装完后,要重启ubuntu.第一步End。  
  2.设置共享文件夹
  
  本例子以E://virtualShare为共享文件夹
  首先在windows7中,要设这个文件夹为可以共享的,直接右键共享virtualShare就可以了。
  在你重启完ubuntu后,再点选菜单的设备--->分配数据空间
  
  
  
DSC0002.png
  再点右侧的"加号"按钮
DSC0003.png
  
DSC0004.png
  
  然后点先其它,再选择刚刚你共享的那个文件夹,我的是virtualShare
DSC0005.png
  
DSC0006.png
第二步End
  
  3.挂载共享文件夹
  
  
  进入终端:
[java] view plaincopyprint?

  • sudo mkdir /mnt/shared  
  • sudo mount -t vboxsf virtualShare /mnt/shared  
  •   
  • OK,现在ubuntu可以与windows7共享文件夹了,试下吧,哈哈  
  

其中"virtualShare"是之前创建的共享文件夹的名字,假如您不想每一次都手动挂载,可以在/etc/fstab中添加一项
virtualShare /mnt/share vboxsf rw,gid=100,uid=1000,auto 0 0
这样就能够自动挂载了。

卸载的话使用下面的命令:
sudo umount -f /mnt/shared


sudo mkdir /mnt/sharedsudo mount -t vboxsf virtualShare /mnt/sharedOK,现在ubuntu可以与windows7共享文件夹了,试下吧,哈哈  教程End.
  
  ---------------------------------------------------另有一英文教程,操作有所不同,没有经过仔细验证,互为补充吧。可能需要重启几次才能成功,共享文件夹在../media/下。
  Sometimes, you just have to move files from your VirtualBox’s Ubuntu 11.04 virtual machines to a Windows 7 host, but how?  It’s simple really!  There are couple ways of doing it, but I prefer to keep it simple.  The steps are below:

  • Start VirtualBox
  • Highlight a virtual machine in the list of virtual machines
  • Click on Settings
  • Go to Shared Folders
  • Click on Add Shared Folders
  • From drop down box of Folder Path, choose Other
  • Pick a folder from your system that you have permission to access
  • Check the box that says Auto mount
  • Click OK button
  • Click OK button again to save everything
  • Start your Ubuntu 11.04 virtual machine (i.e., the one you have added a shared folder for)
  • Inside Ubuntu 11.04 virtual machine, open up Control Center >> System >> Users and Groups
  • Click on Manage Groups
  • Scroll down till you see a group labeled as vboxsf, highlight it, and then click on Properties
  • Place a check mark inside a box next to the user that you want to give access to shared folder(s)
  • Click OK, and you have to enter your sudo’s password or root password or just a password of a user who has administrative authority
  • Navigate to folder/directory labeled as media inside Ubuntu 11.04 virtual machine using either Nautilus or Terminal
  • Change into the directory which begins with sf_, because a folder/directory inside media folder/directory that has sf_ prefix is a shared folder that you created earlier using VirtualBox.
  • If using Nautilus, you can right click on empty space to create a folder with a folder name of your choosing.  If using Terminal, you can execute this command [mkdir Testing].  Remember, you should do this as a normal user, a user which you’d gave permissionto access this shared folder a bit earlier using Ubuntu.  If you can create a test folder with a folder name of your choosing inside the directory with prefix sf_ in folder/directory media, it means you are officially able to transfer files and folders insideUbuntu 11.04 virtual machine to your Windows 7 host.
  • To double check to see if everything is working, navigate to your Windows 7 host and go to the shared folder that you’d allowed VirtualBox to share it with Ubuntu 11.04 virtual machine earlier.  If everything is working out, you should now see a test folder/directoryyou had created in step 19.
  That’s it!  Have fun moving files from your Ubuntu 11.04 virtual machine(s) to your Windows 7 Host and vice versa!

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-125674-1-1.html 上篇帖子: VirtualBox问题汇总与解决方法 下篇帖子: virtualbox文件共享ubuntu为host机器,win7为guest
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表