読者です 読者をやめる 読者になる 読者になる

CentOS でカーネルをバージョンアップしたときに VMWare Server の再設定をするには

Linux VMWare

VMWare Server ではカーネルのバージョンを上げると再コンパイルが必要になる。
まずカーネルの確認。

$ uname -r
2.6.18-53.1.13.el5xen

ノーマルもしくは xen の devel パッケージをインストール。

# yum install kernel-devel.i386
もしくは
# yum install kernel-xen-devel.i386

vmware-config.pl を実行する。

$ sudo vmware-config.pl
Making sure services for VMware Server are stopped.

Stopping VMware services:
   Virtual machine monitor                                 [  OK  ]
   Bridged networking on /dev/vmnet0                       [  OK  ]
   Virtual ethernet                                        [  OK  ]

Configuring fallback GTK+ 2.4 libraries.

In which directory do you want to install the mime type icons? 
[/usr/share/icons] 

What directory contains your desktop menu entry files? These files have a 
.desktop file extension. [/usr/share/applications] 

In which directory do you want to install the application's icon? 
[/usr/share/pixmaps] 

Trying to find a suitable vmmon module for your running kernel.

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

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] /usr/src/kernels/2.6.18-53.1.13.el5-i686/include

The directory of kernel headers (version 2.6.18-53.1.13.el5) does not match 
your running kernel (version 2.6.18-53.1.13.el5xen).  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] /lib/modules/2.6.18-53.1.13.el5xen/build/include

Extracting the sources of the vmmon module.

Building the vmmon module.

Using 2.6.x kernel build system.
make: ディレクトリ `/tmp/vmware-config0/vmmon-only' に入ります
ake -C /lib/modules/2.6.18-53.1.13.el5xen/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: ディレクトリ `/usr/src/kernels/2.6.18-53.1.13.el5-xen-i686' に入ります
  C [M]  /tmp/vmware-config0/vmmon-only/linux/driver.o
  CC [M]  /tmp/vmware-config0/vmmon-only/linux/hostif.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/cpuid.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/hash.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/memtrack.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/phystrack.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/task.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/vmx86.o
  CC [M]  /tmp/vmware-config0/vmmon-only/vmcore/moduleloop.o
  LD [M]  /tmp/vmware-config0/vmmon-only/vmmon.o
  Building modules, stage 2.
  MODPOST
  CC      /tmp/vmware-config0/vmmon-only/vmmon.mod.o
  LD [M]  /tmp/vmware-config0/vmmon-only/vmmon.ko
make[1]: ディレクトリ `/usr/src/kernels/2.6.18-53.1.13.el5-xen-i686' から出ます
cp -f vmmon.ko ./../vmmon.o
make: ディレクトリ `/tmp/vmware-config0/vmmon-only' から出ます
The module loads perfectly in the running kernel.

This program previously created the file /dev/vmmon, and was about to remove 
it.  Somebody else apparently did it already.

This program previously created the file /dev/vmnet0, and was about to remove 
it.  Somebody else apparently did it already.

You have already setup networking.

Would you like to skip networking setup and keep your old settings as they are?
(yes/no) [no] yes

Extracting the sources of the vmnet module.

Building the vmnet module.

Using 2.6.x kernel build system.
make: ディレクトリ `/tmp/vmware-config0/vmnet-only' に入ります
make -C /lib/modules/2.6.18-53.1.13.el5xen/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: ディレクトリ `/usr/src/kernels/2.6.18-53.1.13.el5-xen-i686' に入ります
  CC [M]  /tmp/vmware-config0/vmnet-only/driver.o
  CC [M]  /tmp/vmware-config0/vmnet-only/hub.o
  CC [M]  /tmp/vmware-config0/vmnet-only/userif.o
  CC [M]  /tmp/vmware-config0/vmnet-only/netif.o
  CC [M]  /tmp/vmware-config0/vmnet-only/bridge.o
  CC [M]  /tmp/vmware-config0/vmnet-only/procfs.o
  CC [M]  /tmp/vmware-config0/vmnet-only/smac_compat.o
  SHIPPED /tmp/vmware-config0/vmnet-only/smac_linux.x386.o
  LD [M]  /tmp/vmware-config0/vmnet-only/vmnet.o
  Building modules, stage 2.
  MODPOST
