Ryusai's Homepage
トップページ > VMware ServerにCentOS 5.0をインストール

VMware ServerにCentOSをインストール

 Windows VistaにインストールしたVMware ServerゲストOSとしてCentOS 5.0をインストールしたときのメモです。

インストールの手順としては

  1. 仮想マシンの作成
  2. ゲストOSインストール
  3. VMware Toolsのインストール
  4. xorg.confファイルの編集
になります。尚、2. ゲストOSインストールCentOS 5.0のインストールを参照願います。

仮想マシンの作成

新規に仮想マシンを作成する

 VMWare Server Consoleの「File」→「New」→「Virtual Machine...」をクリックすると「New Virtual Machine Wizard」画面が開くので「次へ(N)」をクリック。Virtual Machine configurationでは「Typical」を選択して、Guest operating systemとVersionではそれぞれ「Linux」と「Red Hat Linux」を選択。Virtual machine nameを適当な名前に変更して、Network connectionは「Use bridged networking」にチェックをいれて「次へ(N)」をクリック 。仮想ディスク容量を設定するのに「Disk size(GB):」を適当な値にして(ここではデフォルトの8.0GBにしている)、ホストのディスク容量に比較的余裕があるので「Allocate all disk space now.」にチェックして「完了」をクリックして仮想ディスクの作成が開始します。

 仮想ディスクの作成が終了したら、「Devices」の「Memory」を開いて仮想マシンに割当てるメモリ容量を設定します。デフォルトでは256MBが推奨されている。次に仮想マシンのCD-ROMドライブを設定します。デフォルトでは「Auto」となっているが明示的にドライブを指定した。

この手順はここにキャプチャ画面をつけて説明しているので参照ねがいます。

IDEドライブの仮想ディスクの作成

 デフォルトではHard DiskのドライブがSCSI 0:0となっている。このままだと、SentOSのインストールディスクを起動しインストールを続けるとハードディスクドライブのパーティション設定する画面で「エラー発生 - 新規ファイルシステム作成のための有効なデバイスがみつかりません。ハードウェアをチェックして、この問題の原因を調査してください。」とのメッセージがでてパーティションの作成以降の作業ができません。

 そこで、以下のようにしてSCSIハードディスクドライブを削除し、IDEドライブに変更する必要があります。

  1. 「Commands」 → 「Edit virtual machine settings」をクリックして「Hadware」タブのデバイスから「Hard Disk (SCSI 0:0)」を選択して「Remove」ボタンをクリックしてデバイスからHard Diskを削除します。
  1. 次に、「Add」ボタンをクリックしてAdd Hardware Wizardを起動させ、追加する「Hardware Type」から「Hard Disk」を選択し、「次へ(N)」をクリックします。
  1. 「Create a new virtual disk」にチェックを入れ、「次へ(N)」をクリック
  1. 「Virtual Disk Type」の「IDE」にチェックをして「次へ(N)」をクリックします。
  1. 仮想マシンのディスク容量を設定します。8GBを仮想マシンのディスクとして設定し、「完了」をクリックする。
  1. 作成されるディスクファイルのファイル名を適当に変更し、「完了」をクリックします。

 これで新たにIDEドライブの仮想ディスクが作成されます。このあと、ゲストOSとしてCentOS 5.0をインストールします。


ゲストOS としてCentOS 5.0 のインストール

 CD/DVDドライブにインストール用CD6枚のうちの1枚目を入れて、「Power」 → 「Power On」をクリックします。その後は新規のHDDにインストールするのと同じ手順となるので、CentOS 5.0のインストールを参照。

 ここで注意が必要なのはインストールするパッケージの選択画面で、「今すぐカスタマイズする」をチェックし、「開発」グループの「開発ツール」のパッケージ群を必ず選択してください。VMwareツールをインストールする際のコンパイラインストールします。


VMware Tools のインストール

  「VM」 → 「Install VMware Tools...」をクリックし、さらに「Install」ボタンをクリックするとデスクトップにVMware ToolsというCDイメージのアイコンが表示されます。ここでは、/tmp/ディレクトリでVMwareTools-1.0.3-44356.tar.gzを展開し、vmware-tools-distribディレクトリに移動してルート権限でインストールスクリプトを実行します。

 途中、解像度の選択以外の質問に対しては[Enter]キーを押して問題ないようです。ただし、vmhgfsモジュールのコンパイルでエラーを起こしますが、このモジュールは共有ホルダー機能に必要で、この機能を使う為には必要な処置をして再度スクリプトを実行する必要があります。ここでは、[Enter]をおして続行しています。

$ cd /tmp/
$ tar xvfz /media/VMware\ Tools/VMwareTools-1.0.3-44356.tar.gz
$ cd vmware-tools-distrib/
$ su
パスワード:
# ./vmware-install.pl
Creating a new installer database using the tar3 format.

