Chinaunix首页 | 论坛 | 博客
  • 博客访问: 181418
  • 博文数量: 42
  • 博客积分: 2520
  • 博客等级: 少校
  • 技术积分: 440
  • 用 户 组: 普通用户
  • 注册时间: 2009-05-18 09:54
文章分类
文章存档

2011年(1)

2010年(13)

2009年(28)

我的朋友

分类: LINUX

2010-02-28 11:44:06

参考:
  1. 在Ubuntu下安装VMware Tools的方法

问题描述:VMware的版本是6.0.0,安装在Windows xp上,VMware里面安装了Ubuntu 9.04。然后在Ubuntu 9.04中安装VMware tools(在终端下运行sudo ./vmware-install.pl),在编译模块时出现如下错误,从而导致很多功能如文件共享等不能使用:

Building the vmmemctl module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmmemctl-only'
make -C /lib/modules/2.6.28-11-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.28-11-generic'

CC [M] /tmp/vmware-config0/vmmemctl-only/os.o
In file included from /tmp/vmware-config0/vmmemctl-only/os.c:40:
/tmp/vmware-config0/vmmemctl-only/compat_wait.h:37:5: warning: "VMW_HAVE_EPOLL" is not defined
/tmp/vmware-config0/vmmemctl-only/compat_wait.h:43:5: warning: "VMW_HAVE_EPOLL" is not defined
In file included from /tmp/vmware-config0/vmmemctl-only/os.c:40:
/tmp/vmware-config0/vmmemctl-only/compat_wait.h:60: error: conflicting types for ‘poll_initwait’
include/linux/poll.h:65: error: previous declaration of ‘poll_initwait’ was here
/tmp/vmware-config0/vmmemctl-only/os.c: In function ‘os_init’:
/tmp/vmware-config0/vmmemctl-only/os.c:567: error: ‘struct proc_dir_entry’ has no member named ‘get_info’
make[2]: *** [/tmp/vmware-config0/vmmemctl-only/os.o] Error 1
make[1]: *** [_module_/tmp/vmware-config0/vmmemctl-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.28-11-generic'
make: *** [vmmemctl.ko] Error 2
make: Leaving directory `/tmp/vmware-config0/vmmemctl-only'

Unable to build the vmmemctl module.

The memory manager driver (vmmemctl module) is used by VMware host software to
efficiently reclaim memory from a virtual machine.
If the driver is not available, VMware host software may instead need to swap
guest memory to disk, which may reduce performance.
The rest of the software provided by VMware Tools is designed to work
independently of this feature.
If you want the memory management feature, you can install the driver by
running vmware-config-tools.pl again after making sure that gcc, binutils, make
and the kernel sources for your running kernel are installed on your machine.
These packages are available on your distribution's installation CD.
[ Press Enter key to continue ]

Trying to find a suitable vmhgfs module for your running kernel.

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

Extracting the sources of the vmhgfs module.

Building the vmhgfs module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config1/vmhgfs-only'

make -C /lib/modules/2.6.28-11-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.28-11-generic'
CC [M] /tmp/vmware-config1/vmhgfs-only/backdoor.o
CC [M] /tmp/vmware-config1/vmhgfs-only/backdoorGcc32.o
CC [M] /tmp/vmware-config1/vmhgfs-only/bdhandler.o
/tmp/vmware-config1/vmhgfs-only/bdhandler.c:15:27: error: asm/semaphore.h: No such file or directory
In file included from /tmp/vmware-config1/vmhgfs-only/dbllnklst.h:14,
from /tmp/vmware-config1/vmhgfs-only/vmrpc.h:17,
from /tmp/vmware-config1/vmhgfs-only/hgfsBd.h:14,
from /tmp/vmware-config1/vmhgfs-only/bdhandler.c:29:
/tmp/vmware-config1/vmhgfs-only/vm_basic_types.h:170: error: conflicting types for ‘uintptr_t’
include/linux/types.h:40: error: previous declaration of ‘uintptr_t’ was here
In file included from /tmp/vmware-config1/vmhgfs-only/request.h:21,
from /tmp/vmware-config1/vmhgfs-only/bdhandler.c:34:
/tmp/vmware-config1/vmhgfs-only/compat_wait.h:37:5: warning: "VMW_HAVE_EPOLL" is not defined
/tmp/vmware-config1/vmhgfs-only/compat_wait.h:43:5: warning: "VMW_HAVE_EPOLL" is not defined
In file included from /tmp/vmware-config1/vmhgfs-only/request.h:21,
from /tmp/vmware-config1/vmhgfs-only/bdhandler.c:34:
/tmp/vmware-config1/vmhgfs-only/compat_wait.h:60: error: conflicting types for ‘poll_initwait’
include/linux/poll.h:65: error: previous declaration of ‘poll_initwait’ was here
make[2]: *** [/tmp/vmware-config1/vmhgfs-only/bdhandler.o] Error 1
make[1]: *** [_module_/tmp/vmware-config1/vmhgfs-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.28-11-generic'

make: *** [vmhgfs.ko] Error 2
make: Leaving directory `/tmp/vmware-config1/vmhgfs-only'
Unable to build the vmhgfs module.

The filesystem driver (vmhgfs module) is used only for the shared folder
feature. The rest of the software provided by VMware Tools is designed to work
independently of this feature.
If you wish to have the shared folders feature, you can install the driver by
running vmware-config-tools.pl again after making sure that gcc, binutils, make
and the kernel sources for your running kernel are installed on your machine.
These packages are available on your distribution'
s installation CD.
[ Press Enter key to continue ]

pcnet32 41092 0
Unloading pcnet32 module

Trying to find a suitable vmxnet module for your running kernel.

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

Extracting the sources of the vmxnet module.

Building the vmxnet module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config2/vmxnet-only'
make -C /lib/modules/2.6.28-11-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.28-11-generic'

CC [M] /tmp/vmware-config2/vmxnet-only/vmxnet.o
In file included from /tmp/vmware-config2/vmxnet-only/vmxnet.c:37:
/tmp/vmware-config2/vmxnet-only/vm_basic_types.h:170: error: conflicting types for ‘uintptr_t’
include/linux/types.h:40: error: previous declaration of ‘uintptr_t’ was here
/tmp/vmware-config2/vmxnet-only/vmxnet.c: In function ‘vmxnet_probe_device’:
/tmp/vmware-config2/vmxnet-only/vmxnet.c:687: error: implicit declaration of function ‘SET_MODULE_OWNER’
make[2]: *** [/tmp/vmware-config2/vmxnet-only/vmxnet.o] Error 1
make[1]: *** [_module_/tmp/vmware-config2/vmxnet-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.28-11-generic'
make: *** [vmxnet.ko] Error 2
make: Leaving directory `/tmp/vmware-config2/vmxnet-only'

Unable to build the vmxnet module.

The fast network device driver (vmxnet module) is used only for our fast
networking interface. The rest of the software provided by VMware Tools is
designed to work independently of this feature.
If you wish to have the fast network driver enabled, you can install the driver
by running vmware-config-tools.pl again after making sure that gcc, binutils,
make and the kernel sources for your running kernel are installed on your
machine. These packages are available on your distribution's installation CD.
[ Press Enter key to continue ]

Trying to find a suitable vmblock module for your running kernel.

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

Extracting the sources of the vmblock module.

Building the vmblock module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config3/vmblock-only'

make -C /lib/modules/2.6.28-11-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.28-11-generic'
CC [M] /tmp/vmware-config3/vmblock-only/linux/block.o
In file included from /tmp/vmware-config3/vmblock-only/linux/os.h:21,
from /tmp/vmware-config3/vmblock-only/linux/block.c:12:
/tmp/vmware-config3/vmblock-only/./include/compat_wait.h:37:5: warning: "VMW_HAVE_EPOLL" is not defined
/tmp/vmware-config3/vmblock-only/./include/compat_wait.h:43:5: warning: "VMW_HAVE_EPOLL" is not defined
In file included from /tmp/vmware-config3/vmblock-only/linux/os.h:21,
from /tmp/vmware-config3/vmblock-only/linux/block.c:12:
/tmp/vmware-config3/vmblock-only/./include/compat_wait.h:60: error: conflicting types for ‘poll_initwait’
include/linux/poll.h:65: error: previous declaration of ‘poll_initwait’ was here
In file included from /tmp/vmware-config3/vmblock-only/linux/vmblockInt.h:26,
from /tmp/vmware-config3/vmblock-only/linux/block.c:15:
/tmp/vmware-config3/vmblock-only/./include/vm_basic_types.h:170: error: conflicting types for ‘uintptr_t’
include/linux/types.h:40: error: previous declaration of ‘uintptr_t’ was here
make[2]: *** [/tmp/vmware-config3/vmblock-only/linux/block.o] Error 1
make[1]: *** [_module_/tmp/vmware-config3/vmblock-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.28-11-generic'

make: *** [vmblock.ko] Error 2
make: Leaving directory `/tmp/vmware-config3/vmblock-only


分析原因:由于编译过程和当前Linux的内核版本有很大关系,Linux内核不同版本之间代码差异较大,时常会出现某个结构多了个成员少了个成员之类的改动,造成vmware-tools在引用这个文件时出现编译错误。

解决方法:根据Linux内核版本的发布日期去下载对应的open-vm-tools(),比如我的内核版本是linux-2.6.28,我下载的就是open-vm-tools-2009.02.18-148847.tar.gz。然后解开,把open-vm-tools/modules/linux里的vmhgfs目录改名成vmhgfs-only然后压成 vmhgfs.tar, 替换vmware-tools-distrib/lib/modules/source下的同名文件,其他几个.tar文件的替换方法一样。最后重新安装vmware-tools即可。运行命令如下:

tar -xzf open-vm-tools-*.tar.gz
cd open-vm-tools-*
cd modules/linux
for i in *; do mv ${i} ${i}-only; tar -cf ${i}.tar ${i}-only; done
cd ../../../
sudo mv -f open-vm-tools-*/modules/linux


阅读(2803) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~