|
|
|
|
|
|
|
|
|
|
tcpdumpの結果をWiresharkで読み込む
|
|
|
|
|
|
|
|
coLinuxイメージ作成(CentOS5) 準備する物 - WindowsXP環境
- ddコマンド(cygwinなり別のLinux環境なり)
- CentOSのDVDイメージ
- QEMU+Kqemu
イメージファイルの作成 ddコマンドで作成してもいいが、WindowsXPにもrawファイルの作成機能が あるらしいのでそれを使ってみる
C:\> fsutil file createnew d:\coLinux\centos5_i386.img 10737418240 C:\> fsutil file createnew d:\coLinux\swap.img 536903168
CentOS 5.0のインストール c:\qemu\qemu.exe -hda d:/coLinux/centos5_i386.img -hdb d:/coLinux/swap.img -cdrom d:/CentOS-5.0-i386-bin-DVD.iso -m 512 -boot d -L c:\qemu インストール内容は以下の通り。また、インストール完了後はAlt+Ctrl+2で QEMUのプロンプト状態としたうえでquitする
・ディスク情報 hda1 => ext3, /boot, 100MB hda2 => ext3, /, 約10GB hdb1 => -, swap, 512MB ・ネットワーク情報 Host : centos5 IP : 192.168.0.2 Mask : 255.255.255.0 GW : 192.168.0.1 DNS : 192.168.0.1 ・パッケージ情報 下記のパッケージ以外を全て削除 ・言語-日本語のサポート
CentOS 5.0のcoLinuxイメージ化 インストールが完了したCentOSイメージをQEMUで起動し直す
C:\> c:\qemu\qemu.exe -hda d:\coLinux\centos5_i386.img -hdb d:\coLinux\swap.img -m 512 -L c:\qemu QEMUのコンソールからログインしてcobdデバイスを作成する
# for i in 1 2 3 4 5 6 7 8 9; do mknod /dev/cobd${i} b 117 ${i}; done # shutdown -h now ddコマンドでCentOSイメージのMBR(63セクタ)を切り取る
# dd if=/path/to/centos5_i386.img of=/path/to/centos5_i386.img count=1 skip=63
CentOS 5.0の初期設定 適当にcoLinuxの設定をして起動する(以下はconfファイルと起動用バッチファイルの例) C:\Program Files\coLinux\centos5.conf
kernel=vmlinux cobd0="d:\coLinux\centos5_i386.img" cobd1="d:\coLinux\swap.img" root=/dev/cobd0 fastboot initrd=initrd.gz mem=512 eth0=tuntap C:\Program Files\coLinux\centos5.bat
cd "c:\Program Files\coLinux" colinux-daemon.exe @"centos5.conf" coLinuxのコンソール上で各種設定を行う
エラー回避
# mv /bin/setfont /bin/setfont.orig # vi /bin/setfont ======================================================================= #!/bin/bash
exit 0 ======================================================================= # chmod 755 /bin/setfont
# mv /sbin/hwclock /sbin/hwclock.orig # vi /sbin/hwclock ======================================================================= #!/bin/bash
exit 0 ======================================================================= # chmod 755 /sbin/hwclock 不要なサービスの停止
# chkconfig haldaemon off # chkconfig ip6tables off # chkconfig iptables off # chkconfig kudzu off # chkconfig mcstrans off # chkconfig messagebus off # chkconfig netfs off # chkconfig restorecond off # chkconfig xfs off SELinuxの無効化
# vi /etc/selinux/config ======================================================================= (省略) SELINUX=disabled (省略) ======================================================================= ネットワーク設定
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 ======================================================================= DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.0.2 NETMASK=255.255.255.0 NETWORK=192.168.0.0 BROADCAST=192.168.0.255 TYPE=Ethernet =======================================================================
# vi /etc/resolv.conf ======================================================================= nameserver 192.168.0.1 ======================================================================= Yumレポジトリ設定
# vi /etc/yum.repos.d/CentOS-Base.repo ======================================================================= [base] name=CentOS-$releasever - Base #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os baseurl=http://ftp.riken.jp/Linux/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[updates] name=CentOS-$releasever - Updates #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates baseurl=http://ftp.riken.jp/Linux/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[addons] name=CentOS-$releasever - Addons mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons #baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 enabled=0
[extras] name=CentOS-$releasever - Extras mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 enabled=0
[centosplus] name=CentOS-$releasever - Plus mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 enabled=0
[contrib] name=CentOS-$releasever - Contrib mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib #baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 enabled=0 =======================================================================
# rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
# vi /etc/yum.conf ======================================================================= (省略) exclude=kernel kernel-smp ======================================================================= その他の設定
# vi /root/.bashrc ======================================================================= if [ -f /etc/bashrc ]; then . /etc/bashrc fi =======================================================================
# vi /etc/securetty ======================================================================= console tty1 ttyS0 =======================================================================
# vi /etc/sysctl.conf ======================================================================= kernel.sysrq = 0 kernel.core_uses_pid = 1 kernel.msgmax = 65536 kernel.msgmnb = 65536 kernel.msgmni = 1024 kernel.sem = 1000 32000 100 512 kernel.shmall = 268435456 kernel.shmmax = 4294967295 kernel.shmmni = 8192 fs.file-max = 262144 net.core.wmem_max = 262144 net.core.wmem_default = 262144 net.core.rmem_max = 262144 net.core.rmem_default = 262144 net.core.optmem_max = 20480 net.ipv4.icmp_echo_ignore_broadcasts = 1 net.ipv4.ip_forward = 0 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_max_syn_backlog = 8192 net.ipv4.conf.default.accept_source_route = 0 net.ipv4.conf.default.rp_filter = 1 =======================================================================
# vi /etc/inittab ======================================================================= id:3:initdefault: si::sysinit:/etc/rc.d/rc.sysinit l0:0:wait:/etc/rc.d/rc 0 l1:1:wait:/etc/rc.d/rc 1 l2:2:wait:/etc/rc.d/rc 2 l3:3:wait:/etc/rc.d/rc 3 l4:4:wait:/etc/rc.d/rc 4 l5:5:wait:/etc/rc.d/rc 5 l6:6:wait:/etc/rc.d/rc 6 pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down" pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled" 1:2345:respawn:/sbin/mingetty tty1 =======================================================================
# vi /etc/pam.d/login ======================================================================= #%PAM-1.0 auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so auth include system-auth account required pam_nologin.so account include system-auth password include system-auth session required pam_selinux.so close session include system-auth session required pam_loginuid.so session optional pam_console.so session required pam_selinux.so open session optional pam_keyinit.so force revoke session required pam_limits.so =======================================================================
# vi /etc/security/limits.conf ======================================================================= * soft nofile 65536 * hard nofile 65536 * soft nproc 16386 * hard nproc 16386 =======================================================================
Windowsサービス化 coLinuxが停止していることを確認した上で、以下のコマンドを発行
colinux-daemon.exe @"centos5.conf" --install-service coLinux
[参考] ・coLinux-Wiki ・coLinux-インストール
|
|
|
|
|