Using Xen Full Virtualization to Run Windows on CentOS

From Techotopia
Jump to: navigation, search
PreviousTable of ContentsNext
Installing and Configuring CentOS Xen VirtualizationManaging and Monitoring CentOS based Xen Guest Systems


Purchase and download the fully updated CentOS 6 Edition of this eBook in PDF, ePub & Kindle formats for only $9.99
Kindle/ePub/PDF edition contains 39 chapters and over 240 pages.

Buy eBook


In this chapter of CentOS Essentials we will continue to explore Xen virtualization on CentOS systems. In the chapter entitled Installing and Configuring CentOS Xen Virtualization, the difference between full-virtualization and para-virtualization was explained together with a tutorial on how to create and run a para-virtualized virtual machine containing another Linux distribution as a guest operating system.

The goal of this chapter is to provide a tutorial that takes the reader through the steps involved in using Xen to run Windows as a guest operation system on a CentOS system using full-virtualization.

This chapter assumes that a Xen-enabled kernel and associated tools are installed and that the Xen kernel is the currently running kernel. If this is not the case, refer to Installing and Configuring CentOS Xen Virtualization before proceeding with the remainder of this chapter.




Hardware Requirements for Xen-based Full Virtualization on CentOS

Although this topic was covered in the preceding chapter, the importance of having the correct hardware support is such that it warrants a second mention. Xen based full-virtualization is only supported on processors with Intel-VT or AMD-V support.

The presence of appropriate CPU support can be verified using one the following commands depending on the brand of CPU:

For Intel CPUs:

grep vmx /proc/cpuinfo

For AMD CPUSs:

grep svm /proc/cpuinfo

If no output appears from the appropriate command then either your CPU does not support full-virtualization or support is available but turned off in the BIOS. In the latter instance, reboot your system and enter the system BIOS settings to verify that it is enabled.

Preparing the Installation Image

Unlike para-virtualization, full virtualization allows a guest operating system to be installed either from a local ISO image, a mounted installation media (such as CDROM or DVD drive) or via PXE based network boot. If you have the required Windows installation media available, insert it into the physical disk drive of your CentOS system. Alternatively, download the ISO installation image from your operating system provider and make a note of its location on the CentOS file system.


Creating the New Virtual Machine

Arguably the most convenient way to create a virtual machine is using the Virtual Machine Manager tool which may be launched using the desktop’s Application -> System Tools -> Virtual Machine Manager menu option.

Once launched the main window will appear listing Domain-0 (the host system) and any previously created virtual machines:


The CentOS Virtual Machine Manager


Within this dialog select the top entry in the list representing the host machine (in the above figure this is the line highlighted in blue and named centos5) and click on the New button located in the bottom right of the window. This will launch the New Virtual Machine wizard which will appear with a welcome screen. Click the Forward button to proceed to the Virtual Machine Name screen. In the text box provided, enter an appropriate name for the new virtual machine. For the purposes of this tutorial we will use the name WindowsVM. Click Forward to proceed.

Configuring Xen Virtualization Method

The next screen displayed by the new virtual machine will provide the option to choose the method of virtualization. Since we plan to install an unmodified guest in the form of Windows we will need to select the Full Virtualization method. If this option is disabled the most likely cause is that either the system CPU does not include the required virtualization features, or that they are currently disabled in the BIOS. Assuming the option is not disabled, select Full Virtualization and ensure that Xen is selected from the Hypervisor menu:


Selecting Full Virtualization for a CentOS Xen-based guest


Once the new VM is configured to use Xen full virtualization, click Forward to proceed.

Selecting Installation Media

The Installation Method screen allows the installation media for the guest operating system to be specified in the form of a CDROM/DVD device, an ISO image of a CDROM or DVD or a network server configured for PXE network boot installation. Select the appropriate option and then choose the operating system type and variant. For the purposes of this tutorial we will be installing Windows 7. At the time of writing, however, Windows 7 is not listed as an option in the wizard. We can, however, safely select Windows Vista instead:


The CentOS Xen guest operating type selection screen


On the following screen, specify the path to the ISO image, optical media device or network PXE server and click the Forward button.

Configuring Storage

If you have a disk partition available for the guest operating system, enter the device path into the Block device (partition) text field. Otherwise, select File (disk image), enter the path of the file to be created (or accept the default provided) and select a file size (keeping in mind the space requirements for your chosen guest OS). Having defined these settings, click the Forward key once more to proceed.

Configuring Network Access

On the Connect to network host select Shared physical device and click Forward. This will configure the guest OS to share the host operating system's network connection.

CPU and Memory Allocation

The next screen allows configuration of memory and CPU usage of the guest virtual machine:


Configuring CPU and memory settings for a CentOS Xen Windows VM


Select a memory setting that allows sufficient memory for the host system and the guest system to co-exist. If you plan to run multiple guest operating systems, be sure to allow for this.

On a multi-CPU or multi-core CPU environment it is possible to define how many CPUs the guest OS will have access to. Note that whilst it is possible to assign more virtual CPUs than the number physical CPUs doing so is not recommended. The final screen displays a summary of the configuration:


The Summary screen for a Xen Full Virtualization Virtual Machine


Creating and Starting the New Xen Virtual Machine

Clicking on the Finish button will start the virtual machine creation process. This involves configuring the storage and accessing the installation media. A dialog containing a progress bar will provide a status update on the creation process as it is performed. Once the virtual machine has been created the virtual machine will be launched and appear the virtual machine console window. From this point on simply follow the installation process for the guest operating system. 


Purchase and download the fully updated CentOS 6 Edition of this eBook in PDF, ePub & Kindle formats for only $9.99
Kindle/ePub/PDF edition contains 39 chapters and over 240 pages.

Buy eBook



PreviousTable of ContentsNext
Installing and Configuring CentOS Xen VirtualizationManaging and Monitoring CentOS based Xen Guest Systems