2009年10月26日月曜日

CentOS5.3にvmware-toolsをインストール

仕事がバタバタしていて環境構築が遅れてました。
さぼらないようにという戒めの為にblogで生き恥進捗報告しようと決めているので、ちゃんとススメます。

VMware Fusion上にCentOSをインストールするのはそれほど難しくないです。

ただ、僕の好みで最小インストール+GNOMEデスクトップという組み合わせでインストール。
GUI環境にコダワリはありませんが、GUI環境が必要な時にはいつでも立ち上げれるようにインストール時には一緒に入れておいて、後ほど自動起動しない設定にしておけば簡単に選択できるという理由です。

っで、インストール直後に一番最初に実施したのは、VMware-toolsのインストール。

早速インストール直後にvmware-toolsのインストールを開始。
SSHログインしての操作が殆どになるので必須では無いという判断もアリだけど、仮想環境上のゲストOSでは何もしないと時刻同期がうまくいかずにDBサーバ等の機能を持たせたり、ログの時刻を見る時などに非常に困った状況が発生してしまう。
vmware-toolsだけでは不十分らしいですが、インストールは最低限の対策となります。

1. OSをGUI環境を含めて起動

2. VMware-toolsのイメージをマウント


[仮想マシン] → [VMware Toolsのインストール]を選択すると自動的にディスクイメージをマウントしてくれて下記のような状態になります。


3. tarボールの展開

# cd /root
# cp -ip /media/VMware¥ Tools/VMwareTools-7.9.7-196839.tar.gz /root/VMwareTools-7.9.7-196839.tar.gz
# tar -zxvf ./VMwareTools-7.9.7-196839.tar.gz

4. kernel-headers、gccのインストール

VMware-toolsをインストールする際には、kernel-headersとコンパイラが必要となります。
yumコマンドを使えば簡単にインストールできますが、インターネットへの接続が可能な状態が必須となりますので、事前にネットワーク設定を終わらせておく必要があります。

# yum install kernel-headers
# yum install gcc


5. インストール

インストールコマンドを実行します。
ここで1つ注意しなければならない事があります。
インストールコマンドを実行する際は、VMwareのゲストOSのウィンドウでターミナルを立ち上げて実行しなければなりません。
僕はMac上でターミナルを立ち上げてから、ゲストOSに対してSSH接続して実行したのですが以下のようにエラーが出力されて中断されました。



# cd /root/vmware-tools-distrib/
#
# ./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] [ENTER]

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

In which directory do you want to install the daemon files?
[/usr/sbin] [ENTER]

In which directory do you want to install the library files?
[/usr/lib/vmware-tools] [ENTER]

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

In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools] [ENTER]

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

The installation of VMware Tools 7.9.7 build-196839 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] [ENTER]

It looks like you are trying to run this program in a remote session. This
program will temporarily shut down your network connection, so you should only
run it from a local console session. Are you SURE you want to continue?
[no] [ENTER]

Please re-run this program from a local console shell.
Execution aborted.

Found VMware Tools CDROM mounted at /media/VMware Tools. Ejecting device
/dev/hdc ...
#

最初はいきなりインストールが中断されたのでビックリしましたが、"Please re-run this program from a local console shell."というメッセージの通り、ゲストOS上で再度インストールコマンドを実行すると、以下のようにインストールが再開されました。



# ./vmware-install.pl
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] [ENTER]


Uninstalling the tar installation of VMware Tools.

Stopping services for VMware Tools

Stopping VMware Tools services in the virtual machine:
Guest operating system daemon: [ OK ]
Virtual Printing daemon: [ OK ]

File /usr/lib/vmware-tools/lib32/libconf/etc/gtk-2.0/gdk-pixbuf.loaders is
backed up to
/usr/lib/vmware-tools/lib32/libconf/etc/gtk-2.0/gdk-pixbuf.loaders.old.0.

File /usr/lib/vmware-tools/lib32/libconf/etc/pango/pangorc is backed up to
/usr/lib/vmware-tools/lib32/libconf/etc/pango/pangorc.old.0.

This program previously created the file
/usr/lib/vmware-tools/libconf/etc/pango/pangorc, and was about to remove it.
Somebody else apparently did it already.

This program previously created the file
/usr/lib/vmware-tools/lib32/libconf/etc/pango/pango.modules, and was about to
remove it. Somebody else apparently did it already.

This program previously created the file
/usr/lib/vmware-tools/libconf/etc/gtk-2.0/gdk-pixbuf.loaders, and was about to
remove it. Somebody else apparently did it already.

File /usr/lib/vmware-tools/lib32/libconf/etc/gtk-2.0/gtk.immodules is backed up
to /usr/lib/vmware-tools/lib32/libconf/etc/gtk-2.0/gtk.immodules.old.0.

This program previously created the file
/usr/lib/vmware-tools/libconf/etc/gtk-2.0/gtk.immodules, and was about to
remove it. Somebody else apparently did it already.

This program previously created the file
/usr/lib/vmware-tools/lib32/libconf/etc/pango/pangox.aliases, and was about to
remove it. Somebody else apparently did it already.

This program previously created the directory
/usr/lib/vmware-tools/lib32/libconf/etc/gtk-2.0, and was about to remove it.
Since there are files in that directory that this program did not create, it
will not be removed.

This program previously created the directory
/usr/lib/vmware-tools/lib32/libconf/etc/pango, and was about to remove it.
Since there are files in that directory that this program did not create, it
will not be removed.

This program previously created the directory
/usr/lib/vmware-tools/lib32/libconf/etc, and was about to remove it. Since
there are files in that directory that this program did not create, it will not
be removed.

