2012年11月14日

Debian 6.0.1 squeez on colinux 0.79 with Windows7 starter


まず、操作を楽にするため、wget を以下からもってくる。

WGET for Windows (win32) - http://users.ugent.be/~bpuype/wget/


なお、

Wget for Windows
http://gnuwin32.sourceforge.net/packages/wget.htm

からもってくると、インストーラーから入れなければならなかったり、dll を
別途用意しなければならなかったりして、面倒。

保存先を聞かれるので、保存(以下では、c:\User\clothoid\download に保存
したとする)



コマンドプロンプトを管理者権限で起動。

- Windows スタート:[プログラムとファイルの検索]に[cmd]と入力
- コマンドプロンプトが自動で検出される
- 右クリック:[管理者として実行]を選択



続いて、colinux をダウンロード。

Cooperative Linux
http://www.colinux.org/

=====
C:\Windows\system32>cd c:\Users\clothoid\Downloads
c:\Users\clothoid\Downloads>wget "http://downloads.sourceforge.net/project/colin
ux/coLinux-stable/0.7.9-linux-2.6.33.7/coLinux-0.7.9.exe?r=http%3A%2F%2Fsourcefo
rge.net%2Fprojects%2Fcolinux%2Ffiles%2FcoLinux-stable%2F0.7.9-linux-2.6.33.7%2Fc
oLinux-0.7.9.exe%2Fdownload&ts=1347979819&use_mirror=netcologne"
=====

同サイトの Debian-6.0.1-squeeze.7z をダウンロード。

=====
wget "http://downloads.sourceforge.net/project/colinux/Images%202.6.x%20Debian/Debian%206.0%20Squeeze/Debian-6.0.1-squeeze.7z?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fcolinux%2Ffiles%2FImages%25202.6.x%2520Debian%2FDebian%25206.0%2520Squeeze%2F&ts=1352245444&use_mirror=garr"
=====

7zip をダウンロード。

7-Zipのホームページ(日本語)
http://sevenzip.sourceforge.jp/

=====
wget "http://sourceforge.jp/frs/g_redir.php?m=jaist&f=%2Fsevenzip%2F7-Zip%2F9.20%2F7z920.msi"
c:\Users\clothoid\Downloads>wget "http://sourceforge.jp/frs/g_redir.php?m=jaist&
f=%2Fsevenzip%2F7-Zip%2F9.20%2F7z920.msi"
=====

7zip をインストール。

=====
c:\Users\clothoid\Downloads>msiexec /i 7z920.msi /passive /norestart
=====

colinux の本体をインストールします。

=====
c:\Users\clothoid\Downloads>coLinux-0.7.9.exe
=====

インストーラーが起動するので、[NEXT] を選択



続いて、[I Agree] をクリック


[Root Filesystem image Download] のチェックを外して、[Next]をクリック



インストール先を半角英数字の含まない場所、例えば、c:\colinux に変更して、
[Next]をクリック



WinPCAP を入れようよと言われるけど、後で考えるから無視して、[Next]をク
リック



ファイルの展開が始まる



途中で、[Windows セキュリティ]が起動してインストールの有無を問われるこ
とがある(一度、colinux か andlinux をインストールしていると出ないみたい。
というか、Tap-Win32 のアンインストールが colinux あるいは andlinux のア
ンインストーラーでは正常にできていない事があるぽっい。んでもって、別途
ちゃんとアインインストールする方法も分からない) ので、[このドライバーソ
フトウェアをインストールします(I)] を選択する



[Finish] を押して終了




コマンドプロンプトに戻るので、イメージファイルを展開する

=====
c:\Users\clothoid\Downloads>cd c:\coLinux
c:\coLinux>"c:\Program Files\7-Zip\7z.exe" x c:\Users\clothoid\Downloads\Debian-
6.0.1-squeeze.7z
=====

これでインストールが完了したはずなので、起動してみる。

=====
c:\coLinux>squeeze.bat
=====

最初、root パス無しに設定されているので、そのままログインし、パスワード
を設定しておく。

======
Debian GNU/Linux 6.0 debian tty1

debian login: root
Last login: Wed Nov  7 00:12:33 UTC 2012 on tty1
Linux debian 2.6.33.7-co-0.7.9 #1 PREEMPT Sat Apr 9 20:30:51 UTC 2011 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.
root@debian:~# passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
=====

また、通信テストして、OK を確認。

=====
root@debian:~# mkdir tmp
root@debian:~# cd tmp/
root@debian:~/tmp# wget www.google.com
=====

そのままパッケージリストを新しくして (apt-get update)、そのまま更新を行
なう(apt-get upgrade)。

