LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1260|回复: 4

vmware-config.pl出错(已解决)

[复制链接]
发表于 2007-1-29 09:15:06 | 显示全部楼层 |阅读模式
。。。
Trying to find a suitable vmmon module for your running kernel.

None of the pre-built vmmon modules for VMware Workstation is suitable for your
running kernel.  Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes]

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.20-rc6/build/include]

Extracting the sources of the vmmon module.

Building the vmmon module.

Building for VMware Workstation 5.5.2 or 5.5.3.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config6/vmmon-only'
make -C /lib/modules/2.6.20-rc6/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-2.6.20-rc6'
  CC [M]  /tmp/vmware-config6/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config6/vmmon-only/linux/driver.c:85:
/tmp/vmware-config6/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or '...' before 'compat_exit'
/tmp/vmware-config6/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or '...' before 'exit_code'
/tmp/vmware-config6/vmmon-only/./include/compat_kernel.h:21: warning: type defaults to 'int' in declaration of '_syscall1'
make[2]: *** [/tmp/vmware-config6/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-config6/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.20-rc6'
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config6/vmmon-only'
Unable to build the vmmon module.

For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/download/modules/modules.html" and
"http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html".

Execution aborted.
发表于 2007-2-1 09:27:51 | 显示全部楼层
Post by xmzw
。。。
Trying to find a suitable vmmon module for your running kernel.

None of the pre-built vmmon modules for VMware Workstation is suitable for your
running kernel.  Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes]

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.20-rc6/build/include]

Extracting the sources of the vmmon module.

Building the vmmon module.

Building for VMware Workstation 5.5.2 or 5.5.3.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config6/vmmon-only'
make -C /lib/modules/2.6.20-rc6/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-2.6.20-rc6'
  CC [M]  /tmp/vmware-config6/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config6/vmmon-only/linux/driver.c:85:
/tmp/vmware-config6/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or '...' before 'compat_exit'
/tmp/vmware-config6/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or '...' before 'exit_code'
/tmp/vmware-config6/vmmon-only/./include/compat_kernel.h:21: warning: type defaults to 'int' in declaration of '_syscall1'
make[2]: *** [/tmp/vmware-config6/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-config6/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.20-rc6'
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config6/vmmon-only'
Unable to build the vmmon module.

For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/download/modules/modules.html" and
"http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html".

Execution aborted.

许久前我也碰到过,因为新内核头文件部分函数有所改动导致的(上面已经提示了),解决它就直接改源码,将 vmmon.tar 包里的 vmmon-only/include/compat_kernel.h 的

#define __NR_compat_exit __NR_exit
inline _syscall1(int,compat_exit, int, exit_code);

二行直接换成

int compat_exit(int exit_code);

重新打包回去,然后直接 vmware-config.pl 把 vmmon 装上就可以了

记得在启动vmware 前要(gentoo 刚刚用上,应该也是这样)把vmmon 启动起来
/etc/init.d/vmware start
或者自己加到启动里
回复 支持 反对

使用道具 举报

发表于 2007-2-1 10:11:17 | 显示全部楼层
更新内核后要重新安装vmware-modules。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-2-1 13:09:23 | 显示全部楼层
Vmware在2.6.20内核下编译出错的解决方法
内核升级为2.6.20后运行vmware-config.pl出现以下错误

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmmon-only'
make -C /lib/modules/2.6.20-5-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.20-5-generic'
  CC [M]  /tmp/vmware-config0/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config0/vmmon-only/linux/driver.c:80:
/tmp/vmware-config0/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or ‘...’ before ‘compat_exit’
/tmp/vmware-config0/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or ‘...’ before ‘exit_code’
/tmp/vmware-config0/vmmon-only/./include/compat_kernel.h:21: warning: type defaults to ‘int’ in declaration of ‘_syscall1’
make[2]: *** [/tmp/vmware-config0/vmmon-only/linux/driver.o] 错误 1
make[1]: *** [_module_/tmp/vmware-config0/vmmon-only] 错误 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.20-5-generic'
make: *** [vmmon.ko] 错误 2
make: Leaving directory `/tmp/vmware-config0/vmmon-only'
Unable to build the vmmon module.


以上的compat_kernel.h定义与2.6.20的内核有不兼容的地方,那我们就来修改compat_kernel.h使其与compat_kernel.h与内核兼容就可以了。

首先备份原始文件,然后解压vmmon.tar:

cd /usr/lib/vmware/modules/source
sudo cp vmmon.tar vmmon.tar.old
sudo tar xvf vmmon.tar
sudo gedit vmmon-only/include/compat_kernel.h

将21行:

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

然后重新打包vmmon.tar:

tar cvf vmmon.tar vmmon-only


rm -rf vmmon-only

继续编译,vmmon模块是编译通过了,可是vmnet模块又出现了如下的错误:

make[1]: Entering directory `/usr/src/linux-headers-2.6.20-5-generic'
  CC [M]  /tmp/vmware-config1/vmnet-only/driver.o
  CC [M]  /tmp/vmware-config1/vmnet-only/hub.o
  CC [M]  /tmp/vmware-config1/vmnet-only/userif.o
/tmp/vmware-config1/vmnet-only/userif.c: In function ‘VNetCopyDatagramToUser’:
/tmp/vmware-config1/vmnet-only/userif.c:629: error: ‘CHECKSUM_HW’ undeclared (first use in this function)
/tmp/vmware-config1/vmnet-only/userif.c:629: error: (Each undeclared identifier is reported only once
/tmp/vmware-config1/vmnet-only/userif.c:629: error: for each function it appears in.)
make[2]: *** [/tmp/vmware-config1/vmnet-only/userif.o] 错误 1
make[1]: *** [_module_/tmp/vmware-config1/vmnet-only] 错误 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.20-5-generic'
make: *** [vmnet.ko] 错误 2
make: Leaving directory `/tmp/vmware-config1/vmnet-only'
Unable to build the vmnet module.

现在是vmnet的问题,同样的我们要修改不兼容的代码,然后重新编译。

首先备份原始的vmnet.tar,并解压:

cd /usr/lib/vmware/modules/source
sudo cp vmnet.tar vmnet.tar.old
sudo tar xvf vmnet.tar
sudo gedit vmnet-only/userif.c和bridge.c

将其中的CHECKSUM_HW替换成CHECKSUM_COMPLETE。

然后重新打包:

tar cvf vmnet.tar vmnet-only
rm -rf vmnet-only

再次编译就一切OK了!
回复 支持 反对

使用道具 举报

发表于 2007-2-13 19:48:24 | 显示全部楼层
谢谢ls的兄弟~~~
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表