WARNING: could not find /tmp/vmware-config0/vmnet-only/.smac_linux.x386.o.cmd for /tmp/vmware-config0/vmnet-only/smac_linux.x386.o
  CC      /tmp/vmware-config0/vmnet-only/vmnet.mod.o
  LD [M]  /tmp/vmware-config0/vmnet-only/vmnet.ko
make[1]: ディレクトリ `/usr/src/kernels/2.6.18-53.1.13.el5-xen-i686' から出ます
cp -f vmnet.ko ./../vmnet.o
make: ディレクトリ `/tmp/vmware-config0/vmnet-only' から出ます
The module loads perfectly in the running kernel.

   Shutting down http.vmware:                              [  OK  ]
   Starting httpd.vmware:                                  [  OK  ]
Please specify a port for remote console connections to use [9002] 

WARNING: VMware Server has been configured to run on a port different from the 
default port. Remember to use this port when connecting to this server.
xinetd を停止中:                                           [  OK  ]
xinetd を起動中:                                           [  OK  ]
Configuring the VMware VmPerl Scripting API.

Building the VMware VmPerl Scripting API.

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

Installing the VMware VmPerl Scripting API.

The installation of the VMware VmPerl Scripting API succeeded.

Do you want this program to set up permissions for your registered virtual 
machines?  This will be done by setting new permissions on all files found in 
the "/etc/vmware/vm-list" file. [no] 

Generating SSL Server Certificate

In which directory do you want to keep your virtual machine files? 
[/var/lib/vmware/Virtual Machines] 

Do you want to enter a serial number now? (yes/no/help) [no] 

Starting VMware services:
   Virtual machine monitor                                 [  OK  ]
   Virtual ethernet                                        [  OK  ]
   Bridged networking on /dev/vmnet0                       [  OK  ]
   Starting VMware virtual machines...                     [  OK  ]

The configuration of VMware Server 1.0.4 build-56528 for Linux for this running
kernel completed successfully.

Setup found that the VMware Management Interface is installed on your machine. 
The VMware Management Interface configurator (/usr/bin/vmware-config-mui.pl) 
needs to be run. Do you want to run this program now? [yes] 

File /usr/lib/vmware-mui/apache/conf/httpd.conf is backed up to 
/usr/lib/vmware-mui/apache/conf/httpd.conf.old.0.

Configuring httpd.conf to run Apache as: 
User: nobody and Group: nobody

Set the number of minutes before a http session times out. (This is the length 
of time before someone connecting to VMware Management Interface will be logged
out) [60] 

Generating SSL Server Certificate

   Starting httpd.vmware:                                  [  OK  ]
The configuration of VMware Management Interface completed successfully.

と動かそうと思ったら、

Feb 29 11:46:36: app| Error during launch: 11, The "/usr/lib/vmware/bin/vmware-vmx" proc
ess did not start properly
Feb 29 11:46:36: app|  Try running "/usr/lib/vmware/bin/vmware-vmx /var/lib/vmware/Virtu
al Machines/CentOs5/centos5.vmx" from the command-line on the server.
Feb 29 11:46:36: app| VmsdVmStatePendingCmdFailed: cmd status is already set

となってしまった。やはり kernel-xen で動かそうとしているのが間違っていたみたい。
/etc/sysconfig/kernel で DEFAULTKERNEL=kernel に修正し、/boot/grub/menu.lst を修正して xen ではない項目を default にセットし、reboot。
再度 vmware-config.pl を叩いて、/lib/modules/2.6.18-53.1.13.el5/build/include でコンパイルしたら動きました。
(3/3 加筆しました)