=====
root@debian:~# apt-get update;apt-get upgrade
Get:1 http://ftp.debian.org squeeze Release.gpg [1672 B]
Ign http://ftp.debian.org/debian/ squeeze/main Translation-en
Get:2 http://ftp.debian.org squeeze Release [99.8 kB]
Get:3 http://ftp.debian.org squeeze/main i386 Packages [8635 kB]
Fetched 8736 kB in 11s (758 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
The following packages will be upgraded:
  apt apt-utils aptitude base-files debian-archive-keyring dpkg e2fslibs
  e2fsprogs initscripts isc-dhcp-client isc-dhcp-common libbz2-1.0 libc-bin
  libc6 libcomerr2 libpam-modules libpam-runtime libpam0g libss2 libssl0.9.8
  module-init-tools perl-base procps sysv-rc sysvinit sysvinit-utils tzdata
27 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 21.1 MB of archives.
After this operation, 45.1 kB of additional disk space will be used.
Do you want to continue [Y/n]?
=====

リストが新しくなると継続するか聞かれるので、Yを入力して、進めて、しばら
くすると終わる。

ssh もいれておく

=====
root@debian:~# apt-get install ssh
=====

続いて、日本語キーボードの設定を以下のコマンドと、キャプチャどおりに行
う。

=====
root@debian:~# apt-get install console-tools console-data
=====









で、設定ファイルをいぢくるんだけど、
emacs が無いと仕事できないよーう。vi 分からないよーう。

=====
root@debian:~# apt-get install emacs
=====

で、インストールして、起動

Windows から ssh を使用して、アクセスできるように、設定する。

interfaces を編集。

=====
*** /etc/network/interfaces.orig        Wed Nov  7 01:26:41 2012
--- /etc/network/interfaces     Wed Nov  7 01:27:18 2012
***************
*** 4,6 ****
--- 4,10 ----
  iface lo inet loopback
  auto eth0
  iface eth0 inet dhcp
+ auto eth1
+ iface eth1 inet static
+ address AAA.AAA.AAA.AAA
+ netmask CCC.CCC.CCC.CCC
=====

hosts を編集。

=====
*** /etc/hosts.orig     Wed Nov  7 01:25:42 2012
--- /etc/hosts  Wed Nov  7 01:38:00 2012
***************
*** 1,4 ****
--- 1,5 ----
  127.0.0.1     localhost
+ AAA.AAA.AAA.AAA     colinux
  ::1           localhost ip6-localhost ip6-loopback
  fe00::0               ip6-localnet
  ff00::0               ip6-mcastprefix
=====

マウントポイント用ディレクトリを作成

=====
root@debian:~# mkdir /mnt/win
=====

colinux 起動時に自動マウントするように設定。

=====
root@debian:~# emacs /etc/fstab
=====

fstab を編集。

=====
*** /etc/fstab.orig     Wed Nov  7 01:42:45 2012
--- /etc/fstab  Wed Nov  7 01:43:47 2012
***************
*** 1,4 ****
--- 1,5 ----
  # UNCONFIGURED FSTAB FOR BASE SYSTEM
  proc          /proc   proc    defaults        0       0
+ cofs0         /mnt/win        cofs            uid=colinux,gid=colinux 0 1
  /dev/cobd0    /       ext3    defaults        0       1
  /dev/cobd1    none    swap    sw              0       0
=====

ssh でアクセスするためのユーザーを作成。

=====
root@debian:~# adduser sshtestusr
Adding user `sshtestusr' ...
Adding new group `sshtestusr' (1000) ...
Adding new user `sshtestusr' (1000) with group `sshtestusr' ...
Creating home directory `/home/sshtestusr' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for sshtestusr
Enter the new value, or press ENTER for the default
        Full Name []: sshtestusr user
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n] Y
=====

一旦、終了。

=====
root@debian:~# halt
=====

WinTap を設定する。

Windows スタート > [プログラム] > [コントロールパネル]



[ネットワークとインターネット]




[ネットワークと共有センター]



[アダプター設定の変更]



[デバイス名]に[TAP-Win32 Adapter V8 colinux]と書いてあるものを右クリッ
クして、プロパティを選択



[インターネット プロトコル バージョン 4 (TCP/IP v4)]を選択し、[プロパ
ティ]を選択。



[次の IP アドレスを使う]を選択し、[ IP アドレス] に [ BBB.BBB.BBB.BBB ]、[サブ
ネットマスク]に、[CCC.CCC.CCC.CCC]を入力して、[ OK ]を選択。



squeeze.conf をに追記。

=====
*** c:/coLinux/squeeze.conf.orig 2012-11-07 10:57:09.704620300 +0900
--- c:/coLinux/squeeze.conf 2012-11-14 11:29:25.803692300 +0900
***************
*** 6,8 ****
--- 6,10 ----
  initrd=initrd.gz
  mem=128
  eth0=slirp
+ eth1=tuntap
+ cofs0=C:\coLinuxMnt
=====

cmd に戻って、マウント用ディレクトリを作成し、Linux を起動

=====
c:\coLinux>mkdir -p c:\coLinuxMnt
c:\coLinux>squeeze.bat
=====

eth1 を確認

=====
root@debian:~# ifconfig

eth0      Link encap:Ethernet  HWaddr DD:DD:DD:DD:DD:DD
          inet addr:EE.E.E.EE  Bcast:FF.F.F.FFF  Mask:CCC.CCC.CCC.CCC
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:773 (773.0 B)  TX bytes:450 (450.0 B)
          Interrupt:10

eth1      Link encap:Ethernet  HWaddr GG:GG:GG:GG:GG:GG
          inet addr:AAA.AAA.AAA.AAA  Bcast:BBB.BBB.BBB.BBB  Mask:CCC.CCC.CCC.CCC
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:142 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:15090 (14.7 KiB)  TX bytes:0 (0.0 B)
          Interrupt:10

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
 RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
=====

マウントを確認

=====
root@debian:~# mount

/dev/cobd0 on / type ext3 (rw)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
cofs0 on /mnt/win type cofs (rw,uid=1000,gid=1000)
=====

これで、自Win から、ssh 接続できる。

=====
ssh sshtestuser@AAA.AAA.AAA.AAA
=====

さて、色周りをどうするか。せめて、256にしたいが、大変そう。。。
何もしないでいけた。

0 件のコメント:

コメントを投稿