1、安裝GCC開發工具
# Install software called by by VMware Tools
yum install gcc
2、安裝內核文件
# Install kernel header files
yum install kernel-devel
3、檢查內核文件的版本是否匹配,如果不匹配需要進行升級
# Check it matches the running kernel
uname -r # running kernel
rpm -q kernel-devel # installed kernel headers
4、第3不中如果不匹配,則需要升級內核文件,升級完後,重新啟動系統
# It the two versions do not match, run
yum -y upgrade kernel kernel-devel
# then reboot (but only if they did not match).
5、查找內核文件的位置,安裝VMware-tool工具時候需要(我裝的時候,會自動查找到,不需要手工指定)
# Find out where the kernel headers are
ls -d /usr/src/kernels/$(uname -r)*/include
# You may need this later.
6、下載虛擬機工具安裝包
即:VMware-tool安裝包,並解壓(具體就是在虛擬機工具欄上,點擊"VM"->"Install VMware Tools",會出現安裝包,選擇*.gz的文件,解壓到一個目錄下就可以)
以下是命令行中具體實現方法,我是在圖形界面下實現的
# If you already have VMwareTools-5.5.2-29772.tar.gz
on disk, SKIP THIS STEP!
# Download VMware-workstation-5.5.2-29772.tar.gz from vmware.com
# Extract the VMware Tools iso from it
tar --strip-components=3 -zxvf VMware-workstation-5.5.2-29772.tar.gz \
vmware-distrib/lib/isoimages/linux.iso
# Create a temporary mount point
mkdir /mnt/vmtools-temp
# Mount the image
mount -o loop linux.iso /mnt/vmtools-temp
# Copy VMware Tools from the mount
cp /mnt/vmtools-temp/VMwareTools-5.5.2-29772.tar.gz /tmp/
# Unmount the image and tidy up
umount /mnt/vmtools-temp
rmdir /mnt/vmtools-temp
rm linux.iso
# Unpack VMware Tools to a temporary directory
cd /tmp/
tar zxvf VMwareTools-5.5.2-29772.tar.gz
7、進入解壓目標目錄,執行以下代碼,一路回車按下來
cd /tmp/vmware-tools-distrib/
./vmware-install.pl
8、直到該步驟,拷貝粘貼第5步的路徑,然後一直按回車,直到選擇屏幕分辨率。
What is the location of the directory of C header files that match your running
kernel? [/usr/src/kernels/2.6.18-1.2849.fc6-i686/include]
我安照網上的安裝步驟,做到這步後就安裝上下去了。提示以下錯誤:
What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include] /usr/src/kernels/2.6.20-1.2952.fc6-i686/include
The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match
your running kernel (version 2.6.20-1.2952.fc6). Even if the module were to
compile successfully, it would not load into the running kernel.
請各位高手看看我應該怎麼做才能解決這個問題。謝謝。