环境: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