Akio's Log

ソフトウェア開発、プロジェクトマネジメント、プログラミング、ランニングなどなど

自分サーバの構築その11:VMWareToolsインストールの続き

CentOS5で作るネットワークサーバ構築ガイド (Network Server Construction Guide Series)
DVD付 CentOS徹底入門 第2版
すべてわかる仮想化大全2008 (日経BPムック)
すべてわかる仮想化大全VMware/Virtual Server (日経BPムック)
リナックスファン Vol.10 (10) (マイコミムック) (DVD付)


昨日は、VMwareToolsのrpmをインストールしたところで終わってしまった。

引き続き、こちらを参照しながら進める。
「仮想サーバの構築(VMware Server: WindowsXP編)」
http://www.aconus.com/~oyaji/windows/vmware_server_win.htm

rpmのインストールが終わったので、VMware Toolsのインストールを実行する。

[root@xxxxxx ~]# vmware-config-tools.pl

Stopping VMware Tools services in the virtual machine:
Guest operating system daemon: [ OK ]
Trying to find a suitable vmhgfs module for your running kernel.

None of the pre-built vmhgfs modules for VMware Tools is suitable for your
running kernel. Do you want this program to try to build the vmhgfs module for
your system (you need to have a C compiler installed on your system)? [yes] yes


Setup is unable to find the "gcc" program on your machine. Please make sure it
is installed. Do you want to specify the location of this program by hand?
[yes]

あ。gccが必要なのか。さて困った。まだ入れてなかった。

それでは先に、開発ツール関連を入れてしまおうか。yumgcc単体でインストールしても良さそうだが、せっかくなので開発ツール類をまとめてインストールしてみる。

まずは、「yum grouplist」でgroupインストールできるグループのリストを表示させる。

[root@xxxxxx ~]# yum grouplist
Loading "installonlyn" plugin
Loading "fastestmirror" plugin
Setting up Group Process
Setting up repositories
Loading mirror speeds from cached hostfile
Installed Groups:
Editors
System Tools
Dialup Networking Support
Network Servers
Mail Server
Yum Utilities
Available Groups:
Office/Productivity
Engineering and Scientific
MySQL Database
Development Libraries
GNOME Software Development
Text-based Internet
X Software Development
Virtualization
Legacy Network Server
DNS Name Server
GNOME Desktop Environment
Authoring and Publishing
FTP Server
Games and Entertainment
XFCE-4.4
Legacy Software Development
Java
Java Development
Emacs
Legacy Software Support
X Window System
Graphics
Web Server
Ruby
Windows File Server
Printing Support
KDE Software Development
KDE (K Desktop Environment)
Server Configuration Tools
Sound and Video
PostgreSQL Database
Administration Tools
News Server
Development Tools
FreeNX and NX
Graphical Internet
Done

「Development Tools」にgccが含まれてるはずだから、これをグループインストールする。インストールの前に「Development Tools」にgccが含まれてるか確認してからインストール。

[root@xxxxxx ~]# yum groupinfo "Development Tools"
Loading "installonlyn" plugin
Loading "fastestmirror" plugin
Setting up Group Process
Setting up repositories
Loading mirror speeds from cached hostfile

Group: Development Tools
Description: These tools include core development tools such as automake, gcc, perl, python, and debuggers.
Mandatory Packages:
flex
gcc
redhat-rpm-config
strace
rpm-build
make
pkgconfig
gettext
automake
strace64
gdb
bison
libtool
autoconf
gcc-c++
binutils
Default Packages:
ltrace
valgrind-callgrind
diffstat
splint
valgrind
systemtap
subversion
texinfo
python-ldap
patchutils
byacc
frysk
gcc-gfortran
elfutils
pfmon
rcs
automake16
automake17
automake14
automake15
ctags
dogtail
swig
dev86
doxygen
indent
cvs
pstack
oprofile
cscope
Optional Packages:
dejagnu
imake
gcc-objc
ElectricFence
memtest86+
gcc-gnat
expect
unifdef
nasm
ddd

gccだけではなくて、gdbもautomake/autoconfやdoxygenも含まれていた。これなら一通りのCでの開発は出来そうだ。

では、インストール実行。

[root@xxxxxx ~]# yum -y groupinstall "Development Tools"
(略)

無事開発ツール類が揃った。


気を取り直して、再度vmware-config-tools.plを実行。

[root@xxxxxx ~]# vmware-config-tools.pl

Stopping VMware Tools services in the virtual machine:
Guest operating system daemon: [ OK ]
Trying to find a suitable vmhgfs module for your running kernel.

None of the pre-built vmhgfs modules for VMware Tools is suitable for your
running kernel. Do you want this program to try to build the vmhgfs module for
your system (you need to have a C compiler installed on your system)? [yes]y


Using compiler "/usr/bin/gcc". Use environment variable CC to override.

What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include]

また、ここで引っかかってしまった。
「@IT Linux Square会議室: VMWareRedHat ES3のVMTools - Linux Square」
http://www.atmarkit.co.jp/bbs/phpBB/viewtopic.php?topic=20909&forum=10&7
によると、

