VMware 下 Linux 利用虚拟光驱安装 VMware Tools 详解

时间:2023-02-09 06:55:26

     我用的Linux系统是Fedora,刚学Linux,好多东西还不会,昨晚因为需要在主机系统window 7和虚拟系统Fedora之间copy或托拉文件,为此需要在虚拟机系统Fedora上安装Vmware Tools,现将详细的安装过程记录如下:

 

 

在安装之前要确保虚拟机已开机,并且虚拟操作系统已经正常运行。

1.  在主机系统上 VMware workstation菜单上,选择VM->install VMware Tools.如果早先版本的VMware Tools已经被安装,则VM菜单下显示Update VMware Tools,如果当前版本的VMware Tools已经被安装,则菜单下显示Reinstall VMware Tools.
2.  在虚拟操作系统上,以管理员身份(root)登录系统。
3.  如果你的Linux配置没有自动mount CD-ROMs,则mount VMware Tools 的虚拟CD-ROM镜像。

a.  如果需要,则创建目录/mnt/cdrom directory:

mkdir /mnt/cdrom

b.  mount CD-ROM 驱动

有一些Linux系统配置用的是不同的驱动名字和组织目录,如果你的CD-ROM驱动不在 /dev/cdrom下或者你的挂载点不在/mnt/cdrom,则需根据你的配置环境修改相应的命令。

 mount /dev/cdrom /mnt/cdrom

4.  改变工作目录,(如:/tmp)

cd /tmp

5.如果存在以前安装文件,则删除以前的vmware-tools-distrib 目录。

该目录位置与你以前放置安装文件的位置相关,通常他放置在 /tmp/vmware-tools-distrib 里。

6.  解压安装程序

tar zxpf /mnt/cdrom/VMwareTools-8.4.4-301548.tar.gz

值<x.x.x>是产品版本,数字和<yyyy>是产品打包发布号。

7.  如果必要,则umount CD-ROM 镜像。

如果Linux系统配置是自动挂载CD-ROM,则没有必要 umount CD-ROM镜像。

umount /dev/cdrom

8  .运行 VMware Tools安装文件。

 cd vmware-tools-distrib

./vmware-install.pl

命令行上提示安装向导信息,按Enter键接受默认值。安装完成后会自动运行配置文件 vmware-config-tools.pl

9.  如果是更新VMware Tools,则需重启虚拟操作系统或者手动重新加载pvscsi, vmxnet vmxnet3 Linux内核模块。如果是重新加载内核模块,那么虚拟机的网络会被中断。

10.  运行下列命令重启网络:

 

/etc/init.d/network stop
rmmod pcnet32
rmmod vmxnet
modprobe vmxnet
/etc/init.d/network start

 

11. 登出管理员账户,即root.
exit
12.  (可选)进入系统图形环境
13.  在终端(terminal)运行VMware User process,输入如下命令:
vmware-user
下面是本人亲自安装过程及命令(不在作解释):


