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/
Home Products Support Community News


RE: [Xen-users] installing fc6 as domU directly on lv´s - howto

To: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Subject: RE: [Xen-users] installing fc6 as domU directly on lv´s - howto
From: "Philippe Trolliet" <p.trolliet@xxxxxxxxxxxxxxx>
Date: Tue, 22 May 2007 15:40:27 +0200
Cc: Xen-Users <xen-users@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 22 May 2007 06:38:53 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
Importance: Normal
In-reply-to: <20070522125456.GB23003@xxxxxxxxxx>
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

> -----Original Message-----
> From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
> [mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx]On Behalf Of Daniel P.
> Berrange
> Sent: Dienstag, 22. Mai 2007 14:55
> To: Philippe Trolliet
> Cc: Xen-Users
> Subject: Re: [Xen-users] installing fc6 as domU directly on lv´s
> On Tue, May 22, 2007 at 02:41:06PM +0200, Philippe Trolliet wrote:
> > hi,
> > since 2 days i´m trying to install fedora core 6 directly on logical
> > volumes. my host system is FC6 too.
> > i want to have following layout in my domU:
> > /dev/group/ServerRoot               mounted in domU as /
> > /dev/group/ServerVar                mounted in domU as /var
> > /dev/group/ServerSwap               mounted in domU as swap 
> device for the server
> > 
> > my xen-config looks like this:
> > 
> > name = "mailserver-FC6"
> > kernel = "/boot/vmlinuz-2.6.20-1.2948.fc6xen"
> > memory = 512
> > disk = ['phy:VolGroup00/MailserverRoot,sda1,w',
> > 'phy:VolGroup00/MailserverVar,sda2,w',
> > 'phy:VolGroup00/MailserverSwap,sda3,w']
> That isn't going to work - the Anaconda installer will only look for
> block devices, not partitions. Having partitions which are not a part
> of a block device is a Xen driver hack which is not supportable. If 
> you want to have 3 completely separate volumes in the host be visible
> as 3 separate volumes inside the guest, then you can export them as 
> individual devices 'xdva', 'xvdb', 'xvdc'. Then in Anaconda create a 
> single partition on each one, eg  xvda1, xvdb1, xvdc1  which you can 
> then map to /, /var and swap respectively. 

i didn´t use anaconda. i followed these steps from a howto for fc4 and
changed the partitioning stuff according to my logical volume layout:
First, create an image file to use as the storage for our Fedora guest
system. This acts as a virtual hard drive for the guest

1. create the logical volumes on the dom0 and create ext3 filesystems and
swap filesystems on it.

2.  mount partitions according to the layout you want to have:
e.g. later layout on domU:
/dev/group/ServerRoot           mounted in domU as /
/dev/group/ServerVar            mounted in domU as /var
/dev/group/ServerSwap           mounted in domU as swap 

mount /dev/group/ServerRoot /mnt/serverRoot
mount /dev/group/ServerVar /mnt/serverRoot/var

--- snip

        Now for the ugly part. To install a guest system on to the image we
need to set up some basic files on the filesystem of the image
        that have to be different for Xen (and for the system installation
with yum).

        First, create the /dev/ directory on the image with some required
device nodes, since we're not using an initrd4:

        # for i in console null zero ; do /sbin/MAKEDEV -d /mnt/dev -x $i ;

        Second, create an /etc/ directory in the image that contains an
/etc/fstab file. For the /etc/fstab file something simple like
        the following should work:

--- snip
        /dev/sda1       /       ext3    defaults        1 1
        /dev/sda2       /var    ext3    defaults        1 2
        /dev/sda3       swap    swap    defaults        0 0
        none            /dev/pts     devpts  gid=5,mode=620 0 0
        none            /dev/shm     tmpfs   defaults 0 0
        none            /proc        proc    defaults 0 0
        none            /sys         sysfs   defaults 0 0

--- snip
        Third, make sure /proc/ is mounted inside the image, because of a
bug in the groupadd utility (this is fixed with version 4.0.7-7
of the shadow-utils package):

        # mkdir /mnt/serverRoot/proc
        # mount -t proc none /mnt/serverRoot/proc

        Now we can install whatever base operating system we want.
        If you want to use a local Fedora mirror, then you'll want to
download  this yum.conf and modify it appropriately before using it;
        otherwise, it will point to the default set of mirror Websites.
        Then, decide which package group(s) you want to install. Start with
Base (or for the space constrained, Core, but this is more

        Install the guest system with the package groups by running yum. For
example, to install with Base use the command:
--- snip
for FC 6 i created my own yum.conf:


# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

name=Fedora Core 6 - $basearch - Base

name=Fedora Core 6 - $basearch - Released Updates

--- snip

        # yum -c yum-xen.conf --installroot=/mnt/serverRoot -y groupinstall

--- snip
create a new ramdisk according to the layout of your domU:

mkinitrd -f --with=ext3 --preload=ext3 --with=xennet --builtin=aic7xxx
--builtin=serverworks --preload=xenblk --omit-raid-modules
--omit-lvm-modules --fstab=/mnt/serverRoot/etc/fstab /boot/xen-initrd.img

the copy the new initrd to /mnt/serverRoot/boot

--- snip

        Do any other configuration you want to on the filesystem and then
unmount it:

        # umount /mnt/serverRoot/proc
        # umount /mnt/serverRoot

                        Registering a Guest System as a Domain

        Now, we just have to create a configuration file in /etc/xen/. As a
simple example, the following configuration file is /etc/xen/<name>:

        name = "mailserver-FC6"
        kernel = "/boot/vmlinuz-2.6.20-1.2948.fc6xen"
        ramdisk = "/boot/xen-initrd.img"
        memory = 512
        disk = ['phy:VolGroup00/MailserverRoot,sda1,w',
        root = "/dev/sda1"
        extra = "ro selinux=0 3"
        vcpus = 1
        vif = [ 'mac=00:16:3e:1a:c5:ad, bridge=xenbr0' ]

        Now, create a new domain:

        # xm create -c /etc/xen/<name>


is the way described in the howto correct?

this worked for me but i don´t know how to set the root password... i
mounted and chrooted into the domU´s partition and tried to change the
password but it didn´t work. i also tried to overwrite /etc/shadow and
/etc/shadow-. when i try to execute passwd in the chroot i get following
error message:
Changing password for user root.
passwd: Authentication token manipulation error


I am using the free version of SPAMfighter for private users.
It has removed 6509 spam emails to date.
Paying users do not have this message in their emails.
Get the free SPAMfighter here: http://www.spamfighter.com/len

<<attachment: winmail.dat>>

Xen-users mailing list