エンジニア成長日記

成長するにはインプットばかりでなく、アウトプットも必要である。日々の成長記録を書き留めていきたい。

VMware-Toolsのインストール手順

はじめに

CentOS7.X系に、open-vm-toolsをインストールする手順になります。

既に、ご存じの方が多いと思いますが、ESXiにバンドルされているVMware Toolsではなく、 open-vm-tools を利用した運用が推奨されています。以下の記事をご参照ください。

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2074713

なお、当手順は、以下のOSバージョンをサポートしています。

インストール手順

キーのインポート

# rpm --import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub

リポジトリ追加

# vi /etc/yum.repos.d/vmware-tools.repo
[vmware-tools]
name = VMware Tools
baseurl = http://packages.vmware.com/packages/rhel7/x86_64/
enabled = 1
gpgcheck = 1

パッケージインストール

# yum update
# yum install open-vm-tools-deploypkg
Installed:
open-vm-tools-deploypkg.x86_64 0:9.4.10-3

Dependency Installed:
libdnet.x86_64 0:1.12-6.el6             libicu.x86_64 0:4.2.1-9.1.el6_2
libmspack.x86_64 0:0.4-0.1.alpha.el6    open-vm-tools.x86_64 0:9.4.6-1.el6

Complete!

# service vmtoolsd restart
vmtoolsd を停止中:                                         [  OK  ]
vmtoolsd を起動中:                                         [  OK  ]
#
# vmtoolsd -v
VMware Tools daemon, version 9.4.6.33107 (build-1770165)

付録A. CentOS6.Xでインストールする方法

CentOS6.Xで、yumインストールしたい場合は、以下の通りとなります。

リポジトリの登録

1./etc/yum.repos.d/VMware-Tools.repoというファイルを作成します。

2.vi /etc/yum.repos.d/VMware-Tools.repoで下記の内容を入力します。

  [vmware-tools]
  name=VMware Tools for Red Hat Enterprise Linux $releasever   $basearch
  baseurl=http://packages.vmware.com/tools/esx/latest/rhel6/$basearch
  enabled=1
  gpgcheck=1
  gpgkey=http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub

インストール

#yum install vmware-tools-esx-noxを実行
(※GUIの場合は# yum install vmware-tools-esx)

再起動

#shutdown -r now

確認

#vmtoolsd -v

付録B. ESXiにバンドルされているVMware Tools 手順

ESXiにバンドルされているVMware Tools インストール手順も記載します。

前提条件

  • VPN接続確立後、vSphere Client経由で仮想マシンへ接続してください。
  • VMware ToolsのインストールにはPerlが必要です。 ※CentOSPerlがインストールされていない場合は yum install perlでインストールしてください。
  • 仮想マシンをパワーオンします。
  • ゲスト OS が実行されていることを確認します。

インストール手順

  • コンソールより、「仮想マシン」-「ゲスト」-「VMwareToolsのインストール」を選択します。

  • マウントします。

# mount /dev/cdrom /mnt/cdrom
  • 圧縮されたVMware toolsのフォルダを任意の場所にコピーします。 ※今回はtar.gz形式のファルダを解凍してVMware toolsをインストールします。
# cp -f /mnt/cdrom/VMwareTools-9.4.10-2068191.tar.gz /usr/local/src/VMwareTools/.
# tar xvfz VMwareTools-9.4.10-2068191.tar.gz
  • インストーラーを起動します。 ※今回は、すべてデフォルト設定でインストールしています。 必要に応じて、設定を変更してください。
# ./vmware-install.pl
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 9.4.10 build-2068191 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.



Found a compatible pre-built module for vmci.  Installing it...


Found a compatible pre-built module for vsock.  Installing it...


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.

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]

Found a compatible pre-built module for vmxnet.  Installing it...


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?
[no]

No X install found.

Creating a new initrd boot image for the kernel.

Creating a new initrd boot image for the kernel.
vmware-tools start/running
The configuration of VMware Tools 9.4.10 build-2068191 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; and,
3. Restart your X session.

Enjoy,

--the VMware team

Found VMware Tools CDROM mounted at /mnt/cdrom. Ejecting device /dev/sr0 ...
No eject (or equivilant) command could be located.
Eject Failed:  If possible manually eject the Tools installer from the guest
cdrom mounted at /mnt/cdrom before canceling tools install on the host.
  • 起動確認します。
# status vmware-tools
vmware-tools start/running
  • 再起動します。
# reboot

動作確認

  • vSphere Client インベントリで仮想マシンを選択し、[サマリ] タブをクリックします。
  • VMware Tools:」が「実行中(現在)」にステータスが変わっている事を確認します。