解压之后在控制台执行vmware-install.pl,会出现一些选项让你配置,基本上默认就可以了,但有可能会停在这一步
What is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include]
The path "/usr/src/linux/include" is not an existing directory.
这一步是让你指定c头文件所在的位置,我们进入/usr/src目录,应该这里有两个目录linux-headers-2.6.22-14和linux- headers-2.6.22-14-generic,现在我们要做的就是新建一个软链接linux,让它指向linux-headers-2.6.20 -15-generic,命令如下
ln -s linux-headers-2.6.20-15-generic linux
现在我们就有了linux这个目录,包含了c头文件,但我们继续配置,还可能会出现以下错误:
What is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include]
The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match your running kernel (version 2.6.20-15-generic). Even if the module were to compile successfully, it would not load into the running kernel.
What is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include]
我们明明以及指向了正确的linux内核头文件夹了,但还是报错了,我们可以这样修改:
进入/usr/src/linux/include/linux目录,修改下面的version.h文件
增加下面一行:
#define UTS_RELEASE "2.6.22-14-generic"
保存退出,继续配置vmware,这一步应该就成功了
继续配置还可能出现下面的错误:
该问题的解决办法
cd /usr/lib/vmware/modules/source
tar xvf vmmon.tar
cd vmmon-only
cd include
vi compat_kernel.h
找到 static inline _syscall1(int, compat_exit, int, exit_code); 这一行
修改为:
#if LINUX_VERSION_CODE < kernel_version(2,6,19)
static inline _syscall1(int, compat_exit, int, exit_code);
#endif
这样就行了,在控制台运行vmware-config.pl(不是vmware-install.pl!),应该就可以编译通过了,vmware也就安装成功了。