Building an RPM based (Red Hat, Fedora, CentOS) Xen Guest Root Filesystem using Rinse

From Techotopia
Jump to: navigation, search

As we have mentioned a number of times in preceding chapters one of the key prerequisites for a functional Xen domainU guest system is a root filesystem populated with the base packages required for the chosen Linux distribution to boot and operate. In the previous chapter we looked at how the debootstrap tool can be used to achieve this when working with Debian or Ubuntu Linux. For system based on RPM package management the rinse tool performs a similar function. Linux distributions currently supported include Fedora and CentOS.

In this chapter we will look in detail at creating a Xen domainU root filesystem using Rinse.


Contents


Getting and Installing Rinse

The Rinse tool can be downloaded from the Xen-Tools web site. Once the installation archive has been downloaded unpack it in a temporary location as follows:

tar xvfz rinse-1.0.tar.gz
cd rinse-1.0

Once the archive is unpacked, initiate the installation as root:

su -
make install

Choosing a Linux Distribution

Rinse is operated from the command-line using the rinse command. At the time of writing, Rinse currently supports the installation of Fedora and CentOS Linux distributions. To obtain a full list of supported distributions execute rinse with the --list-distributions command-line argument:

# rinse --list-distributions
The following distributions are available:
        centos-4
        centos-5
        fedora-core-4
        fedora-core-5
        fedora-core-6
        fedora-core-7
        fedora-core-8

Creating an Installation Location and Swap Space

The next requirement is a suitable filesystem into which to install the base packages for the chosen Linux distribution together with a swap partition. A number of options are available including a physical disk partition, a logical volume or a disk image file. For steps on creating this filesystems refer to one of the following chapters (be sure to return to this chapter once the filesystem has been created):

Previewing Packages to be Installed

The Rinse tool provides the --print-uri command-line argument to display the packages which will be installed if the installation is carried out. This option must be combined with the choice of distribution using the --distribution argument. For example, the following partial output shows the packages that will be installed for a CentOS 5 installation:

rinse --distribution centos-5 --print-uri | more
http://anorien.csc.warwick.ac.uk/mirrors/centos/5/os/i386/CentOS//audit-li
bs-1.5.5-7.el5.i386.rpm
http://anorien.csc.warwick.ac.uk/mirrors/centos/5/os/i386/CentOS//basesyst
em-8.0-5.1.1.el5.centos.noarch.rpm
http://anorien.csc.warwick.ac.uk/mirrors/centos/5/os/i386/CentOS//bash-3.1
-16.1.i386.rpm
http://anorien.csc.warwick.ac.uk/mirrors/centos/5/os/i386/CentOS//beecrypt
-4.1.2-10.1.1.i386.rpm
.
.
.

Installing the Base Packages Using Rinse

Once a suitable filesystem has been created the next step is to instruct rinse to install the base operating system packages into that location. If you are using a disk image be sure to mount the image using the loop back interface.

Once the target root filesystem is accessible (for the purposes of this chapter we will assume it is mounted at /xen the installation can begin. To do so simply specify the distribution and target location:

rinse --distribution centos-5 --directory /xen

Running post-install script post-install.sh:
  Creating resolv.conf
BUGFIX
  Mounting /proc
  Bootstrapping yum
Loading "installonlyn" plugin
Setting up Install 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
Loading "installonlyn" plugin
Setting up Install 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
Loading "installonlyn" plugin
Setting up Install 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
  Authfix
Loading "installonlyn" plugin
Setting up Install 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
Error: Cannot find a valid baseurl for repo: extras
chroot: cannot run command `/usr/bin/authconfig': No such file or directory
  Cleaning up
Loading "installonlyn" plugin
Cleaning up Everything
  Final tidy...
Installation complete.

Configuring the domainU System

Once the basic system is installed some additional steps are necessary to complete the installation. The configuration changes necessary will depend to a large extent on how you set up the domainU filesystems (LVM, physical disk or disk image).