Skip to content

23.20 在VMware 6.0+Debian 4.0上安装VMwareTools

Q:

在VMware 6.0+Debian 4.0上执行vmware-install.pl安装VMwareTools,相关编译器 已存在,安装结束时注意到如下提示:


To use the vmxnet driver, restart networking using the following commands:

/etc/init.d/networking stop rmmod pcnet32 rmmod vmxnet depmod -a modprobe vmxnet /etc/init.d/networking start


但执行"modprobe vmxnet"报告找不到这个模块。

A:

[root@ /root/src/vmware-tools-distrib]> ls ./ ../ bin/ doc/ etc/ FILES INSTALL@ installer/ lib/ vmware-install.pl@ [root@ /root/src/vmware-tools-distrib/lib/modules/source]> ls ./ ../ vmblock.tar vmci.tar vmdesched.tar vmhgfs.tar vmmemctl.tar vmxnet.tar

将vmxnet.tar复制到/tmp目录下解压、编译,提示内核是用gcc 4.1编译的,而当前 gcc是4.3版的,导致编译模块失败,用"CC=gcc-4.1 make"编译成功。据此解决办法 如下:

[root@ /root/src]> ls -l /usr/bin/gcc lrwxrwxrwx 1 root root 7 12-05 09:15 /usr/bin/gcc -> gcc-4.3 -rwxr-xr-x 1 root root 74104 2006-07-14 /usr/bin/gcc-2.95 -rwxr-xr-x 1 root root 80976 2007-01-04 /usr/bin/gcc-3.3 -rwxr-xr-x 1 root root 196932 06-24 10:23 /usr/bin/gcc-4.1 -rwxr-xr-x 1 root root 207648 09-06 06:52 /usr/bin/gcc-4.3 [root@ /root/src]> ln -sf /usr/bin/gcc-4.1 /usr/bin/gcc [root@ /root/src]> ls -l /usr/bin/gcc lrwxrwxrwx 1 root root 16 12-09 13:50 /usr/bin/gcc -> /usr/bin/gcc-4.1 [root@ /root/src/vmware-tools-distrib]> ./vmware-install.pl

建议事后恢复gcc的设置:

[root@ /root/src]> ln -sf /usr/bin/gcc-4.3 /usr/bin/gcc

相关文件如下:

/lib/modules/2.6.18-4-686/misc/vmxnet.o /lib/modules/2.6.18-4-686/misc/vmxnet.ko /lib/modules/2.6.18-4-686/kernel/drivers/net/pcnet32.ko

建议在/etc/rc.local中增加如下内容:


/etc/init.d/networking stop rmmod pcnet32 rmmod vmxnet depmod -a modprobe vmxnet /etc/init.d/networking start