ubuntu 安裝 VMware Tool 時include 出錯

來源:互聯網
上載者:User

問題:ubuntu 10 安裝 VMware Tool 時include 檔案檢測出錯

解決:

 

安裝VMware可以改變虛擬機器顯示的大小,也可以讓真機喝虛擬機器實現字串相互拷貝,相互分享共用目錄......

步驟:

sudo ./vmware-install.pl

 

Console代碼
1.What is the location of the directory of C header files that match your running  
2.kernel? [/usr/src/linux/include] <直接按 Enter>  
3.  
4.The path "/usr/src/linux/include"  is not an existing directory.  
What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include] <直接按 Enter>

The path "/usr/src/linux/include" is not an existing directory. 

 

由於 Kernel 版本是 APT 抓下來的最新版,所以會需要輸入 “/usr/src/linux-headers-2.6.35-22-generic/include “

要注意的是,VMWare Tools 安裝時會詢問目前系統使用的 Kernel header,所以如果 /usr/src 下有多個 Kernel header 目錄,最好先執行 “uname -r“ 指令,確認應該使用那個本版。另外可以不直接使用 “/usr/src/linux-headers-2.6.35-22-generic/include” ,先 “sudo ln -s /usr/src/linux /usr/src/linux-headers-2.6.35-22-generic/include”

 

Console代碼
1.What is the location of the directory of C header files that match your running  
2.kernel? [/usr/src/linux/include] /usr/src/linux-headers-2.6 . 35 - 22 -generic/include  
What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include] /usr/src/linux-headers-2.6.35-22-generic/include

 

按斷行符號以後,還是報錯說,指定的Kernel headers喝當前系統使用的版本不匹配。

 

Console代碼
1.The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match  
2.your running kernel (version 2.6 . 35 - 22 -generic). Even if the module were to  
3.compile successfully, it would not load into the running kernel.    
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-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" (具體值使用 “uname -r“ 查看)

 

接下來繼續,又會有新的錯誤提示!! -_-|| 找不到 autoconf.h 原因是因為 autoconf.h 不再VMware tools 安裝程式預設的定址目錄中。

 

Console代碼
1.The path  "/usr/src/linux-headers-2.6.35-22-generic/include"  is a kernel header  
2.file directory, but it does not contain the file "linux/autoconf.h"  as  
3.expected. This can happen if the kernel has never been built, or if you have  
4.invoked the "make mrproper"  command in your kernel directory. In any case, you  
5.may want to rebuild your kernel.    
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.   

 

可以簡單的把它連結過來:

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

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

然後應該能順利完成安裝了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.