Chinaunix

标题: 安装vmware tools 也与内核版本有关? [打印本页]

作者: flying5    时间: 2008-05-10 01:47
标题: 安装vmware tools 也与内核版本有关?
今天在网上下载了个RedHat Linux AS 5 正式版DVD.iso
于是在VMWare 5.5.3 上安装好了后,
接着安装VMWare tools的时候出现问题了,就是在./vmware-install.pl 这句后,提示
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" is not an existing directory.
接着我在网上下载了linux-2.6.16.18的源代码,把include文件夹拷贝到/usr/src/linux/include目录
接着提示:
The path "/usr/myinclude/include" is a kernel header file directory, but it
does not contain the file

"linux/version.h" as expected.  This can happen if
the kernel has never been built, or if you have invoked the

"make mrproper"
command in your kernel directory.  In any case, you may want to rebuild your
kernel.
在网上找到是内核版本与头文件版本不匹配的问题,于是在/usr/myinclude/include/linux下手动添加了version.h文件。
先用uname -r查到内核版本为 2.6.18-8.el5xen
于是我在version.h文件中只写了一句话:
KERNELRELEASE=2.6.18-8.el5xen
结果又提示:
The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match
your running kernel (version

2.6.18-8.el5xen).  Even if the module were to
compile successfully, it would not load into the running kernel.


What is the location of the directory of C header files that match your running
kernel?

[/usr/src/linux/include]


这下不知道该怎么办了?急盼高手指路!
作者: dingning239    时间: 2008-05-10 20:56
你在用虚拟机的时候选择系统版本是否正确
作者: flying5    时间: 2008-05-10 23:17
标题: 回复 #2 dingning239 的帖子
虚拟机没有RedHat Linux AS 5这个版本
我选的redhat
作者: flying5    时间: 2008-05-11 02:00
谢天谢地,总算找到办法了

http://www.road2lamp.com/blog/index/show/bid/150
给RHEL5安装VMware Tools
     使用VMware6.0版虚拟机安装了RHEL5之后,会发现按照其默认的设置无法安装上VMware Tools,安装过程中出的错误主要是想找Linux内核的包含头文件找不到。虽然不装这个工具不会对虚拟机本身的使用造成什么影响,但操作起来尤其是鼠标的移入移出确实不方便。

      到底怎么才能安装上它呢?如果在安装系统时,没有安装内核源代码的话,可以去网站http://www.kernel.org下载到符合自己系统的内核源码。该系统内核版本号可以直接在/boot下看到,应该是2.6.18,所以下载linux-2.6.18.8.tar.gz文件到本地,解压缩到/usr/src路径下,进入,运行:

      make mrproper
      make oldconfig
      make

      前两步执行速度都很快,正常执行完毕即可,但第三步要真正编译内核的话,看机器情况可能需要几个小时,没有必要等它完全编译完,只要make刚开始后提示生成了version.h和utsrelease.h后就可以按Ctrl-C退出编译了。然后需要进入./include/linux路径下,修改文件utsrelease.h,将里面的版本号设置为2.6.18-8.el5xen,再 修改version.h,增加一行#define UTS_RELEASE "2.6.18-8.el5xen",保存退出。

      这样就可以正式安装VMware Tools了,将tools.tar.gz文件解压,进入,执行INSTALL,基本上一路按回车即可安装成功。现在就可以享受鼠标移入移出的顺畅感觉,并且可以直接在父子操作系统之间进行文本的拷贝粘贴了。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2