The NoteBook of EricKong

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            611 Posts :: 1 Stories :: 190 Comments :: 0 Trackbacks

          Windows 下直接運行 Linux的Live CD版的方法

                一個偶然的機會,我發現.Live CD 版的Linux可以借助 qume在Windows下直接運行;方法是下載linux-tr127 下載地址http://www.orsoon.com/down.asp?id=1372&downid=8實 際上這個軟件包是由tr127 用qume這個虛擬機制作的可在Windows下運行的虛擬Linux ;下載這個壓縮包,解壓之后可單擊linux.bat這個文件,就可直接運行虛擬的Linux;但是這個自帶的Linux功能太有限了.下面就是對它的改 造---偷天換日.你會發現在linux-tr127這個目錄下有一個iso文件,它就是一個linux live cd的鏡像文件,我們可以用其它linux發行版的Live CD版本的iso鏡像文件替換這個iso文件的功能,來運行其它你喜歡的Linux版本,具體做法如下:
          1.下載其它linux發行版的Live CD版本的iso鏡像文件,這有個地址:
          ftp://ftp.bioinformatics.org/pub/dnalinux/dna50p.iso
          2.用文本編輯器打開linux.bat其內容如下:
          REM Start qemu on windows.
          @ECHO OFF

          START qemu.exe -L . -m 128 -cdrom dsl.iso -enable-audio -localtime -user-net

          CLS
          EXIT
          3. 這一步我們要做的就是,把dsl.iso換成你下載的iso文件名;如果你下載的iso文件在其它盤里也沒關系,NTFS格式的盤也行.只要把路徑加上就 行了,例如你的iso是c盤的TDdownload目錄下的dna50p.iso那么你就用c:\TDdownload\dna50p.iso替換 dsl.iso
          4.接下來就可以直接雙擊linux.bat運行你linux了
          我試了兩個版本的linux live cd 都沒問題.


             這種方法是我遇到的在Windows下學習Linux的最簡單的方法,比用VMware ,virtual pc來虛擬Linux要方便的多的多了.省去安裝,特別是對新手來說,用此方法來學習Linux的門檻更低了.

          2以下是 制作livecd的方法

          我說的5步指5個步驟:
          1). 系統環境準備;
          2). 安裝LiveCD創建工具;
          3). 創建LiveCD ISO;
          4). 把LiveCD ISO復制到存儲器中,例如DVD,U盤;
          5). 測試
          開始之前,首先我們要了解LiveCD創建工具是怎樣工作的:
          In a nutshell, the livecd-creator program    

          * Sets up a file for the ext3 file system that will contain all the data comprising the live CD   
          * Loopback mounts that file into the file system so there is an
          installation root    
          * Bind mounts certain kernel file systems (/dev, /dev/pts, /proc, /sys, /selinux) inside the installation root   
          * Uses a configuration file to define the requested packages and
          default configuration options. The format of this file is the same as is used for installing a system via kickstart.   
          * Installs, using yum, the requested packages into the installation
          using the given repositories    
          * Optionally runs scripts as specified by the live CD configuration
          file.    
          * Relabels the entire installation root (for SELinux)    
          *Creates a live CD specific initramfs that matches the installed
          kernel    
          * Unmounts the kernel file systems mounted inside the installation
          root    
          * Unmounts the installation root    
          * Creates a squashfs file system containing only the ext3 file
          (compression)    
          * Configures the boot loader    
          * Creates an iso9660 bootable CD 
          第1步,安裝系統環境:
          CentOS 5.2 Linux
          第2步,安裝LiveCD創建工具:
          編輯/etc/yum.repos.d/centos-livecd.repo,加入如下的內容:
          # Name: CentOS LiveCD repository 
          [livecd] 
          name = CentOS $releasever - LiveCD 
          baseurl = http://www.nanotechnologies.qc.ca/propos/linux/centos-live/$basearch/live
          enabled=1 
          protect=0 
          gpgkey = http://www.nanotechnologies.qc.ca/propos/linux/RPM-GPG-KEY-PGuay 
          保存之后,就可以使用yum來安裝必須的LiveCD創建工具了:
          # yum install livecd-tools syslinux anaconda-runtime 
          第3步,創建LiveCD ISO,我們需要編輯kickstart配置文件,附件中有兩個參考的kickstart文件:
        1. centos-livecd-minimal.ks: a minimalistic LiveCD
          centos-livecd-desktop.ks: the CentOS LiveCD
          可通過到官網https://projects.centos.org/trac/livecd/查看具體操作及內容下載
        2. 首先在系統中創建LiveCD creator的工作目錄:

           

          # mkdir /server/livecd 
          # cd /server/livecd

           

          把下載的ks-configure-file保存到目錄/server/livecd中,下面就可以創建liveCD ISO了:

           

          # LANG=C livecd-creator --config=centos-livecd-minimal.ks --fslabel=CentOS-5.4-minimal

           

          成功后,就會產生一個CentOS-5.4-minimal.iso的文件.

           

          第4步,把LiveCD復制到USB中:

          插入你的U盤,當系統自動mount你的U盤后,檢查你的U按mount的位置

           

          # LANG=C df -h 
          Filesystem                        Size    Used Avail Use% Mounted on 
          /dev/sda7                            25G    8.5G     15G    37% / 
          /dev/sda1                            99M     18M     76M    20% /boot 
          tmpfs                                1013M         0 1013M     0% /dev/shm 
          /dev/sdb1                         982M    8.0K    982M     1% /media/usbdisk 

           

          開始復制:

          # livecd-iso-to-disk CentOS-5.4-x86_64-LiveCD.iso /dev/sdb1 
          Verifying image... 
          /tmp/CentOS-5.4-x86_64-LiveCD.iso:     ad63c0a54086eb35e892d6e1292085e3 
          Fragment sums: 9e363badf4e9359c76ce8e324bdbd82847bed2dcc8e7e22ecbb2ddda2621 
          Fragment count: 20 
          Percent complete: 100.0%     Fragment[20/20] -> OK 
          100.0 
          The supported flag value is 0 
          The media check is complete, the result is: PASS. 

          It is OK to install from this media. 
          Already set up as live image.    Deleting old in fifteen seconds... 
          Copying live image to USB stick 
          Updating boot config file 
          Installing boot loader 
          USB stick set up as live image! 

           

          第5步,測試:插入U盤,重啟電腦,選擇U盤啟動.

           

          如果使用Wimdows的朋友,請參考:http://www.pendrivelinux.com/usb-centos-5-live-install-via-windows/

          posted on 2013-06-23 19:00 Eric_jiang 閱讀(2561) 評論(0)  編輯  收藏 所屬分類: CentOS
          主站蜘蛛池模板: 酒泉市| 晋中市| 兰州市| 兴业县| 天全县| 海阳市| 吉林市| 舟曲县| 嘉祥县| 那坡县| 屯昌县| 双江| 藁城市| 含山县| 都昌县| 那坡县| 屯昌县| 尖扎县| 高淳县| 合阳县| 南通市| 毕节市| 通榆县| 阿尔山市| 嫩江县| 二连浩特市| 基隆市| 乌鲁木齐县| 黄大仙区| 沂水县| 汾阳市| 晋江市| 峨山| 江陵县| 盐津县| 苏尼特右旗| 桂阳县| 福海县| 临城县| 岳西县| 宜城市|