VirtualBox4.3.12 Centos6.5-i386 设置共享文件夹

新在虚拟机下安装个CentOS6.5,准备设置个与win7的共享文件夹,遇到一个问题,搞了好几天呢

现在先说一下:

首先,在虚拟机下安装好CentOS这里不说了

然后启动,点击安装增强功能

如下图:

点击之后,会以镜像文件的形式挂载在/dev/cdrom下,因此,想要使用,还需这样

mkdir /mnt/tmp

mount /dev/cdrom /mnt/tmp

挂载在tmp目录下,然后

cd /mnt/tmp

ls

即可查看文件

查看文件后既可以安装啦!!!

执行sh VBoxLinuxAdditions.run 即可

可能你还会遇到这样的问题

******************************************************************************

清单 2:Guest Additions 安装失败

# sh ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.1.2 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing existing VirtualBox DKMS kernel modules           [  OK  ]
Removing existing VirtualBox non-DKMS kernel modules       [  OK  ]
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
The missing package can be probably installed with
yum install kernel-devel-2.6.32-100.26.2.el5

Building the main Guest Additions module                   [FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Installing the Window System drivers
Installing X.Org 7.1 modules                               [  OK  ]
Setting up the Window System to use the Guest Additions    [  OK  ]
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.

Installing graphics libraries and desktop services component[  OK  ]
Press Return to close this window...

清单 2 中所示输出的日志文件 /var/log/vboxadd-install.log 指示问题在于缺少内核资源:

# more /var/log/vboxadd-install.log
/tmp/vbox.0/Makefile.include.header:94: *** Error: unable to find the sources of your 
current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.

 *********************************************************************************

内核文件不匹配

找了N个博客,搜了N种解决办法,

有的说这样:

**************************************************************************

安装GCC

#yum install gcc

# yum install gcc kernel-devel kernel-headers

重启。

再次安装VBoxLinuxAdditions,OK。
*************失败********************

有的说这样:

**************************************************************************

下列操作对CentOS, Red Hat Enterprise Linux and Oracle Enterprise Linux都适用:
建议以root身份运行下列命令。
1.如果你的CentOS 版本早于 6,那么需要在 /etc/grub.conf 中添加一行 divider=10,以将这个参数传递给核心,以减少 idle CPU load。

2.#yum update
把系统的所有软件升级到最新版本。

3.#yum install gcc
安装编译系统

4.#yum install kernel-devel
安装外置核心模块。

5.#reboot
重启以使所有的升级或安装生效。

**************************************************************************

反正还是有问题,最后

******************************************************************
安装了乱七八糟的gcc kernel kernel-devel gcc-g++
最后update了一下终于有用了

泪奔啊~~~~

现在终于可以快乐的安装共享文件夹了

第一张图,点击共享文件夹,

然后这样就可以了

哈哈,然后就是挂载

mkdir /mnt/share
mount -t vboxsf CentOS--Win /mnt/share

正常的话

mount -t vboxsf winshare /mnt/share共享文件夹应该可以访问了
#cd /mnt/share
#ls -al

*******************************End*****************************************

//******************************巨坑

原文地址:https://www.cnblogs.com/ccccnzb/p/4072030.html