天天看點

關于VMware6.5下Ubuntu9.04安裝VMware tools的一些問題總結

 為了在VMware下Ubuntu操作使用更友善,必須安裝VMware tools。但是在安裝過程中經常出現一些不相容的問題,一下是我遇到的一些問題以及解決方法:

1、共享檔案夾失敗:

     參考自http://www.linuxidc.com/Linux/2009-05/19988.htm  将vmhgfs内的page.c用網頁中的附件覆寫即可,應該是VMware tools與Ubuntu9.04相容問題

2、滑鼠自由進出客戶系統問題

    輸入sudo apt-get install xserver-xorg-input-vmmouse即可

3、gcc版本識别問題

    Your compiler "/usr/bin/gcc " version "gcc -Version 4.3.2 (Ubuntu 4.3.2-1ubuntu12) " is not supported by this version of VMware Tools .

    其實是VMware-config-tools.pl裡面的一個小bug,它在判斷系統的gcc版本時,使用了“gcc -v”指令,而不是以前的“gcc -dumpversion”,因為Suse不支援後者。我們在Ubuntu下看看兩個指令的結果就明白了:

用“-v”傳回的是一大串解釋,而用“-dumpversion”,則簡單傳回“4.2.4”,VMware-config-tools.pl檔案 如果把前者拿去用來比較版本的話,自然就會出錯了,是以把VMware-config-tools.pl裡面幾處用到“-v”的地方改為 “-dumpversion”即可。估計是最近更新之後,Ubuntu的gcc的輸出有了點變化而導緻了這個問題。

   解決方法:具體操作步驟為在安裝好VMware Tools 後,運作vmware -config-tools .pl前,用vi或文本編輯器打開/usr/bin/vmware -config-tools .pl,

把3961行的" -v 2>&1 | tail -1"改為' -dumpversion ',再把下面3969行的/^gcc version (egcs-)?(/d+/./d+(/./d+)*)/改為

/^(egcs-)?(/d+(/./d+)*)/,儲存,運作vmware -config-tools .pl,下面應該就能成功了啊。

反正在我的Fedora 10中原來也是這個問題,後來一改就成功了,你們也在Ubuntu試試看吧。

==========================================================================================================

這幾天在vmware6.5中裝了一個ubuntu10.10玩了一下,過程如下:

進入解壓後的vmwaretools目錄

             $ cd /tmp/vmware-tools-distrib

執行安裝指令 $ sudo ./vmware-install.pl

接下來一路輸入回車

中間出現了問題:

What is the location of the directory of C header files that match your runningkernel? [/usr/src/linux/include]

按回車後:

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

輸入 /usr/src/linux-headers-2.6.35-22-generic/include

按回車後還是報錯

說**和目前運作的kernel版本不比對。

The directory of kernel headers (version @@[email protected]@ UTS_RELEASE) does not match your running kernel version

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

我們隻需要在version.h中添加 "#define UTS_RELEASE "2.6.35-22-generic"

(kernel版本使用 “uname -r“ 檢視)

按回車繼續,又會有新的錯誤提示:

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 have invoked the "make mrproper" command in your kernel directory. In any case, youmay want to rebuild your ke

打開一個新的終端輸入:

$ cd /usr/src/linux-headers-2.6.35-22-generic/include    <enter>  進入linux目錄的上級目錄

$ sudo chmod a+rw linux                                           把linux目錄改為可讀寫

把     /usr/src/linux-headers-2.6.35-22-generic/include/generated/autoconf.h

拷貝到 /usr/src/linux-headers-2.6.35-22-generic/include/linux下

然後就能順利完成安裝了。

繼續閱讀