打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
手把手教你在VirtualBox中与主机共享文件夹

安装VirtualBox为了共享文件夹,折腾了一晚上!网上的很多资料都不是很全面,这里就全面的总结一下,如果有其他的疑问,可以留言多多交流。

VirtualBox下载地址,版本为5.1.2

设置共享文件路径

点击虚拟机 设置-->选择 共享文件夹

(图1 设置共享文件夹)

设置共享文件夹路径

  • 1 选择路径
  • 2 填写自定义的共享名称(在后面需要与挂载路径相对应)
  • 3 设置自动挂载/固定分配

(图2 设置共享文件路径属性)

安装VirtualBox增强工具

先安装必备的包

执行下面的命令:

yum install -y gcc gcc-devel gcc-c++ gcc-c++-devel make kernel kernel-devel

安装完后,重启虚拟机:

shutdown -r now

安装virtualBox增强工具

点击 设置-->点击 安装增强功能...

(图3 点击设置)

自动执行安装 或者 进入目录/media/VBOXADDITIONS_5.1.2_108956,执行命令

./VBoxLinuxAddtion.run

得到输出内容

[root@localhost VBOXADDITIONS_5.1.2_108956]# ./VBoxLinuxAdditions.run Verifying archive integrity... All good.Uncompressing VirtualBox 5.1.2 Guest Additions for Linux...........VirtualBox Guest Additions installerRemoving installed version 5.1.2 of VirtualBox Guest Additions...vboxadd.sh: Stopping VirtualBox Additions.vboxadd-service.sh: Stopping VirtualBox Guest Addition service.Copying additional installer modules ...Installing additional modules ...vboxadd.sh: Building Guest Additions kernel modules.vboxadd.sh: You should restart your guest to make sure the new modules are actually used.vboxadd.sh: Starting the VirtualBox Guest Additions.You may need to restart the the Window System (or just restart the guest system)to enable the Guest Additions.

即安装成功!

挂载共享文件夹

切换到root用户输入挂载命令:

sudo mount -t vboxsf shared_file /home/xingoo/shared

注意格式为

sudo mount -t vboxsf 共享文件夹名称(在设置页面设置的) 挂载的目录

然后进入/home/xingoo/shared,就可以看到windows中的文件了

(图4 windows文件)

[root@localhost shared]# lltotal 337516-rwxrwxrwx. 1 root root 149599799 Aug 15 21:29 apache-hive-2.1.0-bin.tar.gz-rwxrwxrwx. 1 root root 196015975 Aug 15 21:31 hadoop-2.6.4.tar.gz

其他使用技巧

如果宿主机是windows经常需要来回的拷贝内容,那么可以打开【共享粘贴板】,步骤为:

设备-->共享粘贴板-->双向
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
VirtualBox虚拟机CentOS安装增强功能Guest Additions
Windows下VirtualBox 共享文件夹设置
分享Virtualbox Ubuntu 共享文件夹、自动挂载的一些问题
【crifan推荐】虚拟机软件VirtualBox | 在路上
WAS 6 命令行安装(静默安装)-神马新浮云
通过SSH实现Windows与linux之间传输文件
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服