VMWare Server 2.0上のFedora 14にVMWareToolsをインストール

Fedora 14が出たので検証してみようと思い、普段使っているWindowsXP上にインストールしたVMWare Server 2.0上の仮想マシンとしてFedora 14(32bit)を導入してみた。OSのインストールは別段問題なかったのだが、VMWareToolsをインストールするのに少々ハマったので備忘録としてメモしておく。ちなみに、VMWare ServerではなくESXi 4.1で運用しているサーバー上の仮想マシンとして導入してみたところ、特に問題なくVMWareToolsがインストールできたので、VMWare Server 2に付属するVMWareTools側の問題なのだろう。

まず、問題が起こっていた環境はこう。仮想マシン作成時のOSタイプは「Other 2.6x Linux (32-bit)」。


# cat /etc/redhat-release
Fedora release 14 (Laughlin)

# uname -a
Linux XXXX 2.6.35.10-74.fc14.i686 #1 SMP Thu Dec 23 16:17:40 UTC 2010 i686 i686 i386 GNU/Linux

VMWareToolsはtarballを解凍しコンパイルでインストールしようとしたのだが、カーネルヘッダー格納場所の指定のところで困ってしまった。Fedora 14ではデフォルトの「/usr/src/linux/include」ではなく「/usr/src/kernels/2.6.35.10-74.fc14.i686/include」に格納されるため、手動で指定してみたのだが、どうもうまくいかない。

What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include] /usr/src/kernels/2.6.35.10-74.fc14.i686/include

The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match
your running kernel (version 2.6.35.10-74.fc14.i686). Even if the module were
to compile successfully, it would not load into the running kernel.

What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include] /usr/src/kernels/2.6.35.10-74.fc14.i686

色々と調べた結果、インストーラ(vmware-install.pl)では指定したカーネルヘッダーの格納先ディレクトリの配下にある include/linux/version.h に記載されている「UTS_RELEASE」のコメント行を見て判断されるようだ。そこでversion.hに以下の内容を追加する。(ただし、仮想マシンを作成する際にOther Linuxを選択しない場合には異なる動作になると思われる)

#define UTS_RELEASE "(uname -rの結果)"
今回修正した「/usr/src/kernels/2.6.35.10-74.fc14.i686/include/linux/version.hの内容は以下の通り。

# diff -u version.h.orig version.h
--- version.h.orig 2010-12-24 01:23:01.000000000 +0900
+++ version.h 2011-01-08 22:47:43.644119397 +0900
@@ -1,2 +1,3 @@
#define LINUX_VERSION_CODE 132643
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+#define UTS_RELEASE "2.6.35.10-74.fc14.i686"
修正が終わったら、VMWareToolsのインストーラを再実行する。

What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include] /lib/modules/2.6.35.10-74.fc14.i686/build/include

Extracting the sources of the vmmemctl module.

Building the vmmemctl module.
(後略)

これでようやく先に進んだ。やれやれ。この先で細かなエラーがいくつか出るが、無視して一旦終了して問題ない。この後「/usr/bin/vmware-config-tools.pl」を実行しX周辺の設定などを行って作業完了。実務でのVMWare系の仮想化ソフトとしてはハイパーバイザー型のESXやESXiを使う場面しかなくなってきているが、気軽にPCで試したい時にはまだVMWare Serverを使ったりするなぁ。