環境:VMware Player、Fedora 16
預先安裝:Fedora系統中必須先安裝perl、make、gcc、kernel headers of the running kernel。
步驟:
1.VMware Player菜單上選擇Virtual Machine > Install VMware Tools。
2.虛擬機中以root身份登入,打開終端
3.運行mount命令(不帶任何參數),確定系統是否自動掛載VMware Tools virtual CD-ROM image
1 mount <==顯示系統掛載情況
3.1如果系統沒有自動掛載CD-ROM ,手動輸入命令進行掛載:
1 mkdir /media/VMware Tools
2 mount /dev/cdrom /media/VMware Tools
注:有些Linux系統掛載點為/mnt/cdrom,可以用ls命令查詢該目錄是否存在。
4.進入/tmp目錄進行操作,列出掛載點目錄內容
1 cd /tmp
2 ls /media/VMware Tools
5.解壓縮VMware Tools軟件包(小技巧:文件名過長,可以用【Tab】鍵自動補全)
1 tar zxpf /media/VMware Tools/VMwareTools-8.8.1-528969.tar.gz
6.如有必要,卸載CD -ROM(由於本系統自動掛載設備的,所以不需要卸載)
1 umount /dev/cdrom
7.安裝軟件
1 cd vmware-tools-distrib
2 ./vmware-install.pl
8.一直按回車鍵,保留默認設置,安裝成功。
------------------------------可能需要的步驟--------------------------------------------------
如果沒有預先安裝好make、gcc、kernel headers of the running kernel等軟件,則會提示你:
Before you can compile modules, you need to have the following installed...
make
gcc
kernel headers of the running kernel
Searching for GCC...
The path "" is not valid path to the gcc binary.
Would you like to change it? [yes] yes
What is the location of the gcc program on your machine?
9.打開另一個終端,切換root身份,安裝gcc
1 yum -y install gcc
在What is the location of the gcc program on your machine?后邊輸入/usr/bin/gcc,然后回車
10.根據提示,選擇內核3.1.0-7.fc16.i686 kernel(或使用命令 'uname -r '查詢內核版本)
Searching for a valid kernel header path...
The path "" is not a valid path to the 3.1.0-7.fc16.i686 kernel headers.
Would you like to change it? [yes] yes
Enter the path to the kernel header files for the 3.1.0-7.fc16.i686 kernel?
內核頭文件C header files下載地址:
http://rpmfind.net/linux/rpm2html/search.php?query=kernel-devel%20
找到對應內核頭文件rpm包下載,即 kernel-devel-3.1.0-7.fc16.i686.rpm,安裝:
1 rpm -ivh kernel-devel-3.1.0-7.fc16.i686.rpm
在Enter the path to the kernel header files for the 3.1.0-7.fc16.i686 kernel?這一行后輸入/usr/src/kernels/3.1.0-7.fc16.i686/include,回車。安裝成功!
------------------------------可能需要的步驟--------------------------------------------------
參考文章:
1.vmware幫助
2.http://ylq365.iteye.com/blog/1276807
3.http://www.cnblogs.com/kingkoo/archive/2007/12/28/1018613.html