Saturday, November 01, 2008

qemu试用

最近学习memtest86, 故需要一台主机作为测试. 自然想到了qemu. 说实话以前还没怎么用过虚拟机软件. 所以还是感觉到新鲜的.

创建硬盘:
qemu-img create -f qcow2 c.img 3G

从cd-rom启动:
qemu -cdrom /dev/cdrom -hda c.img -m 256 -boot d
从iso启动:
qemu -cdrom my_os_install.iso -hda c.img -m 256 -boot d

直接启动整个主机的linux 系统:
sudo qemu -kernel /boot/vmlinuz-2.6.25-14.fc9.i686 -initrd /boot/initrd-2.6.25-14.fc9.i686.img -hda /dev/sda -append "ro root=UUID=b53ebbb4-dc5e-4b04-b88b-93f5c892bb29 rhgb quiet"
警告:
WARNING: unless you know what you do, it is better to only make READ-ONLY accesses to the hard disk otherwise you may corrupt your host data (use the `-snapshot' command line option or modify the device permissions accordingly).

run memtest86 under qemu:
http://www.coreboot.org/Memtest86

2 comments:

duansainan said...

Am i your first reader? Excited,but it is a pity that i cannot understand the technical information.Anyway, Blog is a good way to record something in your work and life. Move on!

dyverin said...

Thanks for your encouragement, my elder Sister.