Cómo instalar las VMware Tools en una máquina virtual con el sistema operativo Linux CentOS 7 en su edición minimal, la cual no lleva modo gráfico. Lo haremos sobre el sistema de virtualización VMware ESXI 6.5. Mostraremos cómo instalar las VMware Tools «oficiales» (las que vienen con el hipervisor ESXi) y las Open VMware Tools.

Requisitos para instalar las VMware Tools en máquina virtual Linux con VMware ESX

Los únicos requisitos (evidentes) son:

  • Disponer de un servidor o equipo con VMware ESXI 6.5 y acceso a la consola de administración (bien vía web con VMware Host Client o bien con VMware vSphere Client).
  • Disponer de una máquina virtual con el sistema operativo Linux CentOS 7 Minimal y usuario y contraseña de acceso a este equipo como administradores.
  • La máquina virtual con Linux debe tener configurada la red y la conexión a Internet (IP, puerta de enlace y DNS).

VMware Tools

Existen dos versiones de las VMware Tools, una es la «oficial» que viene con el propio hipervisor VMware ESX y la otra es la Open VMware Tools. El propio VMware recomienda instalar las Open VMware Tools para equipos Linux CentOS. En este artículo explicaremos cómo instalar ambas.

Instalar VMware Tools oficiales en MV Linux CentOS 7 Minimal sobre VMware ESXI 6.5

En primer lugar iniciaremos la máquina virtual con el sistema operativo Linux CentOS 7 Minimal. A continuación accederemos a la configuración de VMware (vía web o mediante vSphere Client), pulsaremos con el botón derecho sobre la máquina virtual y en el menú elegiremos «Sistema operativo invitado» – «Instalar VMware Tools»:

Instalar VMware Tools oficiales en MV Linux CentOS 7 Minimal sobre VMware ESXI 6.5

Con esta acción prepararemos el CD virtual con la instalación de las VMware Tools para la máquina virtual.

Ahora accederemos a la máquina virtual, o bien con la consola desde VMware o bien por SSH (con PuTTY por ejemplo). Una vez iniciada sesión montaremos el CD con los siguientes comandos Linux:

mkdir /mnt/cdrom

mount /dev/cdrom /mnt/cdrom

Instalar VMware Tools oficiales en MV Linux CentOS 7 Minimal sobre VMware ESXI 6.5

Si hacemos un listado del CD podremos comprobar que aparecen los ficheros de instalación (y la versión que necesitaremos a continuación):

Instalar VMware Tools oficiales en MV Linux CentOS 7 Minimal sobre VMware ESXI 6.5

Copiaremos a la carpeta temporal del equipo el fichero de instalación VMwareTools-10.1.0-4449150.tar.gz con el comando:

cp -p /mnt/cdrom/VMwareTools-10.1.0-4449150.tar.gz /tmp

A continuación nos moveremos a la carpeta /tmp y descomprimiremos el fichero VMwareTools-10.1.0-4449150.tar.gz con el comando:

tar xzvf VMwareTools-10.1.0-4449150.tar.gz

Accederemos a la carpeta que se ha creado vmware-tools-distrib:

cd vmware-tools-distrib

Para el caso de la edición Minimal de CentOS necesitaremos instalar el compilador Perl para poder continuar. En este caso ejecutaremos el siguiente comando para instalar Perl:

yum install perl

Y también necesitaremos para la versión Minimal el comando ifconfig que por defecto no viene instalado. Para instalarlo ejecutaremos el siguiente comando:

yum install net-tools

Y ya podremos ejecutar el fichero de instalación vmware-install.pl:

./vmware-install.pl

Instalar VMware Tools oficiales en MV Linux CentOS 7 Minimal sobre VMware ESXI 6.5

El instalador nos avisa de que es más recomendable usar open-vmware-tools en lugar de las VMware Tools que vienen con el propio hipervisor. Si queremos seguir con esta instalación escribiremos yes y pulsaremos INTRO:

Instalar VMware Tools oficiales en MV Linux CentOS 7 Minimal sobre VMware ESXI 6.5

Dejaremos las opciones por defecto para una instalación estándar, que es lo habitual, pulsando INTRO en cada pregunta. Si queremos cambiar algo podremos hacerlo cuando nos solicite la información el instalador. A continuación mostramos un ejemplo de lo que va pidiendo y el valor por defecto (entre corchetes):

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

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

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 10.1.0 build-4449150 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.

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]

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]

VMware automatic kernel modules enables automatic building and installation of
VMware kernel modules at boot that are not already present. This feature can
be enabled/disabled by re-running vmware-config-tools.pl.

Would you like to enable VMware automatic kernel modules?
[yes]

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

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

No X install found.

Creating a new initrd boot image for the kernel.
Generating the key and certificate files.
Successfully generated the key and certificate files.
SELinux setup: The ‘semanage’ utility was not found.
There was an error setting up the SELinux security context for VMware Tools.
Please make sure SELinux is set up correctly.

The configuration of VMware Tools 10.1.0 build-4449150 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.

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

Found VMware Tools CDROM mounted at /mnt/cdrom. Ejecting device /dev/sr0 …

Si la instalación se ha realizado correctamente podremos ver ahora el estado de la máquina virtual (hostname, IP, …) en la consola de VMware:

Instalar VMware Tools oficiales en MV Linux CentOS 7 Minimal sobre VMware ESXI 6.5

Instalar Open VMware Tools open-vm-tools en Linux CentOS 7 Minimal sobre VMware ESXi 6.5

Para el caso de las Open VMware Tools será tan sencillo como ejecutar el siguiente comando Linux:

yum install -y open-vm-tools

Instalar Open VMware Tools open-vm-tools en Linux CentOS 7 Minimal sobre VMware ESXi 6.5

Tras la instalación podremos iniciar el servicio con el comando:

systemctl start vmtoolsd.service

Y habilitarlo con este otro comando:

systemctl enable vmtoolsd.service

Es recomendable reiniciar la máquina tras la instalación de las Open VMware Tools, aunque con los comandos anteriores no es necesario.

Si la instalación ha sido correcta podremos ver el estado de la máquina virtual:

Instalar Open VMware Tools open-vm-tools en Linux CentOS 7 Minimal sobre VMware ESXi 6.5