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] Booting Linux OS as a guest domain on RHEL5 on full virt

To: "Henning Sprang" <henning_sprang@xxxxxx>
Subject: Re: [Xen-users] Booting Linux OS as a guest domain on RHEL5 on full virtualized machine.
From: "trilok nuwal" <tc.nuwal@xxxxxxxxx>
Date: Tue, 30 Jan 2007 19:26:14 +0530
Cc: Xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 30 Jan 2007 05:56:52 -0800
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=IA/Ng2fokZY7COjF0qAqtjMxhzS5UVKSMazzTLewyef82LDtCQlkt2dBv3BHBHki49MKmGTKXxFJmAjxFGCJiOy0hOv0zzyF183xJdjHVmSz23z3mIxCcDJ4oSNZK+aILeNA2G8N3oqDeSS7VN4njFkqasW629EfaHJRLhZn+lo=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <5bb00b3f0701290653k595d7406xa3809120585176fe@xxxxxxxxxxxxxx>
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: <f58fc26d0701290619l575d9d8w3880fc2fc64678f2@xxxxxxxxxxxxxx> <5bb00b3f0701290653k595d7406xa3809120585176fe@xxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Firstly i am creating a guest os image by the below method

  1. Install a normal Linux OS on the host machine
    You can choose any way to install Linux, such as using yum to install Red Hat Linux or YAST to install Novell SuSE Linux. The rest of this example assumes the Linux OS is installed in
    /tmp

  2. Make the partition table
    The image file will be treated as hard disk, so you should make the partition table in the image file. For example:

    # losetup /dev/loop0 hd.img
    # fdisk -b 512 -C 4096 -H 16 -S 32 /dev/loop0
    press 'n' to add new partition
    press 'p' to choose primary partition
    press '1' to set partition number
    press "Enter" keys to choose default value of "First Cylinder" parameter.
    press "Enter" keys to choose default value of "Last Cylinder" parameter.
    press 'w' to write partition table and exit
    # losetup -d /dev/loop0

  3. Make the file system and install grub
    # ln -s /dev/loop0 /dev/loop
    # losetup /dev/loop0 hd.img
    # losetup -o 16384 /dev/loop1 hd.img
    # mkfs.ext3 /dev/loop1
    # mount /dev/loop1 /mnt
    # mkdir -p /mnt/boot/grub
    # cp /boot/grub/stage* /boot/grub/e2fs_stage1_5 /mnt/boot/grub
    # umount /mnt
    # grub
    grub> device (hd0) /dev/loop
    grub> root (hd0,0)
    grub> setup (hd0)
    grub> quit
    # rm /dev/loop
    # losetup -d /dev/loop0
    # losetup -d /dev/loop1

    The losetup option -o 16384 skips the partition table in the image file. It is the number of sectors times 512. We need /dev/loop because grub is expecting a disk device name, where namename1 represents the first partition. represents the entire disk and

  4. Copy the OS files to the image
    If you have Xen installed, you can easily use lomount instead of losetup and mount when coping files to some partitions. lomount just needs the partition information.

    # lomount -t ext3 -diskimage hd.img -partition 1 /mnt/guest
    # cp -ax /var/guestos/{root,dev,var,etc,usr,bin,sbin,lib} /mnt/guest
    # mkdir /mnt/guest/{proc,sys,home,tmp}

  5. Edit the /etc/fstab of the guest image
    The fstab should look like this:

    # vim /mnt/guest/etc/fstab
    /dev/hda1 / ext3 defaults 1 1
    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 efaults 0 0

  6. umount the image file
    # umount /mnt/guest

my config file is

import os, re
arch = os.uname()[4]
if re.search('64', arch):
    arch_libdir = 'lib64'
else:
    arch_libdir = 'lib'
kernel = "/usr/lib/xen/boot/hvmloader"
#disk = [ 'file:/mnt/disk.img,ioemu:hda,w', 'file:/mnt/Enterprise-R4-U4-x86_64-disc1.iso,hdc:cdrom,r' ]
disk = [ 'file:/home/hd.img,ioemu:sda,w' ]
vif = [ 'mac=00:50:56:39:85:78 , bridge=xenbr0' ]
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
builder='hvm'
memory = 1000
name = "domU"
vcpus=1
boot="c"
sdl=1
vnc=0
vncviewer=0
ne2000=1
serial='pty'

when i create the domain  then i m getting this error
xm create -c /etc/xen/dom.vti
Using config file "/etc/xen/dom.vti".
Started domain domU
xenconsole: Could not read tty from store: No such file or directory

On 1/29/07, Henning Sprang <henning_sprang@xxxxxx> wrote:
On 1/29/07, trilok nuwal <tc.nuwal@xxxxxxxxx> wrote:
> Hi,
>  I want to boot a linux on fully virtualized machine RHEL5 dom0 .
>  Can anyone please give the idea abt the disk contains in config file.
>
>  disk =['']
>
>  And then i want to know about the vnc configuration.
>  I am accessing a remote machine through ssh.

What do you want to know about the vnc confiuguration?

Did you read all available docs, first?
disk config and vnc are described there - please try the things you
find in available docs first, and then come back here when you have
specific problems - describing what you try, and what goes wrong.

Henning

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