在 Linux 虚拟机中手动安装 VMware Tools
Last Updated January 26, 2025

对于 Linux 虚拟机,您可以从命令行手动安装 VMware Tools。对于 Linux 的较高发行版,请使用集成的 open-vm-tools 版本。
有关 open-vm-tools 的操作系统兼容性的详细信息,请参见
《VMware 兼容性指南》
,网址为 https://www.vmware.com/resources/compatibility/search.php
  • Power on the virtual machine.
  • Verify that the guest operating system is running.
  • Because the VMware Tools installer is written in Perl, verify that Perl is installed in the guest operating system.
  • For vSphere virtual machines, determine whether you have the latest version of VMware Tools. In the vSphere Client inventory, select the virtual machine and click the
    Summary
    tab.
  1. Select the menu command to mount the VMware Tools virtual disk on the guest operating system.
    VMware Product
    Action
    vSphere Client (HTML5)
    Right-click the virtual machine and select
    Guest OS
    Install (or Upgrade) Tools
    vSphere Client
    Inventory
    Virtual Machine
    Guest
    Install/Upgrade VMware
    vSphere Web Client
    Right-click the virtual machine and select
    Guest OS
    Install (or Upgrade) VMware Tools
    Fusion
    Virtual Machine
    Install (or Upgrade) VMware Tools
    Workstation Pro
    VM
    Install (or Upgrade) VMware Tools
    Workstation Player
    Player
    Manage
    Install (or Upgrade) VMware Tools
  2. 在虚拟机中,打开终端窗口。
  3. 不带参数运行
    mount
    命令以确定 Linux 发行版是否自动装载 VMware Tools 虚拟 CD-ROM 映像。
    如果已挂载 CD-ROM 设备,CD-ROM 设备及其挂载点将以类似于以下输出的形式列出:
    /dev/cdrom on /mnt/cdrom type iso9660 (ro,nosuid,nodev)
  4. 如果未装载 VMware Tools 虚拟 CD-ROM 映像,请装载 CD-ROM 驱动器。
    1. 如果装载点目录尚不存在,请创建该目录。
      mkdir /mnt/cdrom
      某些 Linux 发行版使用不同的装载点名称。例如,某些发行版上的装载点是
      /media/VMware Tools
      而不是
      /mnt/cdrom
      。请修改该命令以反映您的发行版使用的约定。
    2. 装载 CD-ROM 驱动器。
      mount /dev/cdrom /mnt/cdrom
      某些 Linux 发行版使用不同的设备名称,或者以不同的方式组织
      /dev
      目录。如果 CD-ROM 驱动器不是
      /dev/cdrom
      或 CD-ROM 装载点不是
      /mnt/cdrom
      ,则必须修改该命令以反映您的发行版使用的约定。
  5. Change to a working directory, for example,
    /tmp
    .
    cd /tmp
  6. (可选)在安装 VMware Tools 之前,删除以前的
    vmware-tools-distrib
    目录。
    该目录的位置取决于以前安装时的存储位置。通常,该目录位于
    /tmp/vmware-tools-distrib
  7. 列出挂载点目录的内容,并记下 VMware Tools tar 安装程序的文件名。
    ls mount-point
  8. 解压缩安装程序。
    tar zxpf /mnt/cdrom/VMwareTools-x.x.x-yyyy.tar.gz
    x.x.x
    值是产品版本号,
    yyyy
    是产品版本的内部版本号。
  9. 如果需要,请卸载 CD-ROM 映像。
    umount /dev/cdrom
    如果 Linux 发行版自动装载 CD-ROM,则不需要卸载该映像。
  10. 运行安装程序并以 root 用户身份配置 VMware Tools。
    cd vmware-tools-distrib
    sudo ./vmware-install.pl
    通常,在安装程序文件结束运行后,将行
    vmware-config-tools.pl
    配置文件。如果尝试安装 tar 安装以覆盖 RPM 安装或相反,安装程序将检测以前的安装并且必须转换安装程序数据库格式,然后才能继续操作。
    对于 Linux 的较高发行版,系统会提示用户选择集成的 open-vm-tools。
  11. Follow the prompts to accept the default values, if appropriate for your configuration.
  12. Follow the instructions at the end of the script.
    Depending on the features you use, these instructions can include restarting the X session, restarting networking, logging in again, and starting the VMware User process. You can alternatively reboot the guest operating system to accomplish all these tasks.
If you are using vCenter Server, the
VMware Tools
label on the
Summary
tab changes to
OK
.
If you upgraded VMware Tools as part of a vSphere upgrade, next determine whether to upgrade the virtual machines in your environment. To review and compare the hardware available for different compatibility levels, see the
vSphere Virtual Machine Administration
documentation.