VMware Toolsをインストールするにはカーネルのソースが必要です。

RedHatならkernel-sourceというパッケージ名になってると思いますが。
現在使ってるkernelと同じバージョンのソースをインストールしてみてください。

        • -

というのを「VMWare Tools インストール」ってgoogleさんとかで検索すると
いっぱい出てくるんですけどねぇ。。。

・・・。ちゃんと調べてなかった^^;

という事で、カーネルのソースをインストールする。


ぐぐってみると、FedoraCore6で同じような事例を発見。
「Long Slow Distance - 目次-Tech/VMWare/VMwareToolsをインストールしよう(FedoraCore6)-技術情報」
http://lsd42195.sakura.ne.jp/xoops/modules/pukiwiki/119.html

色々探したらkernel-sourceをインストールする必要があるとの事。
ただ、FedoraCore6では、kernel-devel というパッケージになっているらしいのでそれをインストールします。

まずは、カーネルのリビジョンを確認

[root@xxxxxx ~]# uname -r
2.6.18-8.1.4.el5

yumでkernel-develをインストール。カーネルのバージョンとkernel-develのバージョンが一致しているので、そのままインストールされた。

[root@vm-watarase-rv ~]# yum install kernel-devel
Loading "installonlyn" plugin
Loading "fastestmirror" plugin
Setting up Install Process
Setting up repositories
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies

    • > Populating transaction set with selected packages. Please wait.
      • > Downloading header for kernel-devel to pack into transaction set.

kernel-devel-2.6.18-8.1.4 100% |=========================| 686 kB 00:00

      • > Package kernel-devel.i686 0:2.6.18-8.1.4.el5 set to be installed
    • > Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
kernel-devel i686 2.6.18-8.1.4.el5 updates 4.5 M

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 4.5 M
Is this ok [y/N]: y
Downloading Packages:
(1/1): kernel-devel-2.6.1 100% |=========================| 4.5 MB 00:01
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: kernel-devel ######################### [1/1]

Installed: kernel-devel.i686 0:2.6.18-8.1.4.el5
Complete!


[root@xxxxxx ~]# yum list installed|grep kernel
kernel.i686 2.6.18-8.1.4.el5 installed
kernel.i686 2.6.18-8.el5 installed
kernel-devel.i686 2.6.18-8.1.4.el5 installed
kernel-headers.i386 2.6.18-8.1.4.el5 installed


[root@xxxxxx ~]# ls /usr/src/kernels/2.6.18-8.1.4.el5-i686/
Makefile crypto init lib security
Module.symvers drivers ipc mm sound
arch fs kabi_whitelist net symsets-2.6.18-8.1.4.el5.tar.gz
block include kernel scripts usr

無事インストールされ、カーネルのソースも見る事が出来るようになった。



再再度、vmware-config-tools.plを実行。

[root@xxxxxx ~]# vmware-config-tools.pl

途中エラーが出るが、無視して進めていたら、反応しなくなった。どうやらTeraTermでリモートで実行していたから駄目なようだ。VMwareToolsをインストールする時にはネットワークをいったんストップしなければいけないらしい。
改めて、VMwareServerConsoleで実行すると、無事インストールが出来た。


ようやく、VMwareToolsで時刻を同期するための準備が整った(本当か?)

「hide-k.net#blog: VMwareのゲストOSの時計が狂う件」
http://blog.hide-k.net/archives/2006/12/vmwareos.php

ここによれば、仮想マシンのvmxファイルの設定を変更すれば良いとのこと。
仮想マシンをシャットダウンした状態で、仮想マシンの設定ファイル「Other Linux 2.6.x kernel.vmx」をテキストエディタで開き、以下の項目を編集する。

tools.syncTime = "FALSE"

tools.syncTime = "TRUE"

同期設定を「FALSE」から「TRUE」に変更する。

もう一度、仮想マシンを起動。「date」コマンドで時間を表示させてみると、ちゃんとホストOSと同期が取れていた。



ちなみに、他のブログを見ると、カーネルの再構築やカーネルオプションの指定、設定ファイルへのクロック数記述など、他にも必要な操作があるようなのですが、今のところ、VMwareToolsの設定だけでちゃんと同期が取れているようなので、ずれ始めたらそのときに対処する、という事で、今回の時刻同期の件はこれにて終了。

CentOS5で作るネットワークサーバ構築ガイド (Network Server Construction Guide Series)

CentOS5で作るネットワークサーバ構築ガイド (Network Server Construction Guide Series)

DVD付 CentOS徹底入門 第2版

DVD付 CentOS徹底入門 第2版

すべてわかる仮想化大全2008 (日経BPムック)

すべてわかる仮想化大全2008 (日経BPムック)

すべてわかる仮想化大全VMware/Virtual Server (日経BPムック)

すべてわかる仮想化大全VMware/Virtual Server (日経BPムック)