[ubuntu]在 ubuntu 7.10 gutsy 上安装了 vmware workstation,并解决错误

1.
在编译到vmmond模块的时候出现这样的错误:

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


将行:

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


如果提示没有权限请 sudo

2.
make: Entering directory `/tmp/vmware-config0/vmnet-only'
make -C /lib/modules/2.6.22-6-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.22-6-generic'

CC [M] /tmp/vmware-config0/vmnet-only/driver.o
CC [M] /tmp/vmware-config0/vmnet-only/hub.o
CC [M] /tmp/vmware-config0/vmnet-only/userif.o
/tmp/vmware-config0/vmnet-only/userif.c: 在函数 ‘VNetCopyDatagramToUser’ 中:
/tmp/vmware-config0/vmnet-only/userif.c:630: 错误: ‘const struct sk_buff’ 没有名为 ‘h’ 的成员
/tmp/vmware-config0/vmnet-only/userif.c:630: 错误: ‘const struct sk_buff’ 没有名为 ‘nh’ 的成员
/tmp/vmware-config0/vmnet-only/userif.c:636: 错误: ‘const struct sk_buff’ 没有名为 ‘h’ 的成员
make[2]: *** [/tmp/vmware-config0/vmnet-only/userif.o] 错误 1
make[1]: *** [_module_/tmp/vmware-config0/vmnet-only] 错误 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.22-6-generic'
make: *** [vmnet.ko] 错误 2
make: Leaving directory `/tmp/vmware-config0/vmnet-only'

Unable to build the vmnet module.

具体的修复方法如下:
cd /tmp
wget http://labs.eshangrao.com/files/vmnet.tar
cd /usr/lib/vmware/modules/source
sudo mv vmnet.tar vmnet.tar.old
sudo cp /tmp/vmnet.tar ./

最后重新编译:
sudo vmware-config.pl
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值