安装VMware Tools

安装VMware Tools 在 Linux 上手动安装 VMware Tools

在Debian 9系统上安装

1、查看系统版本

hostnamectl查看系统版本信息

显示当前的操作系统是 Debian 9,代号为 "stretch"。这是Debian的一个长期支持版本,发布于2017年。

root@ucs-8389:~# hostnamectl
Static hostname: ucs-8389
Icon name: computer-vm
Chassis: vm
Machine ID: 23**************
Boot ID: 42*****************
Virtualization: vmware
Operating System: Debian GNU/Linux 9 (stretch)
Kernel: Linux 4.9.0-11-amd64
Architecture: x86-64
root@ucs-8389:~#

可选操作:确保系统更新:

配置debian 9.x (stretch)阿里源

编辑/etc/apt/sources.list文件(需要使用sudo), 在文件最前面添加以下条目(操作前请做好相应备份)

deb https://mirrors.aliyun.com/debian-archive/debian stretch main contrib non-free
#deb https://mirrors.aliyun.com/debian-archive/debian stretch-proposed-updates main non-free contrib
deb https://mirrors.aliyun.com/debian-archive/debian stretch-backports main non-free contrib
deb https://mirrors.aliyun.com/debian-archive/debian-security stretch/updates main contrib non-free
deb-src https://mirrors.aliyun.com/debian-archive/debian stretch main contrib non-free
#deb-src https://mirrors.aliyun.com/debian-archive/debian stretch-proposed-updates main contrib non-free
deb-src https://mirrors.aliyun.com/debian-archive/debian stretch-backports main contrib non-free
deb-src https://mirrors.aliyun.com/debian-archive/debian-security stretch/updates main contrib non-free

即便 Debian 9 不再接收安全更新,安装之前还是建议先更新系统已有的包:

sudo apt-get update
sudo apt-get upgrade

2、安装必要的工具:

apt-get install build-essential linux-headers-$(uname -r) module-assistant

3、在 VMware 中装载 VMware Tools ISO:

打开 VMware 界面,选择您的虚拟机,然后从菜单中选择 "虚拟机" -> "安装 VMware Tools"(或类似选项,具体取决于 VMware 的版本和界面语言)。这会装载一个 VMware Tools 的 ISO 文件到虚拟机的光驱中。(前提是必须挂载一个CD光驱)

前提是必须挂载一个CD光驱

下发后我们能够看到设备路径修改为:ISO [] /usr/lib/vmware/isoimages/linux.iso

4、挂载 VMware Tools ISO: 在虚拟机的终端中,找到光驱挂载点,通常是 /media/cdrom,然后将其挂载:

sudo mount /dev/cdrom /mnt

5、复制 VMware Tools 到本地目录并解压: 进入挂载目录,找到 VMware Tools 的 tarball 文件,通常名为 VMwareTools-x.x.x-yyyyyyyy.tar.gz,然后复制到一个工作目录并解压:

cd /mnt
cp VMwareTools-10.3.23-17030940.tar.gz /tmp/
cd /tmp
tar -zxvf VMwareTools-10.3.23-17030940.tar.gz

如有必要,请卸载 CD-ROM 映像。以免开机后出现引导问题。

umount /dev/cdrom

安装 VMware Tools: 进入解压后的目录,运行安装脚本:

cd vmware-tools-distrib
sudo ./vmware-install.pl

如果你遇到这样的报错问题

root@ucs-8389:/tmp/vmware-tools-distrib# ./vmware-install.pl
open-vm-tools packages are available from the OS vendor and VMware recommends
using open-vm-tools packages. See

http://kb.vmware.com/kb/2073803
for more
information.
Do you still want to proceed with this installation? [no]

这时需要安装如下

apt-get install open-vm-tools open-vm-tools-desktop

正常的安装过程中,大多数情况下您可以接受默认设置,只需按回车键即可。但如果您有特殊需求,可以根据提示进行相应配置。(过程如下)

查看代码
 root@ucs-8389:/tmp/vmware-tools-distrib# ./vmware-install.pl
