Ubuntu 9.04安装VMWare Tools

测试需要,这次在VMWare Workstation 6.5.2下安装了Ubuntu 9.04版,语言选择的是简体中文,安装完毕之后Ubuntu完成自动升级,结果发现VMWare Tools好像没有装好,鼠标不能自动移出控制台。决定重新安装一下VMWare Tools。谁知道从光盘拷贝文件解压之后竟然没有顺利安装,报错如下:

Using compiler “/usr/bin/gcc”. Use environment variable CC to override.

Your compiler “/usr/bin/gcc” version “gcc 版本 4.3.3 (Ubuntu 4.3.3-5ubuntu4)
“ is not supported by this version of VMware Tools.

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 ]

郁闷坏了,经过调试发现这个破VMWare Tools在获取gcc版本信息时是解析“gcc version …”,而且必须是英语的version,偏偏中文版Ubuntu把这个也翻译了。解决办吧就是更改Ubuntu的系统语言为English。通过菜单系统->系统管理->语言支持,把默认语言改成English(United States),退出之后再次登录,重新安装即可顺利通过安装。

但是在进入到vmware-config-tools.pl这一步时却又报错。说是__grab_cache_page函数重定义了。VMWare现在都是最大的虚拟化供应商怎么犯这个错误了。解决办法是进入/usr/lib/vmware-tools/modules/source目录解压vmhgfs.tar中的page.c,并编辑page.c中的867行修改为

page = grab_cache_page(mapping, index);
重新运行vmware-config-tools.pl即可。