[教学]Ubuntu在VMware6虚拟机中安装VMwareTools

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
lnan3
帖子: 2
注册时间: 2008-09-17 2:11

[教学]Ubuntu在VMware6虚拟机中安装VMwareTools

#1

帖子 lnan3 » 2008-09-17 22:07

在虚拟机中安装完ubuntu后,第一个想到的就是安装VmwareTools。点击Vmware菜单上的“虚拟机” ——>安装VmwareTools工具,然后Vmware会自动把linux.iso光盘镜像载入当前的系统中。如果采用DaemonTool虚拟光驱安装的ubuntu系统,请将linux.iso的镜像文件载入虚拟光驱中。
其实Linux,ubuntu都一样,点击完之后,在ubuntu的桌面上就会多出一个光驱。点一下,出了两个文件,一个是RPM,一个tgz的。RPM是给Redhat用的,我们自然是用后者了。
linux.iso镜像文件下载地址: http://www.vmware.cn/Soft/ShowSoftDown. ... oftID=1053
赋予ROOT管理员帐户登录桌面的权限,至于如何给ROOT赋予登录的权限,坛子里相关文章很多,请自己寻找。赋予ROOT用户登录权限后,注销当前用户,使用ROOT管理员登录桌面。
将镜像文件中的VMwareTools-6.0.3-80004.tar.gz复制到 /tmp ,至此,准备工作就完成了,接下来我们要启动终端,终端的启动位置为:应用程序--附件--终端

启动终端,在终端中的全部操作部分,用粗体字做了标示,如下:

root@lnan3-desktop:~# cd /tmp
root@lnan3-desktop:/tmp# tar zxf VMwareTools-6.0.3-80004.tar.gz
root@lnan3-desktop:/tmp# cd vmware-tools-distrib
root@lnan3-desktop:/tmp/vmware-tools-distrib#./vmware-install.pl
Creating a new VMware Tools installer database using the tar4 format.

Installing VMware Tools.

In which directory do you want to install the binary files?
[/usr/bin] /usr/bin

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc] /etc

What is the directory that contains the init scripts?
[/etc/init.d] /etc/init.d

In which directory do you want to install the daemon files?
[/usr/sbin] /usr/sbin

In which directory do you want to install the library files?
[/usr/lib/vmware-tools] /usr/lib/vmware-tools

The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes] y

In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools] /usr/share/doc/vmware-tools

The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes] y

The installation of VMware Tools 6.0.3 build-80004 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes] y


Stopping VMware Tools services in the virtual machine:
Guest operating system daemon: done
Trying to find a suitable vmmemctl module for your running kernel.

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

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.24-16-generic/build/include] /lib/modules/2.6.24-16-generic/build/include

Extracting the sources of the vmmemctl module.

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.24-16-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.24-16-generic'
CC [M] /tmp/vmware-config0/vmmemctl-only/os.o
SHIPPED /tmp/vmware-config0/vmmemctl-only/vmmemctl1.o
LD [M] /tmp/vmware-config0/vmmemctl-only/vmmemctl.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: could not find /tmp/vmware-config0/vmmemctl-only/.vmmemctl1.o.cmd for /tmp/vmware-config0/vmmemctl-only/vmmemctl1.o
CC /tmp/vmware-config0/vmmemctl-only/vmmemctl.mod.o
LD [M] /tmp/vmware-config0/vmmemctl-only/vmmemctl.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-16-generic'
cp -f vmmemctl.ko ./../vmmemctl.o
make: Leaving directory `/tmp/vmware-config0/vmmemctl-only'
The module loads perfectly in the running kernel.

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] y

Extracting the sources of the vmhgfs module.

Building the vmhgfs module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmhgfs-only'
make -C /lib/modules/2.6.24-16-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.24-16-generic'
CC [M] /tmp/vmware-config0/vmhgfs-only/backdoor.o
CC [M] /tmp/vmware-config0/vmhgfs-only/backdoorGcc32.o
CC [M] /tmp/vmware-config0/vmhgfs-only/bdhandler.o
CC [M] /tmp/vmware-config0/vmhgfs-only/cpName.o
In file included from include/linux/string.h:11,
from /tmp/vmware-config0/vmhgfs-only/cpName.h:18,
from /tmp/vmware-config0/vmhgfs-only/cpName.c:18:
include/linux/types.h:40: error: conflicting types for 'uintptr_t'
/tmp/vmware-config0/vmhgfs-only/vm_basic_types.h:170: error: previous declaration of 'uintptr_t' was here
make[2]: *** [/tmp/vmware-config0/vmhgfs-only/cpName.o] Error 1
make[1]: *** [_module_/tmp/vmware-config0/vmhgfs-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-16-generic'
make: *** [vmhgfs.ko] Error 2
make: Leaving directory `/tmp/vmware-config0/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 34820 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] y

Extracting the sources of the vmxnet module.

