Gentoo coLinux で MinGW クロスコンパイル >> coLinux 環境の設定

coLinux 環境の設定


coLinux をダウンロード、インストールし、 Gentoo coLinux を起動しログイン、そして終了させるところまで説明します。

はじめに


Cooperative Linux ( coLinux )は Windows 上で Linux を起動させるエミュレータです。 VMWare とよく似ていますが、 Linux 専用で、ゲスト OS のカーネルにパッチを当てる必要があります。パッチ適用済みのカーネルは coLinux に同梱されています。ゲスト OS はネイティブで動作するので高速です。

必要なもの

管理者権限
coLinux は管理者権限で動きます。制限ユーザでは使えません。(*1)
NT 系 OS
coLinux は Windows 200/XP で動作します。 9x 系では動きません。
coLinux
Gentoo イメージ
coLinux が配布しているパーティション イメージです。解凍すると 2Gb ( 2048Mb ) あります。
スワップ イメージ
パーティション イメージです。 64Mb 〜 1024Mb まで用意されています。
空き容量
ハードディスクに coLinux と Gentoo イメージ、それにスワップ イメージを入れるための空き容量が必要です。
cofs でマウントするパス
多バイト文字を使用したファイルがなくパスにも含まれないアドレス(パス)。
メモリ
実メモリ 512Mb 以上推奨です。例では coLinux に 256Mb 与えています。
  • *1 使えなくはない。 -t nt だと起動できる。 tap や winpcap は使えないようだけど。

ソフトウエアのダウンロード


coLinux の配布サイトから coLinux 本体と Gentoo イメージをダウンロードします。
Cooperative Linux
http://sourceforge.net/project/showfiles.php?group...
  • coLinux の最新版は colinux-0.6.3-linux-2.6.11 です。僕が使用したバージョンは 0.6.2-linux-2.6.10 です。
  • Gentoo イメージの最新版は Gentoo-colinux-stage3-x86-2004.3.bz2 です。

スワップ イメージはここからダウンロードできます。後述する coLinux Wiki からリンクされているページです。
http://gniarf.nerim.net/colinux/swap/
  • 512Mb のものを使用しています。

インストール


coLinux をインストールします。インストール方法は総本山か「Cooperative Linux(coLinux)のメモ」を参照してください。

パーティション イメージは coLinux とは異なる場所にインストールできます。

インストールしたアドレス(パス)をメモしておいてください。

環境設定ファイルの編集


coLinux フォルダに ある colinux.xml をコピーし、 gentoo-colinux.xml にリネームします。

メモ帳などで開き、 block_device と memory タグを編集し、 cofs_device タグを追加します。

参考例。ここでは Gentoo イメージが d:\coLinux\Gentoo-colinux-stage3-x86-2004.3 にあり、スワップ イメージは d:\coLinux\swap_device.img にあるものとしています。 cofs は d:\ をルートとしています。 coLinux が使用するメモリは 256Mb に設定しています。
<?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 Aliasing: You can now handle most dual-boot issues
	 by adding an alias="devname" to block_device. i.e. alias="hda",
	 alias="hda1" You can do this for SCSI as well as IDE.  You need
	 to be aware that if you add an alias, you need to change your
	 bootparams root="devname" appropriately (you may need to use
	 devfs naming in some situations).  -->
    <block_device index="0" path="\DosDevices\d:\coLinux\Gentoo-colinux-stage3-x86-2004.3" enabled="true" />
    <block_device index="1" path="\DosDevices\d:\coLinux\swap_device.img" enabled="true" />
    <block_device index="2" path="\Device\Cdrom0" enabled="true" />
    <cofs_device index="0" path="\DosDevices\d:\" type="flat"  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 -->

    <!-- bootparams allows you to pass kernel boot parameters -->
    <bootparams>
        root=/dev/cobd0
    </bootparams>

    <!-- Initial RamDISK (initrd) support -->
    <initrd path="initrd.gz" />
    
    <!-- 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 or wiki for more information -->
    <network index="0" type="tap" />
</colinux>

起動


コマンドプロンプトから次のように実行します。
colinux-daemon.exe -c gentoo-colinux.xml

別窓が開き fltk が起動します。 colinux-daemon に渡す -t スイッチで fltk と nt を切り替えられます。 nt をお勧めします。

ログイン


入力待ちになったらログインします。ユーザ名、パスワードともに root です。

シャットダウン


halt でシャットダウンできます。うまくいかないときはウインドウの閉じるボタンを押してください。

ショートカットの作成


デスクトップなどにショートカットを作成しておくと起動を簡略化できます。

coLinux.exe を右ドラッグ&ドロップしショートカットを作成します。ファイルのプロパティを開き、リンク先に「colinux-daemon.exe -c gentoo-colinux.xml -t nt」と指定します。環境設定ファイルは coLinux と同じフォルダに gentoo-colinux.xml の名前で保存してあり、コンソールは nt を使うように指定しています。

実行ユーザを変更して起動する場合は runas を使います。リンク先に「runas.exe /user:%COMPUTERNAME%\<username> "colinux-daemon.exe -c server.gentoo.colinux.xml -t nt"」のように指定します。 <username> は切り替えるユーザ名に置き換えてください。

リンク

Cooperative Linux
http://www.colinux.org/
coLinux の総本山です。
Cooperative Linux - SourceForge.net
http://sourceforge.net/project/showfiles.php?group...
SourceForge のダウンロードページです。
Cooperative Linux Wiki
http://wiki.colinux.org/cgi-bin
coLinux に関する wiki ページです。
Cooperative Linux(coLinux)のメモ
http://scratchpad.fc2web.com/colinux/
日本語で読める coLinux 情報ページです。インストールから設定、ネットワーク設定、カーネル構築などさまざまなトピックを扱っています。
memo - Gentoo on coLinux
http://www1.atwiki.jp/ko001/pages/4.html
Gentoo coLinux について、インストール、環境設定などを解説されています。
CoLinux ? j-lab
http://ns.jk.to/zwiki/CoLinux
さまざまな tips を公開されています。
coLinux 用 インストーラ
http://www.geocities.co.jp/SiliconValley/1596/coLi...
coLinux に Vine Linux, Fedora Code, CentOS などをインストールして使うためのインストーラを作成/配布されてます。

更新履歴


2006/4/21fri リンク追加。
2006/3/21tue ショートカットの作成を追記。記述の調整。
2006/2/11sat ページ作成。

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Wiki内検索

編集にはIDが必要です