Linux (Ubuntu) in Windows #2 coLinux

วิธีติดตั้ง Linux ใน Windows ด้วย coLinux
1.อันดับแรกก็ Download สิ่งที่จำเป็นสำหรับใช้งาน coLinux
Cooperative Linux is the first method for optimally running Linux on Windows and other operating systems natively. It is a port of the Linux kernel and support code that allows it to run cooperatively without emulation along with another operating system

โดย download ได้จาก sourceforge ซึ่งต้องใช้ 2 ตัว คือ
- ตัวโปรแกรม coLinux คือ coLinux-stable ของผมเลือกรุ่น 0.7.3-linux-2.6.22.18 (coLinux-0.7.3.exe)
- Image ของ Linux ผมลอง 2 ตัว คือ
* Images 2.6.x Debian รุ่น Debian 4.0 Etch (Debian-4.0r0-etch.ext3.1gb.bz2)
* Images 2.6.x Ubuntu เป็น Ubuntu 7.10 (Ubuntu-7.10.ext3.2GB.7z)

พอ Download เสร็จก็แตกไฟล์ด้วย 7-Zip จะได้ไฟล์ขนาด 1GB สำหรับ Debian และ 2GB สำหรับ Ubuntu

2.ต่อไปก็ติดตั้ง coLinux ซึ่งวิธีการก็ไม่ยาก คลิก Next ไปเรื่อย ๆ หน้าที่เลือก Component ก็เลือกไปทั้งหมดเลย
ส่วนตำแหน่งที่จะติดตั้ง เค้าแนะนำให้ติดตั้งที่ C:\coLinux
ระหว่างติดตั้งก็จะบอกให้ติดตั้ง WinPcap ด้วย ก็ download มาติดตั้งซะ

WinPcap: The Windows Packet Capture Library
WinPcap is the industry-standard tool for link-layer network access in Windows environments: it allows applications to capture and transmit network packets bypassing the protocol stack, and has additional useful features, including kernel-level packet filtering, a network statistics engine and support for remote packet capture.

WinPcap consists of a driver, that extends the operating system to provide low-level network access, and a library that is used to easily access the low-level network layers. This library also contains the Windows version of the well known libpcap Unix API.


ส่วนหน้าที่จะให้ Download root file system image ก็ไม่ต้อง เพราะเรา download มาแล้ว

3.พอติดตั้งเสร็จก็เอา Image ของ Linux ที่แตกไฟล์ออกมาแล้วไปไว้ใน C:\coLinux แล้วก็ copy ไฟล์ example.conf มาเปลี่ยนชื่อเป็น debian4.conf แล้วก็เปิดไฟล์ขึ้นมาแก้ไข
เริ่มจาก debian4.conf
kernel=vmlinux
cobd0="c:\coLinux\Debian-4.0r0-etch.ext3.1gb"
root=/dev/cobd0
ro
initrd=initrd.gz
eth0=slirp


แล้วก็ลอง boot ดู โดยเรียกคำสั่งจาก cmd
c:\coLinux> colinux-daemon.exe @debian4.conf

ได้ผลดังรูปครับ


ลอง login ด้วย username = root และ password = root
ลองคำสั่ง uname -a


แล้วก็พิมพ์คำสั่ง ifconfig


จะเห็นว่า eth0 ได้ IP เป็น 10.0.2.15 เปิดดูไฟล์ /etc/network/interfaces ก็จะเห็นเพิ่มเติมว่า
ipaddress 10.0.2.15
broadcast 10.0.2.255
netmask 255.255.255.0
gateway 10.0.2.2


ลอง ping ดูเครื่อง localhost


ทดลองใช้คำสั่ง apt-get update ดู ปรากฏว่าออก internet ได้ด้วย


ออกจากโปรแกรมด้วยคำสั่ง halt แล้วไปลอง Ubuntu กันบ้าง

4.สำหรับ Ubuntu ก็ copy ไฟล์มา แต่คราวนี้เปลี่ยนชื่อเป็น ubuntu7.10.conf โดยใส่เนื้อหาตามนี้
kernel=vmlinux
cobd0="c:\coLinux\Ubuntu-7.10.ext3.2gb.fs"
cobd1="c:\coLinux\swap128.fs"
root=/dev/cobd0
ro
initrd=initrd.gz
eth0=slirp

สังเกตว่าจะมีเพิ่ม swap file เข้ามาด้วย

c:\coLinux> colinux-daemon.exe @ubuntu7.10.conf

แล้วก็ลองเหมือนที่ทำกับ debian พบว่าเหมือนกันเลย ยกเว้น uname -a (ซึ่งมันต้องเป็นอย่างนั้นอยู่แหล่ะ :))


5.ปิดท้ายด้วยเทคนิคเล็ก ๆ เอาไว้เรียกใช้ให้สะดวก คือ
สร้าง Shortcut ไว้ที่ Desktop โดยตั้งชื่อไว้เป็น Debian4 กับ Ubuntu 7.10
แล้วก็เปิด Properties ของแต่ละตัว โดยกำหนด Start in เป็น C:\coLinux แล้วก็ พิมพ์ "@ชื่อไฟล์ config" ต่อท้ายในช่อง Target
เช่น C:\coLinux\colinux-daemon.exe "@ubuntu7.10.conf" สำหรับ Ubuntu
และ C:\coLinux\colinux-daemon.exe "@debian4.conf" สำหรับ Debian4
เวลาจะใช้งานก็ double click เรียกใช้ได้เลย สะดวกดีครับ

Comments

Popular posts from this blog

Artillery Hornet + OctoPrint + Klipper

ย้ายบ้าน

ใต้ร่มกาสาวพัตร