Building the vmxnet module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config1/vmxnet-only'
make -C /lib/modules/2.6.24-16-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.24-16-generic'
CC [M] /tmp/vmware-config1/vmxnet-only/vmxnet.o
Building modules, stage 2.
MODPOST 1 modules
CC /tmp/vmware-config1/vmxnet-only/vmxnet.mod.o
LD [M] /tmp/vmware-config1/vmxnet-only/vmxnet.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-16-generic'
cp -f vmxnet.ko ./../vmxnet.o
make: Leaving directory `/tmp/vmware-config1/vmxnet-only'
The module loads perfectly in the running kernel.

update-initramfs: Generating /boot/initrd.img-2.6.24-16-generic
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] y

Extracting the sources of the vmblock module.

Building the vmblock module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config1/vmblock-only'
make -C /lib/modules/2.6.24-16-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.24-16-generic'
CC [M] /tmp/vmware-config1/vmblock-only/linux/block.o
CC [M] /tmp/vmware-config1/vmblock-only/linux/control.o
CC [M] /tmp/vmware-config1/vmblock-only/linux/dbllnklst.o
CC [M] /tmp/vmware-config1/vmblock-only/linux/dentry.o
CC [M] /tmp/vmware-config1/vmblock-only/linux/file.o
CC [M] /tmp/vmware-config1/vmblock-only/linux/filesystem.o
CC [M] /tmp/vmware-config1/vmblock-only/linux/inode.o
CC [M] /tmp/vmware-config1/vmblock-only/linux/module.o
CC [M] /tmp/vmware-config1/vmblock-only/linux/stubs.o
CC [M] /tmp/vmware-config1/vmblock-only/linux/super.o
LD [M] /tmp/vmware-config1/vmblock-only/vmblock.o
Building modules, stage 2.
MODPOST 1 modules
CC /tmp/vmware-config1/vmblock-only/vmblock.mod.o
LD [M] /tmp/vmware-config1/vmblock-only/vmblock.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-16-generic'
cp -f vmblock.ko ./../vmblock.o
make: Leaving directory `/tmp/vmware-config1/vmblock-only'
The module loads perfectly in the running kernel.

[EXPERIMENTAL] The Virtual Machine Communication Interface (VMCI) service
provides a new communication capability with the Host, primarily for
development at the moment. Would you like to enable this feature? [no] no



Detected X.org version 0.0.0.



No drivers for X.org version: 0.0.0.


Please choose one of the following display sizes that X will start with (1 -
15):

[1] "640x480"
[2]< "800x600"
[3] "1024x768"
[4] "1152x864"
[5] "1280x800"
[6] "1152x900"
[7] "1280x1024"
[8] "1376x1032"
[9] "1400x900"
[10] "1400x1050"
[11] "1440x900"
[12] "1680x1050"
[13] "1600x1200"
[14] "1920x1200"
[15] "2364x1773"
Please enter a number between 1 and 15:

[2] 2

Starting VMware Tools services in the virtual machine:
Switching to guest configuration: done
Guest memory manager: done
Guest vmxnet fast network device: done
Blocking file system: done
DMA setup: done
Guest operating system daemon: done

The configuration of VMware Tools 6.0.3 build-80004 for Linux for this running
kernel completed successfully.

You must restart your X session before any mouse or graphics changes take
effect.

You can now run VMware Tools by invoking the following command:
"/usr/bin/vmware-toolbox" during an X server session.

To use the vmxnet driver, restart networking using the following commands:
/etc/init.d/networking stop
rmmod pcnet32
rmmod vmxnet
modprobe vmxnet
/etc/init.d/networking start

To make use of the virtual printer, you will need to restart the CUPS service

Enjoy,

--the VMware team

root@lnan3-desktop:/tmp/vmware-tools-distrib#
头像
想入非非
帖子: 8078
注册时间: 2008-07-14 22:42
来自: Beijing
联系:

#2

帖子 想入非非 » 2008-09-17 22:48

安装VM6.5似乎没有你说的这些步骤。。。 :oops:
Ubuntu User
lnan3
帖子: 2
注册时间: 2008-09-17 2:11

#3

帖子 lnan3 » 2008-09-18 0:28

想入非非 写了:安装VM6.5似乎没有你说的这些步骤。。。 :oops:
你说的VM6.5是完整版的吗?我上面那些步骤针对的是只有windows.iso镜像的绿色精简版VM虚拟机中VM Tools的安装的啊!
头像
想入非非
帖子: 8078
注册时间: 2008-07-14 22:42
来自: Beijing
联系:

#4

帖子 想入非非 » 2008-09-18 13:38

lnan3 写了:
想入非非 写了:安装VM6.5似乎没有你说的这些步骤。。。 :oops:
你说的VM6.5是完整版的吗?我上面那些步骤针对的是只有windows.iso镜像的绿色精简版VM虚拟机中VM Tools的安装的啊!
就是完整版的。。。安装完win之后就自动安装VM Tools了 :wink:
Ubuntu User
smilefafa
帖子: 3
注册时间: 2008-09-20 10:12

Re: [教学]Ubuntu在VMware6虚拟机中安装VMwareTools

#5

帖子 smilefafa » 2008-09-22 16:32

请问一下,我按照LZ的步骤,做到 vmware-install.pl这一步时,终端提示:bash: vmware-install.pl:找不到命令
是什么原因,应该怎么办呢?
测试平台是:VMware6.03+Ubuntu8.04

谢谢!
_________________________________________________________________________________
问题已经解决,再次感谢LZ的帖子
回复