Today, I checked Linux Kernel modules and suddenly found that there is an old Kernel directory under/lib/modules. I went in with curiosity and found that there were some residual configurations in the result, from the perspective of name, it should be related to VMWare. Isn't it difficult to say that some shared libraries in the installer are in the kernel modules directory during the initial installation? Look at the module Directory of the new kernel. There is nothing:
[Xport @ ubuntu misc] $ pwd /Lib/modules/2.6.17-11-generic/misc
[Xport @ ubuntu misc] $ ls-l Total usage 1380 Lrwxrwxrwx 1 root 43 2007-04-21 0:33 vmmon. ko->/lib/modules/2.6.17-11-generic/misc/vmmon. o -Rw-r -- 1 root 487101 2007-04-21 0:33 vmmon. o Lrwxrwxrwx 1 root 43 2007-04-21 0:34 vmnet. ko->/lib/modules/2.6.17-11-generic/misc/vmnet. o -Rw-r -- 1 root 913781 vmnet. o
|
Considering the benefits of * NIX, it's better to use the music video directly. Can it be used directly ?!
[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
|
However, the network service running vmware fails. The prompt is:
[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.
|
Run the vmware-config.pl and this error prompt:
[Xport @ ubuntu ~] $ Sudo/usr/bin/vmware-config.pl
... ... Omitted... ...
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 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 [MB]/tmp/vmware-config0/vmmon-only/Linux/driver. o In file encoded ded 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.
|
An error occurred while building modules!
To solve this problem, you need to modify the module source of VMWare. All the sources are a tar file:
[Xport @ ubuntu ~] $ Ls-l/usr/lib/vmware/modules/source/ Total usage 1824 -R -- 1 root 706560 vmmon.tar <--- we need to modify compat_kernel.h in this tar file. -R -- 1 root 378880 vmnet.tar -R -- 1 root 51200 vmppuser.tar
|
The modified content is as follows. After the code of the 21th line is removed, the file is written back to the original vmmon.tar file:
/* * static inline _syscall1(int, compat_exit, int, exit_code); */
|
After this is done, you can run the vmware-config.pl to compile and generate the kernel modules!
* ** Addendum ***
Later, while hanging out on the Forum, I saw a better solution. My approach was a little violent + rough!
The modification is as follows (it turns out that VMWare is incompatible with the kernel after 2.6.19 ):
# If LINUX_VERSION_CODE <KERNEL_VERSION (2, 6, 19)
Static inline _ syscall1 (int, compat_exit, int, exit_code );
# Endif