[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Create a domU using rpmstrap CentOS


  • To: xen-users@xxxxxxxxxxxxxxxxxxx
  • From: "Joao Correia" <joao.correia@xxxxxxxxx>
  • Date: Sun, 22 Oct 2006 00:49:02 +0100
  • Delivery-date: Sat, 21 Oct 2006 16:49:43 -0700
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Xs5gMZO1zskhpvA5imbHS8ic5slSBqbXqyEHQ4+Mkpsyk+HnLPTYIqMQfqyzVE7vzDBhf7qJI4JUWlumBYhdgzq7VATyBd0r2DRITBwlySau7wt+UGw3zIxDSH2VDgjBm3SiRNs4uXFuKX9nHj650kYsOsL5dPfFvYJkinGnTTM=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

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@xxxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users
--
Michael Lang <michi+xen@xxxxxxxxxxxxxxxxxxxx>


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

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.