インフラエンジニアbacchiのわかったことまとめ

bacchi.me

VMware ESX 上の CentOS 7 に VMwareTools をインストール

VMware ESX 上で稼働するMinimal インストールな CentOS 7 に VMware Toolsを入れた時のメモ。

必要なパッケージをインストール

CentOS 7 をMinimal でインストールした場合、
Perlとifconfigが入っていないのでインストールします。

# yum -y install perl net-tools

MinimalだとPerlが入っていなくてびっくり!

また、VMwareTools のインストールにifconfigが必須だとは知りませんでした。

これらのコマンドが入っていないため、計3回インストーラーを走らせるはめになりました。

VMware Tools のイメージをアタッチ

vSphireClient の管理画面で以下の操作を行い、VMware Tools のイメージをアタッチします。

  1. VMware Tools を入れたい仮想マシンを右クリックし、ゲスト(G)を選択
  2. VMware Tools のインストール/アップグレード(W)を選択
  3. VMware Tools のインストール ポップアップが出るので、OKを選択

VMware Tools のインストール

以下の手順でVMware Tools をインストールします。

./vmware-install.pl を実行すると対話的にインストールが進むのですが、
./vmware-install.pl を実行する際、-d オプションを付けてやると質問に対して
デフォルトの選択を行ったものとして作業者がキーボードをしばかなくてもインストールが進みます。

これを知らなかったのですが、便利でいいです。

# mkdir /mnt/cdrom
# mount /dev/cdrom /mnt/cdrom/
mount: /dev/sr0 is write-protected, mounting read-only
# cp /mnt/cdrom/VMwareTools-8.3.17-784891.tar.gz /tmp/
# umount /mnt/cdrom
# cd /tmp/
# tar xzf VMwareTools-8.3.17-784891.tar.gz
# cd vmware-tools-distrib/
# ./vmware-install.pl -d
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 "/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.3.17 build-784891 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...

WARNING: A module identified as vsock has been found at
/lib/modules/3.10.0-123.6.3.el7.x86_64/kernel/net/vmw_vsock/vsock.ko and at
/lib/modules/3.10.0-123.6.3.el7.x86_64/kernel/net/vmw_vsock/vmw_vsock_vmci_transport.ko.
Leaving both modules in there could potentially cause a race condition when a
device is added.  We reccomend you remove one of them, run 'depmod -a' and then
re-run this configurator.


Making sure services for VMware Tools are stopped.

Stopping vmware-tools (via systemctl):                     [  OK  ]


The module vmmemctl 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=vmmemctl to override.

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 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]


WARNING: This program cannot compile any modules for the following reason(s)...

- This program could not find a valid path to the gcc binary.  Please ensure
that the gcc binary is installed on this sytem.

- This program could not find a valid path to the kernel headers of the running
kernel.  Please ensure that the header files for the running kernel are
installed on this sytem.

[ Press Enter key to continue ]


The fast network device driver (vmxnet module) is used only for our fast
networking interface. The rest of the software provided by VMware Tools is
designed to work independently of this feature.
If you wish to have the fast network driver enabled, you can install the driver
by running vmware-config-tools.pl again after making sure that gcc, binutils,
make and the kernel sources for your running kernel are installed on your
machine. These packages are available on your distribution's installation CD.
[ Press Enter key to continue ]

The module vmci 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=vmci to override.

The module vsock 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=vsock to override.

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.

No X install found.

Creating a new initrd boot image for the kernel.
Starting vmware-tools (via systemctl):                     [  OK  ]
The configuration of VMware Tools 8.3.17 build-784891 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 the following command:
"/usr/bin/vmware-toolbox" 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.

Enjoy,

--the VMware team

/sbin/restorecon:  Warning no default label for /tmp/vmware-block-restore0/tmp_file
  • B!