Fedora 9安裝vmware tools解決方案

使用過VMware的都知道有個VMware Tools可以增強虛擬機的性能,不少朋友都使用VMware來安裝linux,但是在客戶機是linux的情況下安裝VMware Tools並不算一件很容易的事情,特別是……出現下面這些問題的時候。

還是以我使用的Fedora9爲例。 首先,我使用的是VMware6.0綠色精簡版,就是那個只有20多M的版本,這個版本可能沒有VMware Tools的那個iso文件,又或者只有一個windows版本的iso,因此,我們第一步就是要保證有VMware Tools for linux,如果你使用的VMware沒有,你可以從這裏下載: http://www.xdowns.com/soft/6/99/2008/Soft_45322.html 說明:讓VMware 支持linux系統,包括ubuntu、freebsd等等【104m的】,如果是9m【默認就是9m的】就單獨支持linux 裏面有多個下載地址,我下載的是 http://www.153.xdowns.com/uploadFile/2008-8/VMware_tools_linux.rar 9M的,不過解壓後也有116M了,就是一個linux.iso文件

     下面安裝VMware Tools。 虛擬機VMware菜單裏選安裝VMware Tools,沒有反應?沒這麼簡單。首先用VMware連接linux.iso,然後掛載(爲方便一些初次接觸的朋友,我直接給出命令了):

在終端裏mount /dev/cdrom /mnt,

然後進入iso的vmware-tools-distrib目錄:cd /mnt/vmware-tools-distrib,在這裏你應該看到一個文件vmware-install.pl,用ls命令即可看到,

然後在終端裏輸入./vmware-install.pl,如果一切條件都具備了,那麼一路回車就可以安裝結束了,忽略下面的步驟。

 

如果你使用的linux.iso是我下載的那個,而你的Fedora9的內核版本又是2.6.25-14.fc9.i686(用uname –r命令可以看到),那麼你將會被提示: None of the pre-built vmmemctl modules for VMware Tools is suitable for your running kernel. Do you want this program to try to build the vmmemctl module for your system (you need to have a C compiler installed on your system)? [yes] 我們先在需要一個c編譯器,如果你已經安裝了,直接回車就行,否則,去哪裏找?在安裝光盤就有gcc(如果你確實不瞭解,那麼知道它是一個把源代碼變成程序的工具就可以了),你可以按照 從安裝光盤中安裝Fedora 9的軟件包 中的方法來安裝gcc,當然,你也可以從網絡安裝。

安裝gcc完成後重新執行./vmware-install.pl,這下你以爲該成功了吧,結果又碰到了這個問題: What is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include] 這個時候你回車可不管用了,因爲你也許會發現你的系統裏面/usr/src文件夾根本就是空的。 此時我們需要安裝與系統內核配套的開發包,你可以用如下命令來確保相關的開發包真的沒有安裝:

rpm -q kernel-devel

如果沒有安裝,將會提示:package kernel-devel is not installed

假如你用

uname –r

命令看到的是2.6.25-14.fc9.i686,而你的網絡狀況良好,那麼你可以這樣安裝:

 yum install kernel-devel-2.6.25-14.fc9.i686.rpm

如果你發現從安裝源下載安裝不了,或者速度太慢,你可以這樣下載:假設我們用root用戶登錄,當前工作目錄是/root/Download,那麼

 [root@localhost Download] wget ftp://rpmfind.net/linux/fedora/releases/9/Everything/i386/os/Packages/kernel-devel-2.6.25-14.fc9.i686.rpm

將把這個rpm包下載到/root/Download,如果你覺得wget下載仍然太慢,那麼你可以使用相關工具來下載,反正地址都有了。

什麼?你只會用windows下的迅雷?沒關係,你真的可以用迅雷下載,然後在windows搭建一個ftp服務,在linux訪問windows的ftp再重新下載一次,你也可以把它發到自己的郵箱,然後在linux打開郵箱下載……只要你喜歡,怎樣都行,總之最後把這個文件放到/root/Download就行,

然後安裝:

rpm -i kernel-devel-2.6.25-14.fc9.i686.rpm

安裝完成可以用rpm -q kernel-devel再查詢一下是否已經安裝成功。

 

好了,一切重新開始,重新執行./vmware-install.pl,再到這裏的話,應該是這樣的: What is the location of the directory of C header files that match your running kernel? [/lib/modules/2.6.25-14.fc9.i686/build/include] 這下該沒問題了吧,結果最後發現: Unable to create the directory /mnt/hgfs. Execution aborted.

噢泄特,要用到/mnt/目錄,把iso放光驅裏mount忘了umount呢,它現在是隻讀的,好,把linux.iso 裏面的內容複製到/root/Download,然後umount,還是不行,快瘋了吧: In file included from include/linux/string.h:11, From /tmp/vmware-config3/vmhgfs-only/cpName.h:18, from /tmp/vmware-config3/vmhgfs-only/cpName.c:18: include/linux/types.h:40: 錯誤:與‘uintptr_t’類型衝突 /tmp/vmware-config3/vmhgfs-only/vm_basic_types.h:170: 錯誤:‘uintptr_t’的上一個聲明在此 make[2]: *** [/tmp/vmware-config3/vmhgfs-only/cpName.o] 錯誤 1 make[1]: *** [_module_/tmp/vmware-config3/vmhgfs-only] 錯誤 2 make[1]: Leaving directory `/usr/src/kernels/2.6.25-14.fc9.i686' make: *** [vmhgfs.ko] 錯誤 2 make: Leaving directory `/tmp/vmware-config3/vmhgfs-only' Unable to build the vmhgfs module. 解決辦法是下載一個新的open-vm-tools就可以了,給一個鏈接: http://jaist.dl.sourceforge.net/sourceforge/open-vm-tools/open-vm-tools-2008.06.03-96374.tar.gz 假設下載的這個文件放到了/root/Download 先看看是不是有我們的文件? [root@localhost Download]# ls kernel-devel-2.6.25-14.fc9.i686.rpm open-vm-tools-2008.06.03-96374.tar.gz vmware-tools-distrib 然後解壓繼續進行: [root@localhost Download]# tar xzvf open-vm-tools-2008.06.03-96374.tar.gz [root@localhost Download]# cd open-vm-tools-2008.06.03-96374 [root@localhost open-vm-tools-2008.06.03-96374]#./configure && make [root@localhost open-vm-tools-2008.06.03-96374]# cd modules/linux [root@localhost linux]# for i in *; do mv ${i} ${i}-only; tar -cf ${i}.tar ${i}-only; done [root@localhost linux]# cd ../../.. [root@localhost Download]# mv -f open-vm-tools-2008.06.03-96374/modules/linux/*.tar vmware-tools-distrib/lib/modules/source/ [root@localhost Download]# cd vmware-tools-distrib/ [root@localhost vmware-tools-distrib]# ./vmware-install.pl 一直回車吧,最後你會看到讓你選擇屏幕分辨率,最後的最後: To make use of the virtual printer, you will need to restart the CUPS service Enjoy, --the VMware team 本文來自CSDN博客,轉載請標明出處:http://blog.csdn.net/liguisen/archive/2009/04/10/4063336.aspx

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章