ENTERPRISE

Xen Virtualization : Installing Xen from Binary Packages

2/20/2012 5:44:57 PM
All the major Linux distributions such as Red Hat, Debian, Ubuntu, SuSe, and Gentoo ship some form of support for using Xen virtualization. In most cases they provide easy to install binary packages in the packaging format used by the specific distributions. This is the easiest and quickest way to get up and running with Xen.

will run other operating systems in virtual machines inside it. The package manager used by Fedora is named yum. If you are new to yum and have not used it before, please refer to the Fedora yum manual at http://fedora.redhat.com/docs/yum/en/. We will use yum to install Xen from the pre‑built packages provided by Red Hat. It will install the Xen kernel used by Domain0, the libraries, Python modules, and user space tools used for interacting with Xen.

Time for Action—Installing Xen with yum

yum makes installing Xen in your Fedora Core 6 system a breeze. The following steps are needed to get Xen running:

  1. Install the Xen kernel and tools by running the following command:

    yum install kernel-xen xen

    This will download and install the following packages and their dependencies:

    • kernel-xen: Contains the Xen enabled kernel for both the host and guest operating systems as well as the hypervisor.

    • xen: Contains the user-space tools for interacting with the hypervisor.

    • bridge-utils: Utilities for configuring the Ethernet bridge that is used for connecting multiple Ethernet devices together.

    • libvirt: A C library that provides an API to use the Xen framework.

    • libvirt-python: Contains a Python module that let's Python applications to use the API to the Xen framework provided by libvirt.

    • python-virtinst: Contains a Python module that uses libvirt for starting installations of Fedora/Red Hat Enterprise Linux related distributions inside virtual machines.

    • xen-libs: Contains the libraries needed to run applications to manage Xen.

    Fedora Core 6 uses grub as the bootloader. Installation of the Xen packages from the previous step will add an entry to the /boot/grub/grub.conf file for booting the Xen kernel. This is what the grub.conf looks after the installation.

  2. However, Xen kernel is not set as the default boot option. Modify /boot/grub/grub.conf and change the value default=1 to default=0. This will change the default kernel used for booting to the Xen kernel instead of the default Fedora kernel. You will need to be the root or a user with administrative privileges in order to do this.

  3. Reboot to start using this kernel.

  4. Once the machine is up and running, check the version of the running kernel to ensure that you are running the Xen kernel.

  5. The management of domains is done by xend—the Xen Controller daemon. It can be started and stopped using the /etc/rc.d/init.d/xend script and is started up by Fedora Core 6 automatically on boot. Check to make sure that xend is running by executing the following command to search the list of processes running on the system:

    pidof xend
  6. Once xend is running, it will start Domain0, which is the privileged domain. Check to see that Domain0 has been created and is up and running by using the xm command.

  7. Check to see that all the network interfaces are up. This will include the normal network interfaces such as eth0 and lo, and the Xen related interfaces. The name of the network interface peth0 that we can see in the following screenshot has changed to eth0 in the newer versions of Fedora 7.0 and above.

  8. You are now running Xen!

What Just Happened?

We used yum to install the following:

  • Xen hypervisor

  • dom0 kernel

  • Xen libraries and Python modules

  • User space tools for interacting with Xen from dom0

The configuration for grub was modified automatically by the installation to add an entry for booting the Xen hypervisor and the dom0 kernel. Let us examine each line that was added as it will give a good insight into the process of what happens when a Xen system boots up. Here is the section that was added for the Xen kernel in the /boot/grub/grub.conf (Line numbers have been added and are not actually present in the file):

1. title Fedora Core (2.6.19-1.2911.6.5.fc6xen)2. root (hd0,1)
3. kernel /xen.gz-2.6.19-1.2911.6.5.fc6
4. module /vmlinuz-2.6.19-1.2911.6.5.fc6xen ro root=/dev/VolGroup00/ LogVol00 rhgb quiet
5. module /initrd-2.6.19-1.2911.6.5.fc6xen.img



Line 1 defines the title for this kernel and is displayed in the grub menu on boot, which allows you to select a kernel.

Line 2 defines the root partition that will be used for booting up.

Line 3 specifies the kernel that is to be used for booting. In Xen this specifies the Xen hypervisor and not the dom0 kernel. When a normal Linux is booted, the kernel option refers to an actual Linux kernel.

Line 4 specifies the kernel that is used for booting up the privileged dom0, the root option specifies the partition that holds the root file system, and a few other options, which are not Xen specific but apply to any Linux kernel.

Line 5 defines the file that contains the initial ram disk image that is first loaded by the kernel on initialization before it switches over to using the root file system. This initrd image is only suitable for the host and not for any of the guests.

