近期在使用ESXI的过程中,发现了一个现象:CPU占用越来越高

ESXI刚启动时,开启10个左右的linux和一个windows10,windows10在不工作的情况下CPU占用10%左右,工作下20%左右。然而每当使用了几天便会发现,明明没有程序在工作,CPU占用高达50%左右,并且无法降下来,只能重启ESXI。

一番查阅后得知,原来是要给系统装上VMware-Tools。windows系统由于是可视化界面,就不介绍了,记录一下linux系统安装过程。

挂载VMware Tools

在esxi虚拟机界面,勾选虚拟机,点击【操作-客户机操作系统-安装VMware Tools】

安装VMware Tools

1、ssh登录linux
2、挂载VMware Tools光盘

mkdir /cdrom
sudo mount /dev/cdrom /cdrom/

3、复制光盘内容

mkdir vmware-tools && cp -Rf /cdrom/* vmware-tools

4、解压里面的安装包

cd vmware-tools
#不同版本文件名不一样
tar -zxvf VMwareTools-10.3.21-14772444.tar.gz

5、执行安装脚本

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

执行后会提示是否安装,输入【y】进行安装
而后直接一路按回车,使用默认设置即可。

以下是安装过程完整输出

root@debian:~/vmware-tools# ./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? [yes] y

INPUT: [y]

A previous installation of VMware Tools has been detected.

The previous installation was made by the tar installer (version 4).

Keeping the tar4 installer database format.

You have a version of VMware Tools installed.  Continuing this install will
first uninstall the currently installed version.  Do you wish to continue?
(yes/no) [yes]

INPUT: [yes]  default

Uninstalling the tar installation of VMware Tools.

Stopping services for VMware Tools

Skipping VMware Tools services shutdown on the host:                   done

Can't exec "/etc/vmware-caf/pme/install/preupgrade.sh": 没有那个文件或目录 at /usr/bin/vmware-uninstall-tools.pl line 4421.
The removal of VMware Tools 10.3.21 build-14772444 for Linux completed
successfully.

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 common agent library files?
[/usr/lib]

INPUT: [/usr/lib]  default

In which directory do you want to install the common agent transient files?
[/var/lib]

INPUT: [/var/lib]  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.21 build-14772444 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

Initializing...


Making sure services for VMware Tools are stopped.

Stopping VMware Tools services in the virtual machine:
   Guest operating system daemon:                                      done
   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)

The vmblock enables dragging or copying files between host and guest in a
Fusion or Workstation virtual environment.  Do you wish to enable this feature?
[no]

INPUT: [no]  default


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

Do you want to enable Guest Authentication (vgauth)? Enabling vgauth is needed
if you want to enable Common Agent (caf). [yes]

INPUT: [yes]  default

Do you want to enable Common Agent (caf)? [no]

INPUT: [no]  default

No X install found.


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

Generating the key and certificate files.
Successfully generated the key and certificate files.
The configuration of VMware Tools 10.3.21 build-14772444 for Linux for this
running kernel completed successfully.

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

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
3. Restart your X session.

Enjoy,

--the VMware team