2.1 colinux の入手とインストール
colinux のサイト から、Downloads のリンクを辿ると、
sourceforge.net
のダウンロードページ へ辿りつきます。
ここから、coLinux-0.6.1.exe をダウンロードしてインストールします。
coLinux-0.6.1.exe を実行し、『next』⇒『I agree』と進み、「Choose
Components」で取り合えず全部選択した状態で、『next』とします。
今度は、「Choose Install
Location」の画面で、インストール先を指定しますが、私の場合は、Fドライブ(3.77GBのNTFSの圧縮ドライブ)を専用のインストール先と
して、使用することとし、F:\colinux と指定しました。
続く 「Get WinPCAP」で『next』とし、「Obtain a colinux root file system
image」の画面となります。
ここでは、Debian を選択し、『install』します。
しばらくすると、「ハードウェアのインストール」の画面が出ますが、『続行』を指示しますと、間もなくインストールは終了します。
が、まだ使用できる状態ではありません。
2.2 colinux の環境設定
ここでは、以下の設定を行ないます。
- linux側で使用するパーティション用のイメージファイルの用意
- colinux の設定ファイルの編集
- Windows側とlinux側でネットワーク接続するための、まずは、Windows側の設定を行ないます。
まず、linux側で使用するパーティション用のイメージファイルの用意です。
colinuxの中でlinuxを動作させる場合、linuxが使用するパーティションは1つのイメージファイルです。
通常、linuxを動作させるためには、ルートパーティションとスワップパーティションが必要ですので、colinuxで利用する場合、これらのパーティ
ションのためのイメージファイルを用意します。
ルートパーティションイメージは、既に圧縮イメージがインストールフォルダにありますので、解凍して適当な名称で展開します。
今回の場合、Debian-3.0r0.ext3.1gb.bz2 というのがありますので、これをroot_fsという名称のファイルで解凍します。
bz2形式なので、解凍ツールを探すのに手間がかかるかも知れません。私は、
解凍レンジ というのを使用しました。
もうひとつ、スワップパーティションのイメージファイルですが、こちらは空のファイルを作成すればよいらしく、WindowsXPでは、次のように作成で
きます。
F:\colinux>fsutil file createnew swap_device 268435456
268435456というのは、256MBのスワップパーティションを与えたいため、
256×1024×1024=268435456
からきています。
winodws2000の場合、このコマンドは使えないようです。余裕があったら、作成してダウンロード可能とするつもりですが、他のNET上のサイトで
親切にいくつかのサイズのファイル提供してくれている方がいらっしゃいます(colinux,swapでヒットしますので探してみてください。なお、
bz2だと解凍に苦労する場合があるので、lzh形式のものを見つけるのが無難と考えます)。
次に、colinux の設定ファイルの編集です。
インストールフォルダ(ここでは、F:\colinux)に、default.colinux.xml
というファイルがありますので、これを編集します。
なお、このファイルの改行コードは、UNIXスタイルのLFとなっていますので、メモ帳で開くと改行がされません。が、編集に際しては、Windowsの
改行コードでも大丈夫なようです。
私は、
xyzzy
エディタで編集しました(linuxとの相性のいいエディタです)。
元々はこうでした。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
<?xml
version="1.0" encoding="UTF-8"?>
<colinux>
<!-- This line needs to point to your root file
system.
For example change "root_fs" to the
name of the Debian image.
Inside coLinux it will
be /dev/cobd0 -->
<block_device index="0"
path="\DosDevices\c:\coLinux\root_fs"
enabled="true" />
<!-- This line can specify a swap file if you
wish, or an additional
image file, it will
/dev/cobd1. Additional block_devices can
be specified in the same manner by increasing
the index -->
<block_device index="1"
path="\DosDevices\c:\coLinux\swap_device"
enabled="true" />
<!-- bootparams allows you to pass kernel boot
parameters -->
<bootparams>root=/dev/cobd0</bootparams>
<!-- image allows you to specify the kernel to
boot -->
<image path="vmlinux" />
<!-- this line allows you to specify the amount
of memory available
to coLinux -->
<memory size="64" />
<!-- This allows you to modify networking
parameters, see the README
or website for more
information -->
<network index="0" type="tap" />
</colinux>
|
これを次のように変更しました。
変更した行番号は、6(ドライブ名称 c ⇒ f)、13(ドライブ名称 c ⇒
f)、24(メモリサイズ64M ⇒ 256M)、28(name="TAP"を追加)
です。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
<?xml
version="1.0" encoding="UTF-8"?>
<colinux>
<!-- This line needs to point to your root file
system.
For example change "root_fs" to the
name of the Debian image.
Inside coLinux it will
be /dev/cobd0 -->
<block_device index="0"
path="\DosDevices\f:\coLinux\root_fs"
enabled="true" />
<!-- This line can specify a swap file if you
wish, or an additional
image file, it will
/dev/cobd1. Additional block_devices can
be specified in the same manner by increasing
the index -->
<block_device index="1"
path="\DosDevices\f:\coLinux\swap_device"
enabled="true" />
<!-- bootparams allows you to pass kernel boot
parameters -->
<bootparams>root=/dev/cobd0</bootparams>
<!-- image allows you to specify the kernel to
boot -->
<image path="vmlinux" />
<!-- this line allows you to specify the amount
of memory available
to coLinux -->
<memory size="256" />
<!-- This allows you to modify networking
parameters, see the README
or website for more
information -->
<network index="0" type="tap" name="TAP"/>
</colinux>
|
続いて、WindowsXP側のネットワーク設定を行ないます。
WindowsXPとcolinuxのネットワーク接続を行なう方法は、いくつかありますが、私のPC環境はdhcpで起動時にIPアドレスを取得してお
り、別のIPを確保することは出来ないので、TAP-Win32によるNAT接続を行なうことにします。
(この先の操作は、windows2000の場合、colinux を立ち上げておかないとできないようですので、ご注意ください)
[ネットワーク接続]で[ローカルエリア接続2]の名称で、[TAP-Win32
Adapter]が追加されているはずなので、これを[TAP]の名称に変更します。
次にこの[TAP]から、[ローカルエリア接続]へネットワークデータが流れるように、[ローカルエリア接続]の[プロパティ]→[詳細設定]で、以下の
ように設定します。
次に、[TAP]の[プロパティ]→[インターネットプロトコル(TCP/IP)のプロパティ]を以下のように設定(WindowsXPとcolinux
の間のプライベートネットワークで、WindowsXP側のIPアドレスを、192.168.0.1
とします(colinux側は後述しますが、192.168.0.2 となります)。
あと、最後に、これは必ずしも必要ないですが、WindowsXP側のhosts
(C:\WINDOWS\system32\drivers\etc\hosts)に以下の行を追加します。
192.168.0.2 colinux
さあ、この状態でcolinuxを起動してみましょう。次のコマンドで、起動できます。
> f:\colinux\colinux-daemon.exe -c default.colinux.xml
(ドライブ名は、読み替えてください)
ログインのプロンプトが表示されていますが、「root」と入力すればパスワード無しでログインできます。
colinux のシャットダウンは次のコマンドで行なえます。
> shutdown -h now
Windows側のcolinuxの初期設定は、これで終わりです。