When the machine boots up, it loads the hypervisor that initializes Xen. At this stage you will see a lot of messages flash by on the screen prepended with the text, [XEN]. The Xen hypervisor then boots using the dom0 kernel. The operating system that is used by the dom0 kernel contains an init script that starts up the Xen daemon—xend, which creates and loads dom0.

The dom0 contains the Xen libraries that provide the API that can be used by client and userland applications to communicate with the Xen framework. The Python modules wrap this functionality so that it can be used by applications written in Python, which is the scripting language used for scripting Xen. We used one of these tools—xm, the Xend Manager—to check whether any Xen domains were running. xm is the main interface provided for managing the various Xen guest domains. It can be used to create, pause, and shutdown domains. It can also be used, as we did, to list current domains. Finally we check to make sure that our network interfaces are up.
Other  
  •  Introducing IBM BPM and ESB : IBM SOA Reference Architecture & Introducing IBM WebSphere Process Server
  •  Introducing IBM BPM and ESB : Achieving success through BPM enabled by SOA
  •  Separating BPM and SOA Processes : Example-Process for Handling Credit Card Disputes
  •  Separating BPM and SOA Processes : The Model Stack & Design Tips on Separating BPM and SOA
  •  BizTalk 2006 : Editing and Resubmitting Suspended Messages (part 2) - Pseudo-Walkthrough to Perform Edits and Resubmits
  •  BizTalk 2006 : Editing and Resubmitting Suspended Messages (part 1)
  •  BizTalk 2006 : Building a Resequencing Aggregator
  •  Windows System Programming : Listing Registry Keys and Contents
  •  Windows System Programming : Registry Management
  •  .NET Debugging : PowerDbg (part 2) - Send-PowerDbgCommand & Extending PowerDbg
  •  .NET Debugging : PowerDbg (part 1) - Installing PowerDbg & Analyze-PowerDbgThreads
  •  Sharepoint 2010 : Business Connectivity Services Deployment Types (part 3) - Configure Indexing & Performing a Search
  •  Sharepoint 2010 : Business Connectivity Services Deployment Types (part 2) - Creating a Profile Page to Display BCS Results
  •  Sharepoint 2010 : Business Connectivity Services Deployment Types (part 1) - Code-Based Solutions
  •  Sharepoint 2010 : BCS Architecture - Presentation & Core Components
  •  Collaborating via Web-Based Communication Tools : Evaluating Instant Messaging Services
  •  Collaborating via Web-Based Communication Tools : Evaluating Web Mail Services
  •  Developing the SAP Data Center : Data Center Physical Requirements
  •  Developing the SAP Data Center : Introducing the SAP Data Center
  •  Inventory of Broadband Phone Services
  •  
    Top 10
    Windows Vista : Installing and Running Applications - Launching Applications
    Windows Vista : Installing and Running Applications - Applications and the Registry, Understanding Application Compatibility
    Windows Vista : Installing and Running Applications - Practicing Safe Setups
    Windows Server 2003 : Domain Name System - Command-Line Utilities
    Microsoft .NET : Design Principles and Patterns - From Principles to Patterns (part 2)
    Microsoft .NET : Design Principles and Patterns - From Principles to Patterns (part 1)
    Brother MFC-J4510DW - An Innovative All-In-One A3 Printer
    Computer Planet I7 Extreme Gaming PC
    All We Need To Know About Green Computing (Part 4)
    All We Need To Know About Green Computing (Part 3)
    Most View
    All You Need To Know About iOS 6 (Part 3)
    Upgrade Power - Guidelines For PSU Buyers (Part 4) - Cooler Master Silent Pro Gold 800W, Corsair Enthusiast Series Modular TX850M
    Just My Type (part 2) - ZAGGfolio,Writer Plus, keyPAD, Professional Workstation
    VLC Player : What Tricks This Great Little Player Can Do
    How To Buy…A NOTEBOOK PC (Part 2)
    Design and Deploy High Availability for Exchange 2007 : Design Edge Transport and Unified Messaging High Availability
    ROG G55VW Gaming Laptop
    The Best iPad Cases
    Troubleshooting Reference : Tablets & Smartphones
    Externalizing BLOB Storage in SharePoint 2010 (part 1)
    Dell Inspiron 14R 5420 Review (Part 1)
    Top 10 Smartphones August – September (Part 1) - Samsung Galaxy S III, HTC One X, Apple iPhone 4S,Nokia Lumia 800,Sony Xperia S
    H8-1090D Desktop PC - Elite Class
    Ditch Your Laptop For Your Phone (Part 2)
    Algorithms for Compiler Design: THE ARRAY REFERENCE
    Managing SharePoint 2010 Data : Content Types
    Seagate Backup Plus Portable HDD
    Samsung LED TV ES8000 - The SMART in Smart TV
    Lenovo IdeaPad Z580 - Keeps Up The Tradition
    Windows Server 2008 Server Core : Working with Scripts - Using the Scripting Objects