详解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
点击 设置-->点击 安装增强功能...

(图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 installer Removing 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]# ll total 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经常需要来回的拷贝内容,那么可以打开【共享粘贴板】,步骤为:
设备-->共享粘贴板-->双向
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持免费资源网。
您可能感兴趣的文章
- 02-02hadoop动态增加和删除节点方法介绍
- 02-02干货 | Linux新手入门好书推荐
- 02-02linux系统下MongoDB单节点安装教程
- 02-02Linux下nginx生成日志自动切割的实现方法
- 02-02Centos 6中编译配置httpd2.4的多种方法详解
- 02-02CentOS7 下安装telnet服务的实现方法
- 02-02分布式Hibernate search详解
- 02-02Hadoop对文本文件的快速全局排序实现方法及分析
- 02-02CentOS6.3添加nginx系统服务的实例详解
- 02-02Hadoop编程基于MR程序实现倒排索引示例


阅读排行
推荐教程
- 12-07一文教你怎么选择Tomcat对应的JDK版本
- 12-07tomcat启动报错jar not loaded的问题
- 12-10docker start启动容器后仍然exit状态的解决
- 12-23linux中ftp无法访问怎么办
- 12-19Zabbix SAML SSO 登录绕过漏洞的操作流程
- 12-13k8s编排之Deployment知识点详解
- 12-10Linux下如何安装Logstash
- 12-15Docker-Compose搭建Spark集群的实现方法
- 12-11docker存储目录迁移示例教程
- 01-07windows server 2008安装配置DNS服务器