Installing the content of the package.

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 1.0.3 build-44356 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]


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]


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? [/lib/modules/2.6.18-8.el5/build/include]

Extracting the sources of the vmhgfs module.

Building the vmhgfs module.

Using 2.6.x kernel build system.
make: ディレクトリ `/tmp/vmware-config0/vmhgfs-only' に入ります
make -C /lib/modules/2.6.18-8.el5/build/include/.. SUBDIRS=$PWD 
SRCROOT=$PWD/. modules
make[1]: ディレクトリ `/usr/src/kernels/2.6.18-8.el5-i686' に入ります
  CC [M]  /tmp/vmware-config0/vmhgfs-only/cpName.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/cpNameLinux.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/dev.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/driver.o
/tmp/vmware-config0/vmhgfs-only/driver.c: In function 
‘HgfsChangeFileAttributes’:
/tmp/vmware-config0/vmhgfs-only/driver.c:763: error: 
‘struct inode’ has no member named ‘i_blksize’
/tmp/vmware-config0/vmhgfs-only/driver.c: In function 
‘HgfsInitializeInode’:
/tmp/vmware-config0/vmhgfs-only/driver.c:835: error: 
‘struct inode’ has no member named ‘u’
/tmp/vmware-config0/vmhgfs-only/driver.c: In function ‘HgfsIget’:
/tmp/vmware-config0/vmhgfs-only/driver.c:884: error: ‘struct inode’
 has no member named ‘u’
/tmp/vmware-config0/vmhgfs-only/driver.c: In function ‘HgfsCreate’:
/tmp/vmware-config0/vmhgfs-only/driver.c:1535: error: ‘struct inode’
 has no member named ‘u’
/tmp/vmware-config0/vmhgfs-only/driver.c: In function ‘HgfsLookup’:
/tmp/vmware-config0/vmhgfs-only/driver.c:1635: error: ‘struct inode’
 has no member named ‘u’
/tmp/vmware-config0/vmhgfs-only/driver.c: In function ‘HgfsMkdir’:
/tmp/vmware-config0/vmhgfs-only/driver.c:1727: error: ‘struct inode’
 has no member named ‘u’
/tmp/vmware-config0/vmhgfs-only/driver.c: In function ‘HgfsDelete’:
/tmp/vmware-config0/vmhgfs-only/driver.c:1854: error: ‘struct inode’
 has no member named ‘u’
/tmp/vmware-config0/vmhgfs-only/driver.c: In function ‘HgfsRename’:
/tmp/vmware-config0/vmhgfs-only/driver.c:2046: error: ‘struct inode’
 has no member named ‘u’
/tmp/vmware-config0/vmhgfs-only/driver.c:2048: error: ‘struct inode’
 has no member named ‘u’
/tmp/vmware-config0/vmhgfs-only/driver.c: In function ‘HgfsRevalidate’:
/tmp/vmware-config0/vmhgfs-only/driver.c:2288: error: ‘struct inode’
 has no member named ‘u’
/tmp/vmware-config0/vmhgfs-only/driver.c: In function ‘HgfsSetattr’:
/tmp/vmware-config0/vmhgfs-only/driver.c:2425: error: ‘struct inode’
 has no member named ‘u’
/tmp/vmware-config0/vmhgfs-only/driver.c: In function ‘HgfsOpen’:
/tmp/vmware-config0/vmhgfs-only/driver.c:2801: error: ‘struct inode’
 has no member named ‘u’
/tmp/vmware-config0/vmhgfs-only/driver.c: In function ‘HgfsDirOpen’:
/tmp/vmware-config0/vmhgfs-only/driver.c:3414: error: ‘struct inode’
 has no member named ‘u’
/tmp/vmware-config0/vmhgfs-only/driver.c: In function ‘HgfsClearInode’:
/tmp/vmware-config0/vmhgfs-only/driver.c:4105: error: ‘struct inode’
 has no member named ‘u’
make[2]: *** [/tmp/vmware-config0/vmhgfs-only/driver.o] エラー 1
make[1]: *** [_module_/tmp/vmware-config0/vmhgfs-only] エラー 2
make[1]: ディレクトリ `/usr/src/kernels/2.6.18-8.el5-i686' から出ます
make: *** [vmhgfs.ko] エラー 2
make: ディレクトリ `/tmp/vmware-config0/vmhgfs-only' から出ます
Unable to build the vmhgfs module.

The filesystem driver (vmhgfs module) is used only for the shared folder
feature. The rest of the software provided by VMware Tools is designed to 
work
independently of this feature.
If you wish to have the shared folders feature, you can install the driver 
by
running vmware-config-tools.pl again after making sure that gcc, binutils, 
make
and the kernel sources for your running kernel are installed on your machine.
These packages are available on your distribution's installation CD.
[ Press Enter key to continue ]

pcnet32                35269  0
Unloading pcnet32 module

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

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

Extracting the sources of the vmxnet module.

