本文转自: http://www.blogjava.net/xiaosilent/archive/2008/04/22/194699.html
ubuntu Hardy上,安装VMware workstation时:
ubuntu Hardy上,安装VMware workstation时:
Using
2.6
.x kernel build system.
make: Entering directory ` / tmp / vmware - config2 / vmmon - only'
make - C / lib / modules / 2.6 . 24.4 - 64 .fc8 / build / include / .. SUBDIRS = $PWD SRCROOT = $PWD / . modules
make[ 1 ]: Entering directory ` / usr / src / kernels / 2.6 . 24.4 - 64 .fc8 - i686'
CC [M] / tmp / vmware - config2 / vmmon - only / linux / driver.o
CC [M] / tmp / vmware - config2 / vmmon - only / linux / hostif.o
CC [M] / tmp / vmware - config2 / vmmon - only / common / comport.o
CC [M] / tmp / vmware - config2 / vmmon - only / common / cpuid.o
In file included from include / asm / bitops.h: 2 ,
from / tmp / vmware - config2 / vmmon - only / . / include / vcpuset.h: 74 ,
from / tmp / vmware - config2 / vmmon - only / . / include / modulecall.h: 23 ,
from / tmp / vmware - config2 / vmmon - only / common / vmx86.h: 18 ,
from / tmp / vmware - config2 / vmmon - only / common / hostif.h: 18 ,
from / tmp / vmware - config2 / vmmon - only / common / cpuid.c: 14 :
include / asm / bitops_32.h: 9 : 2 : error: #error only < linux / bitops.h > can be included directly
make[ 2 ]: *** [ / tmp / vmware - config2 / vmmon - only / common / cpuid.o] Error 1
make[ 1 ]: *** [_module_ / tmp / vmware - config2 / vmmon - only] Error 2
make[ 1 ]: Leaving directory ` / usr / src / kernels / 2.6 . 24.4 - 64 .fc8 - i686'
make: *** [vmmon.ko] Error 2
make: Leaving directory ` / tmp / vmware - config2 / 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 " .
make: Entering directory ` / tmp / vmware - config2 / vmmon - only'
make - C / lib / modules / 2.6 . 24.4 - 64 .fc8 / build / include / .. SUBDIRS = $PWD SRCROOT = $PWD / . modules
make[ 1 ]: Entering directory ` / usr / src / kernels / 2.6 . 24.4 - 64 .fc8 - i686'
CC [M] / tmp / vmware - config2 / vmmon - only / linux / driver.o
CC [M] / tmp / vmware - config2 / vmmon - only / linux / hostif.o
CC [M] / tmp / vmware - config2 / vmmon - only / common / comport.o
CC [M] / tmp / vmware - config2 / vmmon - only / common / cpuid.o
In file included from include / asm / bitops.h: 2 ,
from / tmp / vmware - config2 / vmmon - only / . / include / vcpuset.h: 74 ,
from / tmp / vmware - config2 / vmmon - only / . / include / modulecall.h: 23 ,
from / tmp / vmware - config2 / vmmon - only / common / vmx86.h: 18 ,
from / tmp / vmware - config2 / vmmon - only / common / hostif.h: 18 ,
from / tmp / vmware - config2 / vmmon - only / common / cpuid.c: 14 :
include / asm / bitops_32.h: 9 : 2 : error: #error only < linux / bitops.h > can be included directly
make[ 2 ]: *** [ / tmp / vmware - config2 / vmmon - only / common / cpuid.o] Error 1
make[ 1 ]: *** [_module_ / tmp / vmware - config2 / vmmon - only] Error 2
make[ 1 ]: Leaving directory ` / usr / src / kernels / 2.6 . 24.4 - 64 .fc8 - i686'
make: *** [vmmon.ko] Error 2
make: Leaving directory ` / tmp / vmware - config2 / 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 " .
Problem: include/asm/bitops_32.h:9:2: error: #error only <linux/bitops.h> can be included directly, and vmmon-only compile failes
Solution: change line 74 in vmmon-only source file to read: #include “linux/bitops.h”
Steps:
- cd /usr/lib/vmware/modules/source
- sudo cp vmmon.tar vmmon.tar.bak
- sudo tar xvf vmmon.tar
- cd vmmon-only/include/
- sudo gedit vcpuset.h
- change line 74 from: #include “asm/bitops.h” to: #include “linux/bitops.h”
- rm vmmon.tar
- sudo tar cvf vmmon.tar vmmon-only
- sudo rm -rf vmmon-only
- sudo vmware-config.pl
That’s it, the compile will work now and vmware should be usable as normal