coLinuxは、Windows上でLinuxカーネルを動かすもので、VMwareやVirtualPCなどの仮想マシン環境ソフトウェアと異なり、入出力のオーバーヘッドが無く高速に動作します。
Windowsのサービスとして起動ができるため、常時起動させてサーバー的に使うことができます。
ここでは、Windows XPへcoLinuxをインストールして、Debianを常時起動させてみます。
coLinuxのウェブサイトからcoLinux-stable coLinux-0.7.2.exeをダウンロードします。
1. coLinux-0.7.2.exeを実行し、インストーラーを起動させて[Next]ボタンをクリックします。
2. License Agreement画面で[I Agree]ボタンをクリックします。
3. coLinuxの左側にある+をクリックしてツリーを展開、SLiRPとWinPcapのチェックを外してから[Next]ボタンをクリックします。
4. Choose Install Location画面でインストールするフォルダを選びます。
5. Obtain a coLinux root file system image画面でDebian 4.0を選んで[Install]ボタンをクリックします。
6. Debianのイメージがダウンロードされた後、ネットワークドライバのインストール画面が表示されるので、[続行]ボタンをクリックします。
7. Complete画面が表示されたらインストール完了です。
1. エクスプローラでインストールフォルダを開きます。
2. Debian-4.0r0-etch.ext3.1gb.bz2を解凍します。 (.bz2はLhaplusで解凍できます。)
3. 解凍されたDebian-4.0r0-etch.ext3.1gbをroot_fsにファイル名変更、インストールフォルダに置きます。
4. コマンドプロンプトでインストールフォルダに移動、以下のコマンドをタイプして、256MByteのスワップパーティションのイメージファイルを作成します。
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
D:\coLinux> fsutil file createnew swap_device 268435456
ファイル D:\coLinux\swap_device が作成されました
D:\coLinux>
5. example.confを編集、debian.confとして保存します。
〜略〜
# File contains the root file system.
# Download and extract preconfigured file from SF "Images for 2.6".
cobd0="d:\coLinux\root_fs" ← root_fsのパスを設定する
# Swap device, should be an empty file with 128..512MB.
cobd1="d:\coLinux\swap_device" ← 行頭の#を削除してswap_deviceへのパスを設定する
〜略〜
# Maximal memory for linux guest
mem=128
〜略〜
# Tuntap as private network between guest and host on second linux device
eth0=tuntap ← 行頭の#を削除してeth0にする
7. debian.batを作成して以下のコマンドを記述します。
colinux-daemon.exe -t nt @debian.conf
6. debian.batを実行するとDebianが起動します。(rootのパスワードはデフォルトでroot)
Setting kernel variables...done.
Mounting local filesystems...done.
Activating swapfile swap...Unable to find swap-space signature
done.
Setting up networking....
Configuring network interfaces...done.
INIT: Entering runlevel: 2
Starting system log daemon: syslogd.
Starting kernel log daemon: klogd.
* Not starting internet superserver: no services enabled.
Starting periodic command scheduler: crond.
Debian GNU/Linux 4.0 debian tty1
debian login: root
Password:
Linux debian 2.6.22-co-0.7.2 #1 PREEMPT Fri Jan 18 21:44:04 UTC 2008 i686
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
debian:~#
8. swapの設定をします。
debian:~# mkswap /dev/cobd1
Setting up swapspace version 1, size = 268431 kB
no label, UUID=8e1cca5a-8d35-4b24-8e31-0d1579b5a499
debian:~# swapon /dev/cobd1
Adding 262136k swap on /dev/cobd1. Priority:-1 extents:1 across:262136k
debian:~#
9. シャットダウンして次のネットワーク設定をします。
debian:~# shutdown -h now
coLinuxは、Windowsの仮想ネットワークドライバであるTAP-Win32を使ってcoLinuxをインストールしたPCとcoLinuxの間に仮想ネットワークを構築します。
TAP-Win32のネットワークは、3種類(NAT/ROUTER/BRIDGE)の接続方法がありますがここではNAT接続をしてみます。NAT接続のときのIPアドレスは、192.168.0.1(TAP-Win32)と192.168.0.2(coLinux)になります。
1. コントロール パネルから、「ネットワーク接続」を開きます。
2. TAP-Win32 Adapter V8 (coLinux)というローカル エリア接続があることを確認します。
3. PCのネットワークコントローラ名が表示された「ローカル エリア接続」を右クリックして「プロパティ」画面を開き、「プロパティ」タブをクリックします。
4. 「インターネット接続の共有」にある「ネットワークの他のユーザーに、このコンピュータのインターネット接続をとおしての接続を許可する」のチェックボックスをチェックして、「ホーム ネットワーク接続」のプルダウンリストから2.で確認したネットワーク接続を選びます。
5. 「ネットワークのほかのユーザーに、共有インターネット接続の制御や無効化を許可する」のチェックボックスを外します。
6. [OK]をクリックして「ローカルエリア接続のプロパティ」を閉じます。
7. C:\WINDOWS\system32\drivers\etc\hostsに仮想ネットワークのIPアドレスとホスト名を追加します。
192.168.0.1 winxp
192.168.0.2 colinux
coLinuxを起動して、以下の設定をします。
Debian Login: root
Password: ********
debian:~# nano /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.2
gateway 192.168.0.1
netmask 255.255.255.0
debian:~#
debian:~# nano /etc/resolv.conf
nameserver 192.168.0.1
debian:~# /etc/init.d/networking restart
debian:~#
debian:~# nano /etc/hosts
192.168.0.1 winxp
192.168.0.2 colinux
コマンド プロンプトでサービスの登録をします。
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
D:\coLinux> colinux-daemon.exe -t nt @debian.conf --install-service
Cooperative Linux Daemon, 0.7.2
Compiled on Jan 18 2008 21:47:09
daemon: installing service 'Cooperative Linux'
daemon: service command line: "D:\coLinux\colinux-daemon.exe" -t nt @debian.conf --run-service
daemon: setting restart options
daemon: service installed.
D:\coLinux>
「スタート」−「コントロール パネル」−「管理ツール」−「サービス」で、「Cooperative Linux」を右クリックして「プロパテイ」画面を開き、[開始]ボタンを押します。
Windowsの起動時に自動的に立ち上げたいときは、「プロパティ」画面の「スタートアップの種類」プルダウン メニューから「自動」を選びます。
以上で設定は完了です!
インストールフォルダにあるcolinux-console-fltk.exeをダブルクリックすると自動起動されたcoLinuxのコンソール画面が表示されます。
telnetdかsshdを起動させておけば、TeraTermなどからもLoginできます!