详解VirtualBox中与主机共享文件夹的方法(图文)
2017-10-18 14:10
766 查看
安装VirtualBox为了共享文件夹,折腾了一晚上!网上的很多资料都不是很全面,这里就全面的总结一下,如果有其他的疑问,可以留言多多交流。
设置共享文件路径
点击虚拟机 设置-->选择 共享文件夹
(图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经常需要来回的拷贝内容,那么可以打开【共享粘贴板】,步骤为:
设备-->共享粘贴板-->双向
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
您可能感兴趣的文章:
相关文章推荐
- 虚拟机(VirtualBox4.3.8)与主机(WIN7)之间共享文件夹之方法一
- 虚拟机(VirtualBox4.3.8)与主机(WIN7)之间共享文件夹之方法二(Samba)
- Virtualbox主机和虚拟机之间文件夹共享及双向拷贝(宿主机Windows->Ubuntu 16.04 LTS)
- 技术转载:VirtualBox虚拟机XP与宿主机Ubuntu互访共享文件夹的实现方法
- windows主机上的文件夹与vmware虚拟机实现共享的设置方法
- VirtualBox 共享文件夹没有执行权限解决方法
- virtualbox下ubuntu访问主机共享文件夹
- 虚拟机(Virtualbox-Ubuntu)与主机(WIN7)共享文件夹设置
- Vmware与主机间共享文件的七种方法(附图+详解)
- 【转】【教程】实现Virtualbox中的XP虚拟机和主机Win7之间的共享文件夹
- 虚拟机(Virtualbox-Ubuntu)与主机(WIN7)共享文件夹设置 &&19条小技巧让你快速上手Ubuntu 11.04
- 使用VirtualBox在Ubuntu下虚拟Windows XP共享文件夹设置方法
- Vmware与主机间共享文件的七种方法(附图+详解)
- virtualbox中ubuntu与宿主机操作系统共享文件夹
- Vmware与主机间共享文件的七种方法(附图+详解)
- 在Windows下用Virtualbox虚拟linux时共享文件夹设置的方法
- 新版VirtualBox设置Ubuntu与windows共享文件夹的方法
- Vmware与主机间共享文件的七种方法(附图+详解)
- Vmware与主机间共享文件的七种方法(附图+详解)
- 虚拟机Ubuntu11.04与host主机windows共享文件夹问题解决方法