travelleriam 2016-08-16
安装VirtualBox为了共享文件夹,折腾了一晚上!网上的很多资料都不是很全面,这里就全面的总结一下,如果有其他的疑问,可以留言多多交流。
(图1 设置共享文件夹)
(图2 设置共享文件路径属性)
执行下面的命令:
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文件)