登录 用户中心() [退出] 后台管理 注册
   
您的位置: 首页 >> 程序员学前班[不再更新,只读] >> 主题: 用 qemu 建立自己的 colinux img 文件     [回主站]     [分站链接]
标题
用 qemu 建立自己的 colinux img 文件
clq
浏览(0) + 2010-05-22 13:30:39 发表 编辑

关键字:

http://www.virtual-clouds.com/2009/02/54/yet-another-colinux-instructions/
clq
2010-5-22 13:32:22 发表 编辑

yet another colinux instructions


i hope this is my last post on colinux and erlang, but although i had written several time about it, i will do it once more, to sum up a little guide to setup a new colinux with the correct way to set erlang on it. i also added few words on adding the nitrogen web framework.

> is used for windows command prompt
$ is used for linux shell prompt

ubuntu 8.04 server

qemu

  • direct download – http://www.h6.dion.ne.jp/~kazuw/qemu-win/qemu-0.9.0-windows.zip
  • extract qemu into a new directory c:\linux\qemu
  • start windows command prompt
  • make a 3gb image:
     > fsutil file createnew c:\linux\distro\qemu_ubuntu_3gb 3221257728
  • make a image for a 512mb swap file:
     > fsutil file createnew c:\linux\distro\qemu_swap_512mb 536903168
  • on c:\linux\qemu create the next batch file: install.bat, whith the following content:
    @ECHO OFF
    set qemu_dir=C:\linux\distro
    set hd=%qemu_dir%\qemu_ubuntu_3gb
    set swap=%qemu_dir%\qemu_swap_512mb
    set cdrom=%qemu_dir%\ubuntu-8.04.2-server-i386.iso
    set mem=384
    qemu -hda %hd% -hdb %swap% -cdrom %cdrom% -m %mem% -boot d -L .
    pause
  • run the batch file you have just created: install.bat
  • go through the linux installation, select manually partition when asked, and do the following:
    • create new partitionchoose /dev/sda
    • choose create as: primary partition
    • choose file system: ext3
    • create new partitionchoose /dev/sdb
    • choose create as: primary partition
    • choose file system: linux-swap
  • install, and when you get to the point it asks for restart – you have finished. it takes some time, so be patient.

colinux

  • direct download – http://downloads.sourceforge.net/colinux/coLinux-0.7.3.exe
  • run and install on c:\colinux
  • don’t use or download any of the suggested distributions on the install process
  • download and install unxutils – http://gnuwin.epfl.ch/apps/unxutils/en/install/
  • convert qemu ubuntu image to colinux image
     > cd c:\linux\distro
    > dd if=qemu_ubuntu_3gb of=ubuntu_3gb.img bs=512 skip=63
  • you only need the file ubuntu_3gb.img the other 2 files (qemu_swap_512mb and qemu_ubuntu_3gb) can be removed
  • create new swap file:
     > fsutil file createnew c:\linux\distro\swap_512mb 536870912
  • create a file on c:\linux\distro named ubuntu8.04.conf, and paste the following into it:
    kernel=vmlinux
    sda1="c:\linux\distro\ubuntu-8.04.2-server-i386.ext3.3gb.img"
    sdb1="c:\linux\distro\swap_512mb"
    root=/dev/sda1 fastboot 3
    ro
    mem=384
    eth0=slirp
    eth1=tuntap
  • create a shortcut for colinux-daemon.exe, right click on it and edit its properties, to add the following parameters (on the shortcut target field):
    c:\colinux\colinux-daemon.exe -t nt @c:\linux\distro\ubuntu8.04.conf
  • start this new shortcut, running the colinux the first time
  • edit /etc/network/interfaces and the windows tap connection, see my previous post named colinux
  • install ssh and update:
    $ sudo apt-get install ssh
    $ sudo apt-get update
    $ sudo apt-get upgrade
    $ chsh -s /bin/bash user_name
  • connect using putty to 192.168.37.20:22

compress and backup the colinux image

  • to determine the free space in megabytes
    $ df -m
  • fill image with zeros
    $ dd if=/dev/zero of=foobar bs=1M count='above result less 5'
    $ rm foobar
  • logout, and compress from windows using a compression app, should get around 100MB file

install erlang from source

$ sudo apt-get install build-essential
$ sudo apt-get install libncurses5-dev
$ sudo apt-get install m4
$ sudo apt-get install libssl-dev
$ sudo apt-get install openssl
 
$ cd; mkdir workspace; cd !
$ wget http://www.erlang.org/download/otp_src_R12B-5.tar.gz
$ tar xvfz otp_src_R12B-5.tar.gz
$ cd otp_src_R12B-5
$ ./configure
$ make
$ sudo make install

install some basics

$ sudo apt-get install git subversion ctags vim

setup environment

edit .bash_profile, and add the following at the bottom

export ERL_LIBS=${HOME}/erlang/lib

download and install nitrogen

$ cd; mkdir -p erlang/lib; cd !$
$ git clone git://github.com/rklophaus/nitrogen.git
$ cd nitrogen
$ make

done


clq
2010-5-22 13:33:37 发表 编辑

本质上就是用 dd 命令转换 qemu 的 img 为 colinux 的 img


总数:2 页次:1/1 首页 尾页  
总数:2 页次:1/1 首页 尾页  


所在合集/目录



发表评论:
文本/html模式切换 插入图片 文本/html模式切换


附件:



NEWBT官方QQ群1: 276678893
可求档连环画,漫画;询问文本处理大师等软件使用技巧;求档softhub软件下载及使用技巧.
但不可"开车",严禁国家敏感话题,不可求档涉及版权的文档软件.
验证问题说明申请入群原因即可.

Copyright © 2005-2020 clq, All Rights Reserved
版权所有
桂ICP备15002303号-1