红联Linux门户
Linux帮助

VMware 6.5下Fedora 14安装VMware Tools头文件不匹配的处理过程

发布时间:2015-02-06 21:36:20来源:linux网站作者:zhangxuyu1118

VMware 6.5 安装Fedora 9、10时,在安装 VMware Tools 之前先升级下可以避免这个问题的:

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

安装这次Fedora 14时,竟然饶不过去,还是提示。/usr/src/include....头文件不匹配的问题。

的确如此:“。vmware读取的版本,UTS_RELEASE!我们往 linux/version.h。”,但按照资料中的方法处理仍然不成功。


检查vmware读取的版本,读出的是"2.6.35.11",我的定义是:#define UTS_RELEASE "2.6.35.11"

我内和版本是:"2.6.35.11-83.fc14.i686",更改定义为::#define UTS_RELEASE "2.6.35.11-83.fc14.i686",重新安装。

这次OK了,顺利完成。


VMware在Linux上安装时内核头文件的问题

VMware的作用不用介绍了,像 dorainm这种自己摆弄系统底层的,经常用 vmware弄个freeBSD、linux-2.4.x、linux-2.6.x之类的玩!

大家在安装vmware后,运行vmware-config.pl,经常会卡在内核头文件这里

None of the pre-built vmmon modulesforVMware Workstation is suitableforyour running kernel.Doyou want this program to try to build the vmmon moduleforyoursystem(you need to have a C compiler installed on yoursystem)?[yes]
Using compiler"/usr/bin/gcc".Useenvironment variable CC to override.
What is the location of the directory of C header files that match your running kernel?[/usr/src/linux/include]
The path"/usr/src/linux/include"isnotan existing directory.
What is the location of the directory of C header files that match your running kernel?[/usr/src/linux/include] /root/sources/linux-2.6.22.2/include

The directory of kernel headers(version@@VMWARE@@UTS_RELEASE)doesnotmatch your running kernel(version 2.6.22.2).Evenifthe module were to compile successfully,it wouldnotload into the running kernel.
What is the location of the directory of C header files that match your running kernel?[/usr/src/linux/include]


可气吧!明明修改指向我自己编译用过了的linux内核文件夹了,但是提示还是错误(dorainm使用的内核是2.6.22.2)

The directory of kernel headers(version@@VMWARE@@UTS_RELEASE)doesnotmatch your running kernel(version 2.6.22.2).Evenifthe module were to compile successfully,it wouldnotload into the running kernel.

打开 linux/version.h 一看,内容是

#defineLINUX_VERSION_CODE 132630
#defineKERNEL_VERSION(a,b,c)(((a)%26lt;%26lt;16)+((b)%26lt;%26lt;8)+(c))

2.6.22内核 = 2%26lt;%26lt;16 + 6%26lt;%26lt;8 + 22 = 2*65536 + 6*256 + 22 =132630


为什么说版本不对阿?!难道版本算法不同?!(bc:谁在掐我的指头!)

再次看,vmware读取的版本,UTS_RELEASE!我们往 linux/version.h 里面添加一行:

#defineUTS_RELEASE"2.6.22.2"
#defineLINUX_VERSION_CODE 132630
#defineKERNEL_VERSION(a,b,c)(((a)%26lt;%26lt;16)+((b)%26lt;%26lt;8)+(c))


这次 vmware终于相信 dorainm提供给它的内核头文件的版本是匹配的。

dorainm现在使用的 linux系统是自己编译的,如果安装的是发行版本,应该有相关的安装内核头文件的方法,比如 RedHat/Fedora系列的 yum, debian/Ubuntu系列的 apt等

如果没有,可以到www.kernel.org上下载对应的内核,然后:

make mrproper
make oldconfig
make
来编译内核头文件,再就按照文中的方法,让 vmware欢快得跑起来。