On Fr, Nov 30, 2007 at 06:46:52 +0100, Chris Fanning wrote:
> Hi,
>
> I'd like to know how to install centos (4.5 in my case) to run as a
> domU on a dom0 running etch.
>
> Any tips please?
Make sure that you have enough free space
on the file system where you are going to make image for centos
(or create PV if you are going to use LVM).
# df -h
# dd if=/dev/zero of=centos.img count=1 bs=1k seek=$[2*1024*1024]
# mkfs.ext3 centos.img
# mount -o loop centos.img /mnt
Now you have 2G-size image with ext3 filesystem mounted to /mnt directory.
After that:
# apt-get install yum
# yum -c /tmp/yum-xen.conf --installroot=/mnt -y groupinstall Base
where you-xen.conf file should look like:
===================================================
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
exclude=*-debuginfo
gpgcheck=0
obsoletes=1
reposdir=/dev/null
[base]
name=CentOS-$releasever - Plus
baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
enabled=1
===================================================
if you have the error during installation
------------------------------------------------
Failed to add groups file for repository: base
Error: No Groups on which to run command
------------------------------------------------
then modify yum code like shown below:
------------------------------------------------
# cp /usr/share/python-support/yum/yum/comps.py{,.ORIG}
# vi /usr/share/python-support/yum/yum/comps.py
# diff /usr/share/python-support/yum/yum/comps.py{.ORIG,}
124c124
< if type not in ('mandatory', 'default',
'optional'):
---
> if type not in ('mandatory', 'default',
> 'optional', 'conditional'):
143c143
< if type not in ('mandatory', 'default',
'optional'):
---
> if type not in ('mandatory', 'default',
> 'optional', 'conditional'):
------------------------------------------------
Create several directories and device files:
%# /mnt/{dev,proc,etc}
%# for i in console null zero ; do /sbin/MAKEDEV -d /mnt/dev -x $i ;
%done
Disable TLS.
%# mv /mnt/lib/tls /mnt/lib/tls-disabled
Create /etc/fstab
(of course you must specify correct device files)
%# cat <<EOL > /mnt/etc/fstab
/dev/sda1 / 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 defaults 0 0
#/dev/sda2 /mnt ext3 defaults 1 2
#/dev/sda3 swap swap defaults 0 0
EOL
Setup network interfaces
(I suppose that you use one interface which should acquire
its IP-address via DHCP).
%# cat <<EOL > /mnt/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
EOL
cat <<EOL > /mnt/etc/sysconfig/network-scripts/ifcfg-eth0
ONBOOT=yes
DEVICE=eth0
BOOTPROTO=dhcp
EOL
Copy kernel modules to the domU filesystem
(alternatively you can install Xenified Linux Kernel
inside domU using yum).
%# cp -R /lib/modules/2.6.*xen* /mnt/lib/modules/
Set root password for domU:
%$ sudo chroot /mnt
bash-3.1# pwconv
bash-3.1# passwd
Changing password for user root.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
bash-3.1# exit
That's all.
No you may umount your image and make
%# xm create -c centos
centos here is the name of the Xen domain config file
which will run the image that you have prepared.
>
> Thanks.
> Chris.
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users
--
WBR, i.m.chubin
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
|