设为首页 收藏本站
查看: 1263|回复: 0

[经验分享] 让 VMWare Workstation 5.5.3 能够在 Ubuntu 7.04 (Feisty Fawn)中正常运行!

[复制链接]
累计签到:2 天
连续签到:1 天
发表于 2016-1-7 10:02:52 | 显示全部楼层 |阅读模式
今天查看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

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-161316-1-1.html 上篇帖子: (转)Vmware磁盘优化深度解析-如何才能提高工作性能 下篇帖子: 使用VMware虚拟机迁移现有的服务器及网络
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

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