The installer has detected an existing installation of open-vm-tools packages
on this system and will not attempt to remove and replace these user-space
applications. It is recommended to use the open-vm-tools packages provided by
the operating system. If you do not want to use the existing installation of
open-vm-tools packages and use VMware Tools, you must uninstall the
open-vm-tools packages and re-run this installer.
The packages that need to be removed are:
open-vm-tools
Packages must be removed with the --purge option.
The installer will next check if there are any missing kernel drivers. Type yes
if you want to do this, otherwise type no [yes] yes

INPUT: [yes]

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]

INPUT: [/usr/bin]  default

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

INPUT: [/etc]  default

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

INPUT: [/etc/init.d]  default

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

INPUT: [/usr/sbin]  default

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

INPUT: [/usr/lib/vmware-tools]  default

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]

INPUT: [yes]  default

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

INPUT: [/usr/share/doc/vmware-tools]  default

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]

INPUT: [yes]  default

The installation of VMware Tools 10.3.23 build-17030940 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]

INPUT: [yes]  default


You have chosen to install VMware Tools on top of an open-vm-tools package.
You will now be given the option to replace some commands provided by
open-vm-tools.  Please note that if you replace any commands at this time and
later remove VMware Tools, it may be necessary to re-install the open-vm-tools.

The file /usr/bin/vmware-hgfsclient that this program was about to install
already exists.  Overwrite? [no]

INPUT: [no]  default

The file /sbin/mount.vmhgfs that this program was about to install already
exists.  Overwrite? [no]

INPUT: [no]  default

The file /usr/bin/vmhgfs-fuse that this program was about to install already
exists.  Overwrite? [no]

INPUT: [no]  default

Initializing...


Making sure services for VMware Tools are stopped.

Stopping VMware Tools services in the virtual machine:
   VMware User Agent (vmware-user):                                    done
   Unmounting HGFS shares:                                             done
   Guest filesystem driver:                                            done


The module vmci has already been installed on this system by another installer
or package and will not be modified by this installer.

The module vsock has already been installed on this system by another installer
or package and will not be modified by this installer.

The module vmxnet3 has already been installed on this system by another
installer or package and will not be modified by this installer.

The module pvscsi has already been installed on this system by another
installer or package and will not be modified by this installer.

The module vmmemctl has already been installed on this system by another
installer or package and will not be modified by this installer.

The VMware Host-Guest Filesystem allows for shared folders between the host OS
and the guest OS in a Fusion or Workstation virtual environment.  Do you wish
to enable this feature? [no]

INPUT: [no]  default

The vmxnet driver is no longer supported on kernels 3.3 and greater. Please
upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)


Skipping configuring automatic kernel modules as no drivers were installed by
this installer.


Skipping rebuilding initrd boot image for kernel as no drivers to be included
in boot image were installed by this installer.

The configuration of VMware Tools 10.3.23 build-17030940 for Linux for this
running kernel completed successfully.

Found VMware Tools CDROM mounted at /mnt. Ejecting device /dev/sr0 ...
VMware Tools installed on top of open-vm-tools has not added anything of
significance or potential benefit.  VMware Tools is not needed.

Would you like to recover the wasted disk space by uninstalling VMware Tools at
this time? (yes/no) [yes]

INPUT: [yes]  default

Uninstalling the tar installation of VMware Tools.

Stopping services for VMware Tools

Stopping VMware Tools services in the virtual machine:
   VMware User Agent (vmware-user):                                    done
   Unmounting HGFS shares:                                             done
   Guest filesystem driver:                                            done

The removal of VMware Tools 10.3.23 build-17030940 for Linux completed
successfully.  Thank you for having tried this software.

root@ucs-8389:/tmp/vmware-tools-distrib#

完成安装并重启: 安装完成后,根据提示重启虚拟机以使所有更改生效:

安装成功重启后的效果截图:主机和IP地址都会显示出来,VMware Tools也会变成“是”

posted @ 2024-06-18 17:54  Magiclala  阅读(114)  评论(0编辑  收藏  举报