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
    Mobile Application Security : The Apple iPhone - Push Notifications, Copy/Paste, and Other IPC
    Exploring the T-SQL Enhancements in SQL Server 2005 : The WAITFOR Command
    Parallel Programming with Microsoft .Net : Parallel Aggregation - Variations
    Optimizing an Exchange Server 2010 Environment : Analyzing Capacity and Performance
    Programming .NET Security : Hashing Algorithms Explained
    Sharepoint 2007: Specify Your Colleagues
    Algorithms for Compiler Design: THE NFA WITH ∈-MOVES
    Choosing The Right Parts For Your Build (Part 1) - Picking the perfect processor
    Choosing The Right Parts For Your Build (Part 5) - Choosing your case & Picking the right storage
    SQL Server 2008 : Leveraging the Microsoft Sync Framework
    Most View
    Legal Trouble with Social Networks (Part 1)
    The choices of mobile computing for SOHO users (part 2)
    Infrastructure Security: The Application Level
    Sharepoint 2007: Create a New List Item
    SQL Azure Data Access
    Getting Started with MySQL Enterprise & MySQL Enterprise Components
    iPhone Application Development : Using Advanced Interface Objects and Views - User Input and Output
    How to Protect Your Mobile Devices
    Joomla! Blogging and RSS Feeds : Commenting anyone?
    The Second BlackBerry Developers Conference Asia (Part 2)
    Windows Azure : Understanding the Blob Service
    Windows Server 2008 : Understanding the Identity Management for UNIX Components
    Migrating from Legacy SharePoint to SharePoint Server 2010 : Using Visual Upgrade
    Designing and Implementing Mobility in Exchange Server 2010 : Securing Access to ActiveSync Using Internet Security and Acceleration (ISA) Server 2006
    SQL Server 2008 : Explaining Advanced Query Techniques - Creating CTEs
    Configuring Server Roles in Windows 2008 : New Roles in 2008
    Mass Effect Infiltrator
    iPhone 3D Programming : Anti-Aliasing Tricks with Offscreen FBOs (part 1) - A Super Simple Sample App for Supersampling
    Changes in Windows Vista Affecting SDI
    Search for a File or Directory