[lxiron@FedoraOS ~]$ su root
Password: 
[root@FedoraOS lxiron]# mkdir /mnt/cdrom
[root@FedoraOS lxiron]# cd /
[root@FedoraOS /]# pwd
/
[root@FedoraOS /]# ls
bin   dev  home  lost+found  mnt  proc  sbin     srv  tmp  var
boot  etc  lib   media       opt  root  selinux  sys  usr
[root@FedoraOS /]# cd mnt
[root@FedoraOS mnt]# cd cdrom
[root@FedoraOS cdrom]# cd /
[root@FedoraOS /]# mount /dev/cdrom /mnt/cdrom
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@FedoraOS /]# cd /tmp
[root@FedoraOS tmp]# tar zxpf /mnt/cdrom/VMwareTools-8.4.4-301548.tar.gz
[root@FedoraOS tmp]# umount /dev/cdrom
[root@FedoraOS tmp]# cd vmware-tools-distrib
[root@FedoraOS 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] 
What is the directory that contains the init directories (rc0.d/ to rc6.d/)? 
[/etc/rc.d] 
What is the directory that contains the init scripts? 
[/etc/rc.d/init.d] 
In which directory do you want to install the daemon files? 
[/usr/sbin] 
In which directory do you want to install the library files? 
[/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] 
In which directory do you want to install the documentation files? 
[/usr/share/doc/vmware-tools] 
The path "yes" is a relative path. Please enter an absolute path.
In which directory do you want to install the documentation files? 
[/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] 
The installation of VMware Tools 8.4.4 build-301548 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] 
Initializing...
Making sure services for VMware Tools are stopped.
Found a compatible pre-built module for vmmemctl.  Installing it...
Found a compatible pre-built module for vmhgfs.  Installing it...
Found a compatible pre-built module for vmxnet.  Installing it...
Found a compatible pre-built module for vmblock.  Installing it...
Found a compatible pre-built module for vmci.  Installing it...
Found a compatible pre-built module for vsock.  Installing it...
The module vmxnet3 has already been installed on this system by another 
installer or package and will not be modified by this installer.  Use the flag 
--clobber-kernel-modules=vmxnet3 to override.
The module pvscsi has already been installed on this system by another 
installer or package and will not be modified by this installer.  Use the flag 
--clobber-kernel-modules=pvscsi to override.
Disabling timer-based audio scheduling in pulseaudio.
Detected Xorg X server version 1.8.0.
Distribution provided drivers for Xorg X server are used.
Skipping X configuration because X drivers are not included.
Creating a new initrd boot image for the kernel.
vmware-tools start/running
The configuration of VMware Tools 8.4.4 build-301548 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 "/usr/bin/vmware-toolbox-cmd" from the
command line or by invoking "/usr/bin/vmware-toolbox" from the command line 
during an X server session.
To enable advanced X features (e.g., guest resolution fit, drag and drop, and 
file and text copy/paste), you will need to do one (or more) of the following:
1. Manually start /usr/bin/vmware-user
2. Log out and log back into your desktop session; and,
3. Restart your X session.
To use the vmxnet driver, restart networking using the following commands: 
/etc/init.d/network stop
rmmod pcnet32
rmmod vmxnet
modprobe vmxnet
/etc/init.d/network start
Enjoy,
--the VMware team
Found VMware Tools CDROM mounted at /media/VMware Tools. Ejecting device 
/dev/sr0 ...
[root@FedoraOS vmware-tools-distrib]# /etc/init.d/network stop
Shutting down interface eth0:  Device state: 3 (disconnected)
                                                           [  OK  ]
Shutting down loopback interface:  Error org.freedesktop.NetworkManagerSettings.InvalidConnection: ifcfg file '/etc/sysconfig/network-scripts/ifcfg-lo' unknown
Error org.freedesktop.NetworkManagerSettings.InvalidConnection: ifcfg file '/etc/sysconfig/network-scripts/ifcfg-lo' unknown
Error org.freedesktop.NetworkManagerSettings.InvalidConnection: ifcfg file '/etc/sysconfig/network-scripts/ifcfg-lo' unknown
Error org.freedesktop.NetworkManagerSettings.InvalidConnection: ifcfg file '/etc/sysconfig/network-scripts/ifcfg-lo' unknown
                                                           [  OK  ]
[root@FedoraOS vmware-tools-distrib]# rmmod vmxnet
[root@FedoraOS vmware-tools-distrib]# modprobe vmxnet
[root@FedoraOS vmware-tools-distrib]# /etc/init.d/network start
Bringing up loopback interface:  Error org.freedesktop.NetworkManagerSettings.InvalidConnection: ifcfg file '/etc/sysconfig/network-scripts/ifcfg-lo' unknown
Error org.freedesktop.NetworkManagerSettings.InvalidConnection: ifcfg file '/etc/sysconfig/network-scripts/ifcfg-lo' unknown
Error org.freedesktop.NetworkManagerSettings.InvalidConnection: ifcfg file '/etc/sysconfig/network-scripts/ifcfg-lo' unknown
Error org.freedesktop.NetworkManagerSettings.InvalidConnection: ifcfg file '/etc/sysconfig/network-scripts/ifcfg-lo' unknown
                                                           [  OK  ]
Bringing up interface eth0:  Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/1
state: activated
Connection activated
                                                           [  OK  ]
[root@FedoraOS vmware-tools-distrib]# lxiron
Command not found. su lxiron
[root@FedoraOS vmware-tools-distrib]# su lxiron
[lxiron@FedoraOS vmware-tools-distrib]$ 


本安装步骤是本人翻译与VMware workstation的帮助手册,转载请注明本人版权信息。