[[meta copyright="Copyright © 2007 Free Software Foundation, Inc."]] [[meta license="Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled [[GNU_Free_Documentation_License|/fdl]]."]] Creating a bootable qemu image from a root filesystem and bootloader 1. Create a hard disk image
qemu-img create -f qcow2. Use a live CD (better to have a lighter OS like system rescue CD to make the process faster) and the image created to boot.G
qemu -cdrom /dev/cdrom -hda3. Once system is booted use a partition editing tool (like fdisk, cfdisk, parted, gparted, qtparted ...) to partition the image.-boot d
cfdiskcreate the necessary partitions (root and swap partitions boot, home ... if required) 4. Create a file syatem for the root partiotion
mke2fs /dev/hda15. Mount the partition
mkdir disk mount /dev/hda1 disk6. Copy the file system from the host machine to the mounted directory (use a compressed file system to make the copying faster) Grab the GNU spapshot from ams' site
scp7. Uncompress the files@ : disk
cd disk tar -jxvf8. Unmount the mounted partition
cd .. umount disk9. power off the guest OS.
poweroff10. To make the file syatem bootable download a grub floppy image ([[http://hurd.in/pub/Hurd/HurdOnVMware/grub.img][grub.img]]) 11. Run qemu to boot into your brand new system
qemu -hdaHappy Hacking !! Make your new system boot from the hard disk 1. Mount your grub image-fda grub.img -boot a
mkdir floppy mount -t ext2 -o loop grub.img floppy2. Use previous steps 2 and 5 to boot from a liveCD and mount the partition
cd disk/boot scp -r3. Poweroff the guest@ : /boot/grub .
poweroff4. Boot new system using floppy image previous step 11 use install to hard disk option if you used the above grub image or go to grub command line and type
root (hd0,0) setup (hd0)Now you have a bootable system image. Enjoy Maadi !! -- PraveenA - 21 Jun 2006