让 VMWare Workstation 5.5.3 能够在 Ubuntu 7.04 (Feisty Fawn)中正常运行!

news/2024/7/8 6:21:10

今天查看Linux Kernel modules,忽然发现/lib/modules下面有一个旧内核的目录,好奇之下进去看看,结果有了新发现,里面还有一些残存的配置,从名称看来应该是VMWare相关的,难不成是当初安装的时候,安装程序放的一些共享库在kernel modules目录中的?看看
新内核的module目录,什么都没有

[xport@ubuntu misc] $ pwd
/lib/modules/2.6.17-11-generic/misc

[xport@ubuntu misc] $ ls -l
总用量 1380
lrwxrwxrwx 1 root root 43 2007-04-21 01:33 vmmon.ko -> /lib/modules/2.6.17-11-generic/misc/vmmon.o
-rw-r--r-- 1 root root 487101 2007-04-21 01:33 vmmon.o
lrwxrwxrwx 1 root root 43 2007-04-21 01:34 vmnet.ko -> /lib/modules/2.6.17-11-generic/misc/vmnet.o
-rw-r--r-- 1 root root 913781 2007-04-21 01:34 vmnet.o


念及*NIX的好处,直接mv过去好了,应该可以直接用吧?!

[xport@ubuntu ~] $ sudo cp /lib/modules/2.6.17-11-generic/misc/*.o /lib/modules/2.6.20-15-generic/misc/
[xport@ubuntu ~] $ cd /lib/modules/2.6.17-11-generic/misc
[xport@ubuntu misc] $ sudo ln -s vmmon.o vmmon.ko
[xport@ubuntu misc] $ sudo ln -s vmnet.o vmnet.ko

但是这样运行vmware的网络服务却不成功,提示说:

[xport@ubuntu ~] $ sudo /etc/init.d/vmware start
vmware is installed, but it has not been (correctly) configured
for this system. To (re-)configure it, invoke the following command:
/usr/bin/vmware-config.pl.


运行vmware-config.pl又出来这个错误提示:

[xport@ubuntu ~] $ sudo /usr/bin/vmware-config.pl

...
... 省略 ...
...

None of the pre-built vmmon modules for VMware Server 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-15-generic/build/include]

Extracting the sources of the vmmon module.

Building the vmmon module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmmon-only'
make -C /lib/modules/2.6.20-15-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.20-15-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] Error 1
make[1]: *** [_module_/tmp/vmware-config0/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.20-15-generic'
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config0/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.


原来是build modules的时候出现了错误!

要解决此问题,需要修改VMWare的module source,所有的source都是一个tar文件:

[xport@ubuntu ~] $ ls -l /usr/lib/vmware/modules/source/
总用量 1824
-r--r--r-- 1 root root 706560 2007-04-21 01:33 vmmon.tar <--- 我们需要修改这个tar文件中的 compat_kernel.h
-r--r--r-- 1 root root 378880 2007-02-17 16:37 vmnet.tar
-r--r--r-- 1 root root 51200 2007-02-17 16:37 vmppuser.tar


修改内容如下,即把第21行的代码给注释掉后,把此文件再写回原来的vmmon.tar档案中:

/*

* static inline _syscall1(int, compat_exit, int, exit_code);
*/

这个做完以后,就可以再次运行vmware-config.pl去编译生成kernel modules了!

*** 补遗 ***

后来在论坛闲逛的时候,看到了更好的解决办法,我的手法有些暴力+粗糙了!

修改如下(原来是VMWare与2.6.19之后的内核有不兼容的地方):

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
static inline _syscall1(int, compat_exit, int, exit_code);
#endif





http://www.niftyadmin.cn/n/3653115.html

相关文章

FreeBSD 最小化安装 +diablo-jdk +Apache 与 Tomcat 整合 !

这篇文章算是补交很久之前的一篇作业&#xff0c;也顺便平息坛子里面很多同学的疑问&#xff01;我先说明一下配置环境的大概情况&#xff1a;OSFreeBSD 6.2-RELEASEJDKdiablo-jdk-1.5.0.07.01Apacheapache-2.2.3Tomcattomcat-5.5.23具体的版本信息显示如下&#xff1a;[rootFr…

FreeBSD/Linux 中避免 /etc/resolv.conf 被改写 + 几种解决办法的比较 !

最近又遇到 /etc/resolv.conf 会定时被改写掉的问题了&#xff0c;这回是在FreeBSD中&#xff01;在 LAN via NAT 或是 PPPoE 的环境中上Internet&#xff0c;我们总得在 resolv.conf 中指定 DNS server&#xff0c;而这里的 DNS server 是通过 DHCP server 自动获取的&#xf…

领导者/追随者(Leader/Follower)

领导者/追随者&#xff08;Leader/Follower&#xff09; 1.问题 多线程是实现并发处理多事件的应用程序的一种常用技术。然而&#xff0c;很难实现高性能的多线程服务器应用程序。这些应用程序通常处理大量同时到达的多类型事件。为了有效地处理这种问题&#xff0c;有三个强…

今天遇到两个问题:Can't connect to MySQL server 与 Access denied for user !

问题一&#xff1a;本机&#xff08;localhost&#xff09;连接一切正常&#xff0c;但是无法从其他电脑上登入 MySQL 数据库&#xff01; 下面是 /etc/mysql/my.cnf 中的一段摘录&#xff1a;# Instead of skip-networking the default is now to listen only on# localhost w…

FreeBSD-STABLE 居然是开发用的分支,我一直搞错了好多年...!

我一直认为对于FreeBSD的系统来说&#xff0c;发行版的稳定性是&#xff1a;CURRENT < RELEASE < STABLE&#xff0c;所以在灌完系统后立刻 cvsup 到对应的 STABLE 版本去... 这几天刚好碰到 Pengfei 也在看 FreeBSD 的 cvsup 管理部分&#xff0c;他正在疑惑生产系统上面…

值得读两遍的图书

值得读两遍的一些纯技术类图书&#xff1a;《设计模式》《重构》《J2EE without EJB中文版》 《Ajax实战》《Ajax模式与最佳实践》《Ajax设计模式》值得读两遍的一些非纯技术类图书&#xff1a;《人月神话》《人件》《UML精粹》《编写有效用例》《解析极限编程——拥抱变化》《…

建立国内Web前端开发的生态系统

在2003年年初&#xff0c;因为朋友许恩良的缘故&#xff0c;我来到了上海和为科技有限公司工作。公司的创始人是赖毅&#xff0c;他也曾经是开发人员出身&#xff0c;有着非常丰富的开发经验。赖毅是一个喜欢自出机杼的人&#xff08;这样的人一般都是某一方面的高手&#xff0…

做事情的快与坚持

其实我是一个很急躁的人&#xff0c;总是希望把事情尽快做完。每次出门办事的时候都在想如何把几件事情放在一起来做。但是很多时候&#xff0c;碰到一些疑难问题&#xff0c;总是没有办法快速完成。我总是感觉别人比我做事情要快&#xff0c;所以总是有着一种严重的危机感。读…