`
maeeqqp
  • 浏览: 13290 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论

ubuntu-11.04安装VMware tools遇到找不到C header的问题解决

阅读更多

    装了个ubuntu-11.04版本,用的是VMware精简版本的,所以支持不好。

   转载这篇,搞定了

 

[日期:2011-03-29] 来源:Linux社区  作者:silvervi

    以下问题的解决办法大多从网络上搜索得到,自己只是整理照搬过来而已。

    在Ubuntu 10.10上安装vmware tools,我这里主要遇到的问题都出现在以下这步中,

    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.

    因此,首先要更改该路径。这里很简单,首先用uname -r命令找到当前的linux内核版本,我这里的版本为2.6.35-25-generic,因此更改后的路径如下:

    “/usr/src/linux-headers-2.6.35-25-generic/include

    改后再回车,又出现如下问题:

    The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match your running kernel (version 2.6 . 35 - 22 -generic). Even if the module were to compile successfully, it would not load into the running kernel.

    这是不是不匹配,而是因为 Kernel 中有一个变量 UTS_RELEASE 位置改变了。以前这个定义放在 /usr/src/linux-headers-2.6.35-25-generic/include/linux/version.h ,而现在已经移到了/usr/src/linux-headers-2.6.35-25-generic/include/generated/utsrelease.h。所以vmware tools找不到这个变量的定义,修改的办法有两种:

    1. 在version.h中添加 #define UTS_RELEASE "2.6.35-25-generic"

    2. 直接将utsrelease.h拷贝回来,cp -p generated/utsrelease.h linux/utsrelease.h

      修改后再回车,仍然存在问题:

   The path  "/usr/src/linux-headers-2.6.35-22-generic/include"  is a kernel header file directory, but it does not contain the file "linux/autoconf.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.   

      根据提示可以知道,是因为找不到 linux/autoconf.h文件,这个文件在新的linux内核中被挪到了 generated文件夹中,因此修改的办法也很简单,直接将这个文件拷贝过来即可

     cp -p generated/ autoconf .h linux/ autoconf .h

     这样修改完成后,应该就可以顺利安装了。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics