安装VMtools 遇到的问题和解决

先说一下,我的环境:宿主机 win7;VM 6;虚拟机 Ubuntu11.04.

1、启动vmware,进入vmware里的linux系统里,su成root 
2、然后选"setting"-"vmware tools install"的那个选项,会弹出个对话框,

        按"确定"就行(选这个选项其实是虚拟一张光盘在/media里) 
3,cd /media

      cp VMTools-*.tar.gz /tmp 

      cd /tmp

      tar -zxvf VMTools-*.tar.gz

4、进入这个目录下,运行install,

      cd vmtools-*

       ./vmware-install.pl

       一路yes,enter

   到这一步: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.38-12-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"  

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

   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文件夹中,

 

修改办法:

1,直接将这个文件拷贝过来即可

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

或者2,把文件链接过来(我用的办法)

cd /usr/src/linux-headers-2.6.38-12-generic/include/linux

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

 

这样,一路enter,就可以顺利安装了。

 

 

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值