在執行的過程中,我遇到了What is the location of the directory of C header files that match your running的問題。
問題描述:運行./vmware-install.pl後,一直按enter鍵就ok了,當出現下面這個提示後,你就要小心了.
Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes]
Before you can compile modules, you need to have the following installed...
make
gcc
kernel headers of the running kernel
上面提示的意思安裝vmware tools必須先安裝gcc和內核頭文件。
Searching for GCC...
Detected GCC binary at "/usr/bin/gcc".
The path "/usr/bin/gcc" appears to be a valid path to the gcc binary.
Would you like to change it? [no]
問題來了:它找不到我的內核頭文件的路徑
Searching for a valid kernel header path...
The path "" is not valid.
Would you like to change it? [yes]
What is the location of the directory of C header files that match your running
kernel?
提示我要輸入內核頭文件的路徑
會出現這種問題有兩種情況:
一種是你沒有安裝內核頭文件,那就要先安裝.
從linux安裝包中 Packages中 拷貝三個文件 分別是:
kernel-2.6.32-131.0.15.el6.i686.rpm
kernel-devel-2.6.32-131.0.15.el6.i686.rpm
kernel-headers-2.6.32-131.0.15.el6.i686.rpm
安裝之後就OK了
另外一種情況是vmware的問題,其實kernel header已經安裝了,只是沒有正確的被識別到
解決辦法如下:
1. 運行cd /lib/modules/`uname -r`/build/include/linux
如果沒有提示錯誤信息,ps: uname -r 查看內核版本號
2. 做兩個軟連接就行了,具體方法是運行下面兩條命令
ln -s ../generated/autoconf.h
ln -s ../generated/utsrelease.h
這兩條命令給vmwaretools關聯了正確的內核頭文件的位置
Detected GCC binary at "/usr/bin/gcc".
The path "/usr/bin/gcc" appears to be a valid path to the gcc binary.
Would you like to change it? [no]
Searching for a valid kernel header path...
Detected the kernel headers of the running kernel at
"/lib/modules/2.6.38-8-generic/build/include". //cd /lib/modules/`uname -r`/build/include/linux
The path "/lib/modules/2.6.38-8-generic/build/include" appears to be a valid
path to the kernel headers of the running kernel.
Would you like to change it? [no]
--------------------------------------------------------------------------
Enter ,that's ok!
ps :還有一種更加保險的方法,當你文件系統更新了,最好把你的虛擬機也更新一下,最後你會發現,問題已經不再是問題了。