Building the vmxnet module.

Using 2.6.x kernel build system.
make: ディレクトリ `/tmp/vmware-config1/vmxnet-only' に入ります
make -C /lib/modules/2.6.18-8.el5/build/include/.. SUBDIRS=$PWD 
SRCROOT=$PWD/. modules
make[1]: ディレクトリ `/usr/src/kernels/2.6.18-8.el5-i686' に入ります
  CC [M]  /tmp/vmware-config1/vmxnet-only/vmxnet.o
  Building modules, stage 2.
  MODPOST
  CC      /tmp/vmware-config1/vmxnet-only/vmxnet.mod.o
  LD [M]  /tmp/vmware-config1/vmxnet-only/vmxnet.ko
make[1]: ディレクトリ `/usr/src/kernels/2.6.18-8.el5-i686' から出ます
cp -f vmxnet.ko ./../vmxnet.o
make: ディレクトリ `/tmp/vmware-config1/vmxnet-only' から出ます
The module loads perfectly in the running kernel.



Detected X.org version 7.1.


Please choose one of the following display sizes (1 - 13):

[1]  "640x480"
[2]  "800x600"
[3]  "1024x768"
[4]  "1152x864"
[5]  "1280x800"
[6]  "1152x900"
[7]  "1280x1024"
[8]  "1376x1032"
[9]  "1400x1050"
[10]  "1680x1050"
[11]  "1600x1200"
[12]  "1920x1200"
[13]  "2364x1773"
Please enter a number between 1 and 13:

[3] 7

Starting VMware Tools services in the virtual machine:
   Switching to guest configuration:                       [  OK  ]
   Guest vmxnet fast network device:                       [  OK  ]
   DMA setup:                                              [  OK  ]
   Guest operating system daemon:                          [  OK  ]

The configuration of VMware Tools 1.0.3 build-44356 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 session.

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

Enjoy,

--the VMware team

xorg.conf ファイルの編集

 VMwareツールのインストールスクリプトを実行しただけではマウスをホストOSゲストOS(CentOS 5.0)間にシームレスに移動することができません。また、画面の解像度を1240x1024に設定したにもかかわらず800x600か640x480の解像度しか設定できません。

 これを解消するには/etc/X11/xorg.confを編集する必要があります。

 マウスについてはSection "ServerLayout"にInputDevice "Mouse0" "CorePointer"を追加し、Section "InputDevice"のMouse0を追加。

Section "ServerLayout"
        Identifier     "Default Layout"
        Screen      0  "Screen0" 0 0   #<--- 追加
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "InputDevice"   #<---ここから
        Identifier  "Mouse0"
        Driver      "vmmouse"
        Option      "Protocol" "ps/2"
        Option      "Device" "/dev/input/mice"
EndSection   #<---ここまで追加

 解像度についてはSection "Monitor"を追加します。

Section "Monitor"   #<---ここから
    Identifier      "vmware"
    VendorName      "VMware, Inc"
    HorizSync 1-10000
    VertRefresh 1-10000

    ModeLine "640x480" 100 640 700 800 900 480 500 600 700
    ModeLine "800x600" 100 800 900 1000 1100 600 700 800 900
    ModeLine "1024x768" 100 1024 1100 1200 1300 768 800 900 1000
    ModeLine "1152x864" 100 1152 1200 1300 1400 864 900 1000 1100
    ModeLine "1280x800" 100 1280 1300 1400 1500 800 900 1000 1100
    ModeLine "1152x900" 100 1152 1200 1300 1400 900 1000 1100 1200
    ModeLine "1280x1024" 100 1280 1300 1400 1500 1024 1100 1200 1300
    ModeLine "1376x1032" 100 1376 1400 1500 1600 1032 1100 1200 1300
    ModeLine "1400x1050" 100 1400 1500 1600 1700 1050 1100 1200 1300
    ModeLine "1680x1050" 100 1680 1700 1800 1900 1050 1100 1200 1300
    ModeLine "1600x1200" 100 1600 1700 1800 1900 1200 1300 1400 1500
    ModeLine "1920x1200" 100 1920 2000 2100 2200 1200 1300 1400 1500
    ModeLine "2364x1773" 100 2364 2400 2500 2600 1773 1800 1900 2000
EndSection   #<---ここまで追加

 これでホストOSゲストOS間でのマウスの移動が可能になり、「システム」→「設定」→「画面の解像度」で解像度を選択できるようになるはずです。また、vmware-toolboxを起動すればホストOSゲストOS間でテキストのコピー&ペーストができるようになります。さらに起動時に自動的に実行されるようにするには、「システム」→「設定」→「個人の設定」→「セッション」の「自動起動するプログラム」にvmware-toolbox --minimizeを追加すればよいかも。






サイトマップこのサイトについてお問い合わせ | エンジニアの転職
Copyright (C) 2006-2008Ryusai's Homepage All rights reserved