This program previously created the directory
/usr/lib/vmware-tools/lib32/libconf, and was about to remove it. Since there
are files in that directory that this program did not create, it will not be
removed.

This program previously created the directory /usr/lib/vmware-tools/lib32, and
was about to remove it. Since there are files in that directory that this
program did not create, it will not be removed.

This program previously created the directory /usr/lib/vmware-tools, and was
about to remove it. Since there are files in that directory that this program
did not create, it will not be removed.

The removal of VMware Tools 7.9.7 build-196839 for Linux completed
successfully.

Installing VMware Tools.

In which directory do you want to install the binary files?
[/usr/bin] [ENTER]

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d] [ENTER]

What is the directory that contains the init scripts?
[/etc/rc.d/init.d] [ENTER]

In which directory do you want to install the daemon files?
[/usr/sbin] [ENTER]

In which directory do you want to install the library files?
[/usr/lib/vmware-tools] [ENTER]

In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools] [ENTER]

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


The installation of VMware Tools 7.9.7 build-196839 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] [ENTER]



Stopping VMware Tools services in the virtual machine:
Guest operating system daemon: [ OK ]
Virtual Printing daemon: [ OK ]
The bld-2.6.18-8.el5-i686smp-RHEL5 - vmmemctl module loads perfectly into the
running kernel.

The bld-2.6.18-8.el5-i686smp-RHEL5 - vmhgfs module loads perfectly into the
running kernel.

The bld-2.6.18-8.el5-i686smp-RHEL5 - vmxnet module loads perfectly into the
running kernel.

The bld-2.6.18-8.el5-i686smp-RHEL5 - vmblock module loads perfectly into the
running kernel.

[EXPERIMENTAL] The VMware FileSystem Sync Driver (vmsync) is a new feature that
creates backups of virtual machines. Please refer to the VMware Knowledge Base
for more details on this capability. Do you wish to enable this feature?
[no] [ENTER]


The bld-2.6.18-8.el5-i686smp-RHEL5 - vmci module loads perfectly into the
running kernel.

The bld-2.6.18-8.el5-i686smp-RHEL5 - vsock module loads perfectly into the
running kernel.



Detected X.org version
X Window System Version 7.1.1
Release Date: 12 May 2006
? 7.1 : '0.0.0'.1
Build Operating System: Linux 2.6.18-53.1.14.el5PAE i686 Red Hat, Inc.
Current Operating System: Linux jupiter.localdomain 2.6.18-128.el5 #1 SMP Wed
Jan 21 10:44:23 EST 2009 i686
Build Date: 21 January 2009
Build ID: xorg-x11-server 1.1.1-48.52.el5
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Module Loader present
.


Please choose one of the following display sizes that X will start with (1 -
29):

[1] "320x200"
[2] "320x240"
[3] "400x300"
[4] "512x384"
[5] "640x400"
[6] "640x480"
[7] "720x480"
[8] "800x480"
[9] "854x480"
[10] "720x576"
[11] "800x600"
[12]< "1024x768" [13] "1280x720" [14] "1280x768" [15] "1152x864" [16] "1280x800" [17] "1366x768" [18] "1280x960" [19] "1440x900" [20] "1280x1024" [21] "1400x1050" [22] "1680x1050" [23] "1600x1200" [24] "1920x1080" [25] "1920x1200" [26] "1920x1440" [27] "2048x1536" [28] "2560x1600" [29] "2560x1920" Please enter a number between 1 and 29: [12] [ENTER]



X Window System Version 7.1.1
Release Date: 12 May 2006
X Protocol Version 11, Revision 0, Release 7.1.1
Build Operating System: Linux 2.6.18-53.1.14.el5PAE i686 Red Hat, Inc.
Current Operating System: Linux jupiter.localdomain 2.6.18-128.el5 #1 SMP Wed Jan 21 10:44:23 EST 2009 i686
Build Date: 21 January 2009
Build ID: xorg-x11-server 1.1.1-48.52.el5
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/tmp/vmware-config0/XF86ConfigLog.3831", Time: Sun Oct 25 23:52:15 2009
(++) Using config file: "/tmp/vmware-config0/XF86Config.3831"

X is running fine with the new config file.

FreeFontPath: FPE "unix/:7100" refcount is 2, should be 1; fixing.
Checking acpi hot plug [ OK ]
Starting VMware Tools services in the virtual machine:
Switching to guest configuration: [ OK ]
Guest filesystem driver: [ OK ]
Mounting HGFS shares: [失敗]
Guest memory manager: [ OK ]
Guest vmxnet fast network device: [ OK ]
VM communication interface: [ OK ]
VM communication interface socket family: [ OK ]
Blocking file system: [ OK ]
Guest operating system daemon: [ OK ]
Virtual Printing daemon: [ OK ]

The configuration of VMware Tools 7.9.7 build-196839 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.

You will need to either manually start /usr/bin/vmware-user or log out and log
back in to this desktop session to obtain the following features: guest
resolution fit, drag and drop, and file and text copy/paste. vmware-user is
configured to automatically start at a graphical login, but that won't take
effect until the next login.

To use the vmxnet driver, restart networking using the following commands:
/etc/init.d/network stop
rmmod pcnet32
rmmod vmxnet
modprobe vmxnet
/etc/init.d/network start

If the virtual printer feature is enabled, you will need to restart the CUPS
service to make use of this feature.

Enjoy,

--the VMware team

#

これでインストールは終了。
自動起動の設定もされているので、OS再起動後にしばらく放置して時刻がくるわなければOK!!



1 件のコメント: