Cent OS 5 のリリースが、アナウンスされるまで、110Gd を使っていろいろなことをやってみようと思い、第一弾としてこんなことをやってみました。(2弾はないかもしれないけど。
VMware Server に Linux ではなく、VMware Server を Linux にインストールしてみました。
VMware Server は Windows だけでなく、Linux 上でも動かすことができるんですね~。
ちゃんと、Linux 用のバイナリも配布されています。
今回は、さらに Windows から仮想マシンを操作することもやってみました。
VMware Server はリモート操作できるんで、VMware Server Console さえ入っていれば、普通にほかのマシンからも操作できます。
こうすれば、VM を操作していても、処理はサーバーで行われるので、ほかの作業の妨げになりません。
ただ、導入方法が Windows にインストールする際と違って、ちょっと面倒なんで、その方法を結構詳しく書いておきます。
まあこれは、自分のメモのための役割も多いですが。
最初に、今回使用した環境ですが。
- NEC Express5800/110Gd
- Celeron D 341(2.93 GHz)
- DDR2 SDRAM 512MB
マシンは、軽くこんな感じです。
ホスト OS は、Cent OS 5 Beta を使用します。
VMware Server のバージョンは、現時点で最新版の 1.0.2 を使用します。
RHEL や RedHat 系のOSなら、導入方法は大体同じかと思われますが、そのほかだと違うと思うので、その点注意してください。
特に、パッケージのインストールとかは、結構ディストリビューションによって変わってくると思います。
では、まず Cent OS 5 を普通にインストールしただけでは、VMware をインストールするために必要なパッケージがインストールされていません。
とりあえず、それの導入方法から。
アプリケーション → ソフトウェアの追加と削除 の順にたどって、パッケージマネージャを開きます。
gcc をインストールするわけですが、よく導入方法がわからない方は右側のリストの "開発" をクリックして、左側の "開発ツール" にチェックを入れると、余計なものもくっついてきますが、その中に gcc も含まれているのでインストールすることができます。
まあ、ここら辺の開発ツールはインストールしておいて損にはなりません。
次に、カーネルソースをインストールします。
"kernel-devel" というパッケージをインストールすればよいので、検索タブから kernel-devel と入力して検索を押すと、ヒットすると思いますのでチェックを入れてください。
次に、"xinetd" というパッケージをインストールします。
xinetd または inetd とは、スーパーサーバーってやつです。
説明すると長くなるので、意味が知りたい方は下のページをご覧ください。
話を戻しますが、インストールするには、同じように "inetd" とか "xinetd" と検索すれば、いろいろ出てくるかと思うんで、その中の "xinetd" のチェックを入れてください。
以上の設定ができたら、[適用] ボタンを押してください。
あとは、普通にパッケージがインストールされると思うので、しばらく待ちましょう。
パーッケージのインストールが終わりましたら、次にバイナリをダウンロードしてきます。
日本の VMware のサイトからダウンロードするのもよいですが、ログインがバグってたり、いろいろあったりと面倒なので、アメリカの VMware のサイトから落としましょう。
こちらから、一番新しいバージョンの "Download" という文字をクリックします。(この記事の開設通りに進みたければ 1.0.2 をダウンロードしましょう。)
そうすると、いわゆるアレ(名前忘れたw)が表示されますんで、一番下にスクロールして "Yes" をクリックします。
ダウンロードページが表示されると思うので、"Download VMware Server (for Linux Systems)" の 一番上以外を全部ダウンロードします。
正確に言うと
- VMware Server for Linux. [Binary (.rpm)]
- Management Interface.
- VMware Server Linux client package.
この 3 つをDLします。
保存先は、好きな場所でいいです。
僕は、/home/techno にダウンロードしました。(ここにダウンロードしたことを前提に説明を進めます。)
では、ダウンロードが終わりましたら、早速インストールのほうに入ります。
基本的に、テキストベースでのインストールになるので、X を使用している場合はターミナルでのインストールになります。
まず、基本的な作業です。ターミナルを開きます。
テキストで書くと、下のような感じ。
黒字部分を入力していきます。
[techno@localhost ~]$su
パスワード(P):
[root@localhost techno]#cd /home/techno
[root@localhost techno]#rpm -Uvh VMware-server-1.0.2-39867.i386.rpm
準備中... ########################################### [100%]
1:VMware-server ########################################### [100%]
[root@localhost techno]#vmware-config.pl
Making sure services for VMware Server are stopped.
Stopping VMware services:
Virtual machine monitor [ OK ]
You must read and accept the End User License Agreement to continue.
Press enter to display it.
こんな感じで、進めていきます。
ここで、エンターを押すと、利用許諾契約が表示されるので、スペースキーかエンターキーを連打して、最後まで進めましょう。
最後までいくと、
Do you accept? (yes/no)
と表示されるので、"yes" と入力して Enter を押す。
あとは、こんな感じでインストールを進める。
ほとんど、Enter を連打するだけでよいが、注意する部分はそのつど説明する。
Thank you.
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? [/lib/modules/2.6.18-1.2747.el5/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' に入ります
make -C /lib/modules/2.6.18-1.2747.el5/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: ディレクトリ `/usr/src/kernels/2.6.18-1.2747.el5-i686' に入ります
CC [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-1.2747.el5-i686' から出ます
cp -f vmmon.ko ./../vmmon.o
make: ディレクトリ `/tmp/vmware-config0/vmmon-only' から出ます
The module loads perfectly in the running kernel.
Do you want networking for your virtual machines? (yes/no/help) [yes]
Configuring a bridged network for vmnet0.
The following bridged networks have been defined:
. vmnet0 is bridged to eth0
All your ethernet interfaces are already bridged.
Do you want to be able to use NAT networking in your virtual machines? (yes/no)
[yes]no
仮想マシンで、NAT を使用するかしないかなんだけど、ブリッジさせたいから"no" を入力。
別に、"Yes" でも構わない。
Do you want to be able to use host-only networking in your virtual machines?
[no]
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-1.2747.el5/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: ディレクトリ `/usr/src/kernels/2.6.18-1.2747.el5-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-1.2747.el5-i686' から出ます
cp -f vmnet.ko ./../vmnet.o
make: ディレクトリ `/tmp/vmware-config0/vmnet-only' から出ます
The module loads perfectly in the running kernel.
The default port : 902 is not free. We have selected a suitable alternative
port for VMware Server use. You may override this value now.
Remember to use this port when connecting to this server.
Please specify a port for remote console connections to use [904]
VMware Server が使用する、デフォルトポート 902 番は、使用中とのこと。
そのため、自動的に 904 に変更されている。
ほかのポート番号に変更される場合もあるので、ここでどのポート番号に割り当てられたかを確認しておかないと、あとで外部から接続するときに困るので、ポート番号を控えておくこと。
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 を停止中: [失敗]
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.
Generating SSL Server Certificate
In which directory do you want to keep your virtual machine files?
[/var/lib/vmware/Virtual Machines]
The path "/var/lib/vmware/Virtual Machines" does not exist currently. This
program is going to create it, including needed parent directories. Is this
what you want? [yes]
Please enter your 20-character serial number.
Type XXXXX-XXXXX-XXXXX-XXXXX or 'Enter' to cancel: ****-*****-*****-*****
シリアルナンバーを入力する。
シリアルナンバーの取得は、
ここから出来る。
日本語で進めたい場合は、少々面倒だが
ここからでもOK。
詳しい取得方法は省くが、ここを参考に。
シリアルはメールで送られてくるので、注意。
Starting VMware services:
Virtual machine monitor [ OK ]
Virtual ethernet [ OK ]
Bridged networking on /dev/vmnet0 [ OK ]
The configuration of VMware Server 1.0.2 build-39867 for Linux for this running
kernel completed successfully.
[root@localhost techno]#
とりあえず、サーバー本体のインストールはこれで終了。
次に、"Management Interface" をインストールする。
[root@localhost techno]# tar xvf VMware-mui-1.0.2-39867.tar.gz
だーっと解凍される。
[root@localhost techno]# cd vmware-mui-distrib
[root@localhost vmware-mui-distrib]# ./vmware-install.pl
Creating a new installer database using the tar3 format.
You must read and accept the End User License Agreement to continue.
Press enter to display it.
またここで、利用規約が表示されるから、スペース連打。
Do you accept? (yes/no)yes
Thank you.
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 VMware Management Interface
files? [/usr/lib/vmware-mui]
The path "/usr/lib/vmware-mui" does not exist currently. This program is going
to create it, including needed parent directories. Is this what you want?
[yes]
In which directory would you like to install the documentation files?
[/usr/lib/vmware-mui/doc]
The path "/usr/lib/vmware-mui/doc" 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 Management Interface 1.0.2 build-39867 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-mui.pl".
Before running VMware Management Interface for the first time, you need to
configure it by invoking the following command:
"/usr/bin/vmware-config-mui.pl". Do you want this program to invoke the command
for you now? [yes]
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.
[root@localhost vmware-mui-distrib]#
とりあえず、"Management Interface" もインストール終了。
最後に、"VMware Server Linux client package." をインストールする。
[root@localhost vmware-mui-distrib]# cd ../
[root@localhost techno]# unzip VMware-server-linux-client-1.0.2-39867.zip
Archive: VMware-server-linux-client-1.0.2-39867.zip
inflating: VMware-VmPerlAPI-1.0.2-39867.tar.gz
inflating: VMware-server-console-1.0.2-39867.i386.rpm
inflating: VMware-server-console-1.0.2-39867.tar.gz
inflating: VMware-vix-1.0.2-39867.tar.gz
[root@localhost techno]# rpm -Uvh VMware-server-console-1.0.2-39867.i386.rpm
準備中... ########################################### [100%]
1:VMware-server-console ########################################### [100%]
[root@localhost techno]# tar xvf VMware-server-console-1.0.2-39867.tar.gzだーっと解凍される。
[root@localhost techno]# cd vmware-server-console-distrib
[root@localhost vmware-server-console-distrib]# ./vmware-install.pl
A previous installation of VMware software has been detected.
The previous installation was made by the rpm installer (version 3).
Converting the rpm3 installer database format
to the tar3 installer database format.
Installing the content of the package.
In which directory do you want to install the binary files?
[/usr/bin]
In which directory do you want to install the library files?
[/usr/lib/vmware-server-console]
The path "/usr/lib/vmware-server-console" 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 manual files?
[/usr/share/man]
In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-server-console]
The path "/usr/share/doc/vmware-server-console" 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 Server Console 1.0.2 build-39867 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-server-console.pl".
Before running VMware Server Console for the first time, you need to configure
it by invoking the following command:
"/usr/bin/vmware-config-server-console.pl". Do you want this program to invoke
the command for you now? [yes]
You must read and accept the End User License Agreement to continue.
Press enter to display it.
ここで、またまた利用規約登場。
何回も表示されて、非常に厄介だが、使わせていただくのだからしょうがない。
本来なら、すべて読まなければいけないが、日本人にこれを読めというのは、ちと厳しすぎる。
Do you accept? (yes/no)yes
Thank you.
Configuring fallback GTK+ 2.4 libraries.
The configuration of VMware Server Console completed successfully.
[root@localhost vmware-server-console-distrib]#
ここまで来たら、お疲れ様である。
これで、インストール完了。
結構長かったっしょ?
つぎに、VMware Server Console を使用して、仮想マシンを作成してみます。
アプリケーション → システムツール → VMware Server Console
の順にたどり、VMware Server Console を起動する。
こんな感じで、来たらインストール成功。
そのまま、[Connect] をクリックする。
メニューで、"Create a new virtual machine" をクリックする。
普通に "Next" を押す。
普通は、そんな細かく設定する必要もないので、"Typical" でいいです。
今回は、Vine Linux をゲスト OS に使用したいと思うので、"Other Linux 2.6.x kernel" を選択する。
仮想マシンの名前を入力する。
今回は、ブリッジ接続を使用するので、一番上を選択します。
仮想マシンに割り当てる、仮想 HDD の容量を選択します。
今回は、20GB 割り当てます。
Split disk 2GB files は、仮想 HDD のファイルを、2GB ごとに分割するのですが、仮想 HDD を保存してあるドライブは、ext3 でフォーマットしてあるので、相当大きい容量のファイルも扱えるので、チェックをはずします。
Allocate all disk space now にチェックを入れておくと、あらかじめ 仮想 HDD 用に、選択した容量を確保します。
チェックを入れたままにしておくと、若干仮想マシンの動きが良くなります。
チェックをはずせば、仮想 HDD を使用している分だけ、ディスク容量を使用するので、ディスク空き容量を効率的に使用できますが、フラグメンテーションが起きやすくなりますし、仮想マシンの動きが少し遅くなります。
最後に "Finish" を押すと、Allocate all disk space now にチェックを入れた場合は、仮想 HDD ファイルの作成を始めます。
容量によって、すぐに終わったり、かなり時間がかかったりします。
チェックを入れてない場合は、何も起きないと思います。
これで、仮想マシンが、作成されました。
仮想マシンを起動する際は、"Power on this virtual machine" をクリックすると起動します。
仮想マシンの設定を変更したい場合は、"Edit virtual machine setting" をクリックします。
今回は、メモリを割り当てる容量を変えたいので、下をクリックします。
スライダーを動かして、メモリの容量を変えます。
右側のボックスに、数字を入力しても OK です。
今回は、256MB 割り当てることにします。
サウンド機能を割り当てたい場合は、"Add" をクリックして、"Sound Adapter" を選択して "Next" を押せば仮想マシン上の音を、ホスト OS 上でならすことができます。
サウンドカードを搭載していないマシン(たとえばサーバーマシン)だと、これは設定しても、仮想マシンを起動したときにエラーがでます。
そのほかにも、いろいろな機能を設定することができます。
では、設定をとじて、仮想マシンを起動してみましょう。
今回は、Vine Linux をインストールしてみるので、Vine Linux の CD をドライブに挿入して、起動します。
vmware という BIOS 画面が立ち上がって、このようにインストーラーが起動すれば成功です。
あとは、普通にインストールするだけで使えます。
仮想マシンの映っている画面でマウスをクリックすると、マウスのコントロールが仮想マシンに移ります。
抜け出す場合は、Ctrl + Alt をクリックすると、ホスト OS にマウスのコントロールが戻ります。
フルスクリーンにする際は、Ctrl + Alt + Enter, Quick Switch といって、フルスクリーンですが、上に仮想マシンのタブが表示されていて、すぐに仮想マシンを切り替えられるモードにするには F11 を押します。
では、次に他のマシンから、この VMware Server に接続してみます。
ファイアーウォールや、SELinux の設定が面倒なので、今回はすべて OFF にしてあります。
LAN 内だけで使うのであれば、LAN内 のセキュリティさえちゃんとしておけば、特に問題ないでしょう。
インターネットを通じて、仮想マシンをコントロールしたい場合は、きちんと設定してください。
今回は、ギガビットLAN(1000BASE-T)で接続された、Windows マシンから操作してみます。
他の Windows マシンから操作するには、"VMware Server Windows client package."が必要です。
ここから、ダウンロードします。
あとは、普通にインストールして、実行します。
インストールされた、VMware Server Console を起動すると、こんな画面が出てきますんで、ホストネームに IP アドレスまたは、ドメイン名を入力します。
また、インストール時にポート番号がデフォルトから変更された場合は ": (コロン)" に続く形でポート番号を入力します。
ユーザー名は、Linux や Windows で通常ログインしているユーザー名で OK です。
正しく接続されると、上のような画面が表示されます。
きちんと、サーバーに接続され、仮想マシンの情報を取得することができました。
では、ここから "Start this virtual machine" をクリックして、仮想マシンをリモート起動してみましょう。
このように、ちゃんと起動して、画面がリモート操作できるようになれば、完璧です。
動作も、かなりスムーズです。
ちなみに、サーバー側でもコンソールを立ち上げて、操作してみると、マウスが同じように動いてることが確認できます。
ほとんど遅れはありません。
Windows の リモートデスクトップなどよりも、かなりスムーズです。
実際に、ホストマシン上で動かしているのと、何ら変わりありません。
これなら、何の問題もなく仮想マシンサーバーを使うことができます。
というか、Linux 上に VMware をインストールした場合、Windows にインストールした場合と比べると、セキュリティソフトが動いてなかったりするせいか、Linux にインストールした場合のほうが、かなり軽いです。
いつも、Windows を使っているマシンよりも、今回使用したマシンはマシンスペックが低いのですが、それでもかなり軽い感じです。
というわけで、かなり長くなりましたが、VMware を Linux にインストールする際は、ぜひ参考にしてください。
VMware の仮想マシンで作った Linux マシン上に、また VMware をインストールするなどという、すごいことをやってみたりすることもできますねw
動作は相当遅くなるでしょうけど・・・。

非常に丁寧に解説してあるいいページですね。
私は最近,自宅でLinuxサーバを立ち上げて,
せっかくだからWinXPも仮想化していれてみようと
考えていたところです。
しかし,余っていたパーツでサーバを組んだので,
HDDの容量が20GBしかなく,小遣いに余裕ができたら
320GBのHDD2個を,RAIDを組んでインストールしようと
計画中です。
Linux上で仮想化したPCはWindouws上で仮想化したPCより
も軽いのでは,と思っていたのですが,上を読むと
どうもその通りのようですね。
どうもありがとうございました。
とても参考になりました!!
宝物にします!
メチャクチャわかりやすいです。
全くこの通りにしてVMware Serverをインストールすることができました。ありがとうございます。
(参考までに。利用規約の画面では「q」を押すと、直ぐにyes/no画面まで飛びます。)
利用規約を飛ばすそんな方法があったのですね。
コメントどうもです。