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

Re: [Xen-users] Guest O/S Questions

To: "Karsten M. Self" <karsten@xxxxxxxxxxxxx>
Subject: Re: [Xen-users] Guest O/S Questions
From: Anthony Liguori <aliguori@xxxxxxxxxx>
Date: Mon, 29 Aug 2005 18:40:25 -0500
Cc: xen-users <xen-users@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 29 Aug 2005 23:39:13 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <43138774.9040009@xxxxxxxxxxxxx>
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>
References: <20050824T144313Z_87A6000D0001@xxxxxxxxx> <200508242237.08951.mark.williamson@xxxxxxxxxxxx> <430CED91.4050204@xxxxxxxxxx> <43138774.9040009@xxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050317)
Karsten M. Self wrote:

That's actually getting to be a preferred method here, at least for some folks.

qemu file-backed installs allow you to use an existing RHEL installer, without much fuss or mess, the tricky bit is finding the filesystem afterward, as what qemu produces is a _partitioned_ file with filesystems within it.

Or you can just expose as a device with a partition table. IMHO, this is the best approach.

I've even had success resizing the disk image, and then (using a boot disk), appropriately resizing the filesystem.


dd skip=63 bs=512 if=qemu.img of=xen.img

Keep in mind, I've not tried this myself :-)

Exporting the qemu image as /dev/hda in domU and just setting your parameters right seems to work well and is much simplier.


Are you doing this with the qemu partitioned file itself?

Yup.

My xend config line looks like this:

disk = [ 'file:/root/FC4.img,hda,w' ]
root = "/dev/hda1"

That just works. There shouldn't be any disadvantage to using this method (other than it makes resizing individual partitions a bit more difficult).

   The first partition is /boot, the second is /.  I didn't use logical
   volumes, though it's possible to do so, complicating matters
   somewhat more.

If you want to extract the filesystems, I'd recommend using lomount as Ian suggests (and then just tar up the partitions).

5. Loopback mount the qemu images, creating a couple of mountpoints.
   Using the file I'm referencing above (rhel4):

       mkdir mp1 mp2
       su -c 'mount -o loop,offset=$(( 63 * 512 )) -t ext3 rhel4 mp1'
su -c 'mount -o loop,offset=$(( 4192964 * 512 )) -t ext3 rhel4 mp2'

As a final step, you could copy the contents of these two mountpoints
into a partition or a single filesystem image (a file with just a
filesystem in it, no partitions) which can be used for a Xen file-backed
DomU, etc.

There's a few things you'll want to do once you do the QEMU install. Namely, you'll want to make sure to install the appropriate modules (and run depmod).

Otherwise, it just works.

The next logical step is to run QEMU within a domU and automate the whole process.

QEMU is a pretty amazing little piece of software :-)

Regards,

Anthony Liguori

You will have to modify the DomU's /etc/fstab and likely comment the MAC
address registered in /etc/sysconfig/network-scripts/ifcfg-eth0 for
things to work properly.

Once you have a suitable image, you can simply use it as a DomU image for new deployments.


There are some good related docs on Fedora and Debian installs as well:

https://www.redhat.com/archives/fedora-devel-list/2005-January/msg01320.html
http://www.fedoraproject.org/wiki/FedoraXenQuickstart

Debian:  http://hands.com/d-i/HOWTO-xen.txt




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