WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

[Xen-users] micro HOWTO build an HVM able image in one file

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] micro HOWTO build an HVM able image in one file
From: Goran Vukoman <xen-list@xxxxxxxx>
Date: Sun, 17 Jun 2007 19:07:49 +0200
Delivery-date: Sun, 17 Jun 2007 10:05:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
#
# create image file
#

        dd if=/dev/zero of=hd.img bs=8225280 count=64
        losetup /dev/loop0 hd.img

        fdisk /dev/loop0

             Device Boot      Start         End      Blocks   Id  System
        /dev/loop0p1   *          63     1028159      514048+  83  Linux

        # start sector = 63
        # end sector = 1028159
        # delta sectors = 1028159 - 63 + 1 = 1028097

#
# create filesystem inside image file
#

        dd if=/dev/zero of=fs.img bs=512 count=1028097

        mkfs.ext3 -F fs.img

        dd if=fs.img of=hd.img conv=notrunc bs=512 seek=63
        
        rm fs.img

#
# install data
#

        mount -o loop,offset=$((63*512)) hd.img /mnt

        debootstrap ...
        
        mkdir /mnt/boot/grub

        cp /usr/lib/grub/i386-pc/* /mnt/boot/grub/

#
# install bootloader (nach jonathan.mielikki.com)
#

        # be careful to use only unused hdX
        echo "(hd5) hd.img" > device.map

        grub --device-map=device.map

        grub> root (hd5,0)

        grub> setup (hd5)

        grub> quit

        Edit/configure /mnt/boot/grub/menu.lst...

#
# Finish
#

        umount /mnt
        losetup -d /dev/loop0


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-users] micro HOWTO build an HVM able image in one file, Goran Vukoman <=