|
|
|
|
|
|
|
|
|
|
xen-users
Re: [Xen-users] Booting Linux OS as a guest domain on RHEL5 on full virt
Firstly i am creating a guest os image by the below method
- 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
- 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
- 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
- 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}
- 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
- 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
|
|
|
|
|