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文件:
  • centos-livecd-minimal.ks: a minimalistic LiveCD
    centos-livecd-desktop.ks: the CentOS LiveCD
    可通过到官网https://projects.centos.org/trac/livecd/查看具体操作及内容下载
  • 首先在系统中创建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 阅读(2471) 评论(0)  编辑  收藏 所属分类: CentOS

    只有注册用户登录后才能发表评论。


    网站导航: