Hello, I have CentOS release 4.4 (Final) dom0 and I want to create a CentOS domU using rpmstrap. I found several tutorials but I couldn''t get a rpmstrap script to work with the current CentOS repositories. It misses packages and dependencies and it doesnt install properly. Any tips ? anyone has a rpmstrap script working for CentOS ? I followed this tutorial: http://mark.foster.cc/wiki/index.php/Centos-4_on_Xen Thanks Joao Correia _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Joao Correia write:> I have CentOS release 4.4 (Final) dom0 and I want to create a CentOS > domU using rpmstrap. > I found several tutorials but I couldn''t get a rpmstrap script to work > with the current CentOS repositories. It misses packages and > dependencies and it doesnt install properly. > > Any tips ? anyone has a rpmstrap script working for CentOS ? > > I followed this tutorial: > http://mark.foster.cc/wiki/index.php/Centos-4_on_XenHi Joao, forget about mark''s tutorial, it used 2b good, but the links over there don''t work anymore. Moreover rpmstrap also broke my neck. Mount your partition and install your new system with yum ... * mkdir for /mnt/xentemplate/dev /mnt/xentemplate/etc * provide /mnt/xentemplate/etc/fstab for example /dev/sda1 / xfs 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 swap swap defaults 0 0 * for i in console null zero ; do /sbin/MAKEDEV -d /mnt/xentemplate/dev -x $i; done * cp -a /lib/modules/2.6.16.29-xen/ /mnt/xentemplate/lib/modules/ * echo "DEVICE=eth0 BOOTPROTO=dhcp ONBOOT=yes" >> /mnt/xentemplate/etc/sysconfig/network-scripts/ifcfg-eth0 * echo "NETWORKING=yes HOSTNAME=template GATEWAY=192.168.0.1">>/mnt/xentemplate/etc/sysconfig/network yum * mkdir -p /mnt/xentemplate/var/lock/rpm * yum -c /etc/yum.conf --installroot=/mnt/xentemplate/ -y groupinstall Base * replace /mnt/xentemplate/sbin/hwdata with an empty shell script * mv /mnt/xentemplate/lib/tls /mnt/xentemplate/lib/tls.disabled * umount /mnt/xentemplate/ * create a xen.cfg for example ... kernel ="/boot/vmlinuz-2.6.16.29-xen" ramdisk = "/var/local/initrd-2.6.16.29-xen-xenU.img" memory = 256 vcpus=2 name = "template" vif = [''mac=aa:bb:cc:dd:ee:11''] dhcp="dhcp" disk [''file:/tmp/xentemplate-centos44.img,sda1,w'',''file:/tmp/xentemplate-centos44-swap.img,sda2,w''] root = "/dev/sda1" extra = "ro selinux=0 3" * create an initrd /var/local/initrd-2.6.16.29-xen-xenU.img It''s good to have a local yum repo as 343 packages are being downloaded during yum process. HTH, this worked for me and seems to be quite clean. Regards, Michael -- Michael Kress, kress@hal.saar.de http://www.michael-kress.de / http://kress.net P E N G U I N S A R E C O O L _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Michael Lang wrote:> On Sat, 2006-10-21 at 03:34 +0100, Joao Correia wrote: >> Hello, >> >> I have CentOS release 4.4 (Final) dom0 and I want to create a CentOS >> domU using rpmstrap. >> I found several tutorials but I couldn''t get a rpmstrap script to work >> with the current CentOS repositories. It misses packages and >> dependencies and it doesnt install properly. >> >> Any tips ? anyone has a rpmstrap script working for CentOS ? >> >> I followed this tutorial: >> http://mark.foster.cc/wiki/index.php/Centos-4_on_Xen > > maybe this little howto using yum can help you. > > I''m using LVM, if you prefere using loopbacks mark''s tutorial explains > creation of loopback disks. > > # start creating the disk > # where the Grp_Xen is expected to be the VolumeGroupName > > $ lvcreate -L 1G -n XEN01 Grp_Xen > $ mkfs.ext3 /dev/mapper/Grp_Xen-XEN01 > > # now we need the packages > > $ mount /dev/mapper/Grp_Xen-XEN01 /mnt > $ mkdir -p /mnt/proc /mnt/var/lib/rpm /mnt/dev /var/cache/ > $ for i in console null zero random ; do MAKEDEV -d /mnt/dev -x ${i} ; \ > done > $ mount -t proc none /mnt/proc > > # you need enought diskspace for the fetched headers and Packages > # so link it against a disk with enough space ~2GB > # mkdir -p /export/yumspool > $ ln -s /export/yumspool /mnt/var/cache/yum > > # if you need additional Yum locations > # $ mkdir /mnt/etc/yum.repos.d/ > # $ cp MyRepository.repo /mnt/etc/yum.repos.d/ > > # then start installing rpms using yum with > # a: groupinstall > # b: install \* for everything but 1G might be not enought diskspace :) > > $ yum --installroot=/mnt -y groupinstall core base > # or > # $ yum --installroot=/mnt -y install \* > > $ cat <<EOF > /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 > EOF > > # you need to enable shadow authentication in this installation > # first get every installed username (daemon depending) > $ for user in `cut -f1 -d'':'' /mnt/etc/passwd` ; do > useropts=$(grep ${user} /mnt/etc/passwd | cut --fields=3- -d'':'') > echo "${user}:x:${useropts}" >> /mnt/etc/passwd.new > # setting shadow passwords as in dom0 > grep ${user} /etc/shadow >> /mnt/etc/shadow > done > $ mv /mnt/etc/passwd.new /mnt/etc/passwd > $ chmod 0400 /mnt/etc/shadow > > # after finishing the installation you can unount the filesystems > # but you will get an umount error as the minilogd access the mountpoint > # and blocks umount access > > $ sync # flushing all changes to disk if needed > $ umount /mnt/proc > $ umount /mnt > # force it with -f force and -l lacy > # $ umount -fl /mnt > > adding the disk to your config and booting should be working ... > Kind regards > Michael Lang > >> Thanks >> Joao CorreiaVery good howtos Michael Lang and Michael Kress!!!!!!!. Oe questio: can i do the same to install centos 3.8 domU on Centos 4.4 under xen 3.0.3 using rpms provided by xensource??? Thanks ..>> >> _______________________________________________ >> Xen-users mailing list >> Xen-users@lists.xensource.com >> http://lists.xensource.com/xen-users-- CL Martinez carlopmart {at} gmail {d0t} com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Sat, 2006-10-21 at 03:34 +0100, Joao Correia wrote:> Hello, > > I have CentOS release 4.4 (Final) dom0 and I want to create a CentOS > domU using rpmstrap. > I found several tutorials but I couldn''t get a rpmstrap script to work > with the current CentOS repositories. It misses packages and > dependencies and it doesnt install properly. > > Any tips ? anyone has a rpmstrap script working for CentOS ? > > I followed this tutorial: > http://mark.foster.cc/wiki/index.php/Centos-4_on_Xenmaybe this little howto using yum can help you. I''m using LVM, if you prefere using loopbacks mark''s tutorial explains creation of loopback disks. # start creating the disk # where the Grp_Xen is expected to be the VolumeGroupName $ lvcreate -L 1G -n XEN01 Grp_Xen $ mkfs.ext3 /dev/mapper/Grp_Xen-XEN01 # now we need the packages $ mount /dev/mapper/Grp_Xen-XEN01 /mnt $ mkdir -p /mnt/proc /mnt/var/lib/rpm /mnt/dev /var/cache/ $ for i in console null zero random ; do MAKEDEV -d /mnt/dev -x ${i} ; \ done $ mount -t proc none /mnt/proc # you need enought diskspace for the fetched headers and Packages # so link it against a disk with enough space ~2GB # mkdir -p /export/yumspool $ ln -s /export/yumspool /mnt/var/cache/yum # if you need additional Yum locations # $ mkdir /mnt/etc/yum.repos.d/ # $ cp MyRepository.repo /mnt/etc/yum.repos.d/ # then start installing rpms using yum with # a: groupinstall # b: install \* for everything but 1G might be not enought diskspace :) $ yum --installroot=/mnt -y groupinstall core base # or # $ yum --installroot=/mnt -y install \* $ cat <<EOF > /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 EOF # you need to enable shadow authentication in this installation # first get every installed username (daemon depending) $ for user in `cut -f1 -d'':'' /mnt/etc/passwd` ; do useropts=$(grep ${user} /mnt/etc/passwd | cut --fields=3- -d'':'') echo "${user}:x:${useropts}" >> /mnt/etc/passwd.new # setting shadow passwords as in dom0 grep ${user} /etc/shadow >> /mnt/etc/shadow done $ mv /mnt/etc/passwd.new /mnt/etc/passwd $ chmod 0400 /mnt/etc/shadow # after finishing the installation you can unount the filesystems # but you will get an umount error as the minilogd access the mountpoint # and blocks umount access $ sync # flushing all changes to disk if needed $ umount /mnt/proc $ umount /mnt # force it with -f force and -l lacy # $ umount -fl /mnt adding the disk to your config and booting should be working ... Kind regards Michael Lang> > Thanks > Joao Correia > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users-- Michael Lang <michi+xen@relay3.jackal-net.at> _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Sat, 2006-10-21 at 09:37 +0200, carlopmart wrote:> > > > >> Thanks > >> Joao Correia > > Very good howtos Michael Lang and Michael Kress!!!!!!!. Oe questio: can > i do the same to install centos 3.8 domU on Centos 4.4 under xen 3.0.3 > using rpms provided by xensource???Hi, sure, just copy your /etc/yum.repos.d/CentOS-Base.repo with (to force release 3 and arch i386) # instead of $ cp /etc/yum.repos.d/* /mnt/etc/yum.repos.d/ # the first replaces every releasever (4,3,2) with the value of 3 # the second replaces every arch entry (x86_64,..) with i386 # the third replaces the GPG names from 4 to 3 $ sed -e " s#$releasever#3#g; s#$basearch#i386#g; s#centos4#centos3#g;"\ < /etc/yum.repos.d/CentOS-Base.repo \ > /mnt/etc/yum.repos.d/CentOS-Base.repo Kind regards Michael Lang> > Thanks .. > > > >> > >> _______________________________________________ > >> Xen-users mailing list > >> Xen-users@lists.xensource.com > >> http://lists.xensource.com/xen-users >-- Michael Lang <Michael.Lang@chester.at> _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Many thanks for this tutorial, but when I try to do it with yum I get an error. My yum is working ok, I install packages with no problems but this command returns this error. [root@springpbx-sitic ~]# yum --installroot=/mnt -y groupinstall core base Setting up Group Process Setting up repositories not using ftp, http[s], or file for repos, skipping - Null is not a valid release or hasnt been released yet Cannot find a valid baseurl for repo: update Error: Cannot find a valid baseurl for repo: update [root@springpbx-sitic ~]# Im using CentOS 4.4 Thanks Joao Correia On 10/21/06, Michael Lang <michi+xen@relay3.jackal-net.at> wrote:> > On Sat, 2006-10-21 at 03:34 +0100, Joao Correia wrote: > > Hello, > > > > I have CentOS release 4.4 (Final) dom0 and I want to create a CentOS > > domU using rpmstrap. > > I found several tutorials but I couldn''t get a rpmstrap script to work > > with the current CentOS repositories. It misses packages and > > dependencies and it doesnt install properly. > > > > Any tips ? anyone has a rpmstrap script working for CentOS ? > > > > I followed this tutorial: > > http://mark.foster.cc/wiki/index.php/Centos-4_on_Xen > > maybe this little howto using yum can help you. > > I''m using LVM, if you prefere using loopbacks mark''s tutorial explains > creation of loopback disks. > > # start creating the disk > # where the Grp_Xen is expected to be the VolumeGroupName > > $ lvcreate -L 1G -n XEN01 Grp_Xen > $ mkfs.ext3 /dev/mapper/Grp_Xen-XEN01 > > # now we need the packages > > $ mount /dev/mapper/Grp_Xen-XEN01 /mnt > $ mkdir -p /mnt/proc /mnt/var/lib/rpm /mnt/dev /var/cache/ > $ for i in console null zero random ; do MAKEDEV -d /mnt/dev -x ${i} ; \ > done > $ mount -t proc none /mnt/proc > > # you need enought diskspace for the fetched headers and Packages > # so link it against a disk with enough space ~2GB > # mkdir -p /export/yumspool > $ ln -s /export/yumspool /mnt/var/cache/yum > > # if you need additional Yum locations > # $ mkdir /mnt/etc/yum.repos.d/ > # $ cp MyRepository.repo /mnt/etc/yum.repos.d/ > > # then start installing rpms using yum with > # a: groupinstall > # b: install \* for everything but 1G might be not enought diskspace :) > > $ yum --installroot=/mnt -y groupinstall core base > # or > # $ yum --installroot=/mnt -y install \* > > $ cat <<EOF > /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 > EOF > > # you need to enable shadow authentication in this installation > # first get every installed username (daemon depending) > $ for user in `cut -f1 -d'':'' /mnt/etc/passwd` ; do > useropts=$(grep ${user} /mnt/etc/passwd | cut --fields=3- -d'':'') > echo "${user}:x:${useropts}" >> /mnt/etc/passwd.new > # setting shadow passwords as in dom0 > grep ${user} /etc/shadow >> /mnt/etc/shadow > done > $ mv /mnt/etc/passwd.new /mnt/etc/passwd > $ chmod 0400 /mnt/etc/shadow > > # after finishing the installation you can unount the filesystems > # but you will get an umount error as the minilogd access the mountpoint > # and blocks umount access > > $ sync # flushing all changes to disk if needed > $ umount /mnt/proc > $ umount /mnt > # force it with -f force and -l lacy > # $ umount -fl /mnt > > adding the disk to your config and booting should be working ... > Kind regards > Michael Lang > > > > > Thanks > > Joao Correia > > > > _______________________________________________ > > Xen-users mailing list > > Xen-users@lists.xensource.com > > http://lists.xensource.com/xen-users > -- > Michael Lang <michi+xen@relay3.jackal-net.at> > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi Joao, Joao Correia wrote:> Hello many thanks, I had looked over yum but I get this error: > > [root@springpbx-sitic /]# yum -c /etc/yum.conf --installroot=/mnt -y > groupinstall Base > Setting up Group Process > Setting up repositories > not using ftp, http[s], or file for repos, skipping - Null is not a > valid release or hasnt been released yet > Cannot find a valid baseurl for repo: update > Error: Cannot find a valid baseurl for repo: update > [root@springpbx-sitic /]# > > Any tips ?you have to hardcode your release number in /etc/yum.repos.d/CentOS-Base.repo. I use for example: [base] name=CentOS-$releasever - Base ### mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os baseurl=http://my-local-server-in-lan/centos/4/os/$basearch gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4 (note the "4" in the baseurl line.) Same thing for update repo entries. On the following page I''ve seen another comment/discussion about the issue: http://wiki.sisuite.org/BuildingLinuxChroots Maybe it''s some use i.e. first installing the centos-release rpm, but I haven''t tried it yet. HTH Regards, Michael -- Michael Kress, kress@hal.saar.de http://www.michael-kress.de / http://kress.net P E N G U I N S A R E C O O L _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
I had *alot* of trouble with rpmstrap. Googled, did a bit of reading and came up with this:- http://wiki.blagblagblag.org/Xen_images. It works for me everytime - that''s whay I wrote it ;) On 22/10/06, Michael Kress <kress@hal.saar.de> wrote:> Hi Joao, > > Joao Correia wrote: > > Hello many thanks, I had looked over yum but I get this error: > > > > [root@springpbx-sitic /]# yum -c /etc/yum.conf --installroot=/mnt -y > > groupinstall Base > > Setting up Group Process > > Setting up repositories > > not using ftp, http[s], or file for repos, skipping - Null is not a > > valid release or hasnt been released yet > > Cannot find a valid baseurl for repo: update > > Error: Cannot find a valid baseurl for repo: update > > [root@springpbx-sitic /]# > > > > Any tips ? > > you have to hardcode your release number in > /etc/yum.repos.d/CentOS-Base.repo. > I use for example: > [base] > name=CentOS-$releasever - Base > ### > mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os > baseurl=http://my-local-server-in-lan/centos/4/os/$basearch > gpgcheck=1 > gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4 > > (note the "4" in the baseurl line.) > Same thing for update repo entries. > > On the following page I''ve seen another comment/discussion about the issue: > http://wiki.sisuite.org/BuildingLinuxChroots > Maybe it''s some use i.e. first installing the centos-release rpm, but I > haven''t tried it yet. > > HTH > Regards, > Michael > > -- > Michael Kress, kress@hal.saar.de > http://www.michael-kress.de / http://kress.net > P E N G U I N S A R E C O O L > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >-- John Maclean - 07739 171 531 MSc (DIC) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
If there are no special customizations needed for the image, then you could also check out http://jailtime.org/ They have preprepared images for several major free distributions like CentOS, Fedora, debian and Gentoo. +Katriel Joao Correia wrote:> Hello, > > I have CentOS release 4.4 (Final) dom0 and I want to create a CentOS > domU using rpmstrap. > I found several tutorials but I couldn''t get a rpmstrap script to work > with the current CentOS repositories. It misses packages and > dependencies and it doesnt install properly. > > Any tips ? anyone has a rpmstrap script working for CentOS ? > > I followed this tutorial: > http://mark.foster.cc/wiki/index.php/Centos-4_on_Xen > > Thanks > Joao Correia > > > ------------------------------------------------------------------------ > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users-- Katriel Traum, PenguinIT RHCE, CLP Mobile: 054-6789953 _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Katriel Traum schrieb:> If there are no special customizations needed for the image, then you > could also check out http://jailtime.org/ > They have preprepared images for several major free distributions like > CentOS, Fedora, debian and Gentoo. > > +Katriel >That''s good for starting, but they don''t have 64 bit images, so I have to make them myself. Anyways, pre-built images are nothing divine, it''s just that somebody has created them the way Michael Lang and me have described it. :) Regards, Michael -- Michael Kress, kress@hal.saar.de http://www.michael-kress.de / http://kress.net P E N G U I N S A R E C O O L _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users