现在的位置: 首页 > 综合 > 正文

虚拟机安装tools的过程中遇到一个c header 问题(我的镜像是:ubuntu-10.10-desktop-i386.iso)

2013年08月13日 ⁄ 综合 ⁄ 共 1455字 ⁄ 字号 评论关闭

1。在虚拟机选项单击,选择安装VMware Tools,这时面板上会出现VMware Tools,双击,

     将VMwareTools-6.0.2-59824.tar.gz放到tmp文件夹下

2。进入到tmp目录下,将VMwareTools-6.0.2-59824.tar.gz解压

3。打开解压后的文件夹,执行sudo ./vmware-install.pl

     注:sudo 命令需要用管理员身份:修改管理员密码:sudo passwd root

     一直按回车。将出现include not existing an directory

4。#uname -r

       2.6.35-22-generic      #如果没有内核,则需要安装

5。如果有内核

     #cd /usr/src/

     #sudo ln -s linux-headers-2.6.35-22-generic linux

6。重复第3步,会出现

      The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not matchyour running kernel       

     (version 2.6.35-22-generic). Even if the module were tocompile successfully, it would not load into the running       kernel.

     但事实并不是不匹配,而是 Kernel 中有一个变量 UTS_RELEASE 的不存在了。以前这个定义放在 /usr/src/linux-headers-  2.6.35-22-generic/include/linux/version.h ,而现在已经移到了/usr/src/linux-headers-2.6.35-22- generic/include/linux/utsrelease.h。所以简单的方法,我们只需要在version.h中添加 #define UTS_RELEASE "2.6.35-22-generic"

 如果version.h是只读文件,则需要改下权限

#sudo chmod 777 /usr/src/linux/include/linux/version.h

#vi  /usr/src/linux/include/linux/version.h

7。重复第3步,又出错误信息

  The path "/usr/src/linux-headers-2.6.35-22-generic/include" is a kernel headerfile directory, but it does not contain   the file "linux/autoconf.h" asexpected. This can happen if the kernel has never been built, or if you haveinvoked the     "make mrproper" command in your kernel directory. In any case, youmay want to rebuild your kernel.

    找不到 autoconf.h 原因是因为 autoconf.h 不再VMware tools 安装程序预设的寻址目录中。可以简单的把它链接过来:

   #cd /usr/src/linux-headers-2.6.35-22-generic/include/linux

  #sudo ln -s ../generated/autoconf.h ./

抱歉!评论已关闭.