Running Windows on Fedora Using KVM Virtualization

From Techotopia
Revision as of 20:43, 1 February 2008 by Neil (Talk | contribs)

Jump to: navigation, search
PreviousTable of ContentsNext
Installing a Xen Guest OS from the Command-line (virt-install)Managing and Monitoring Fedora based KVM Guest Systems


In (Installing Fedora Linux on a Windows System (Dual booting)) we looked at partitioning a disk so that both Windows and Linux could reside on a hard drive. The concept behind this configuration was thaty of creating a dual boot environment. The problem with dual boot environments is that only one operating system can run at any one time. If you are running Linux and need to run Windows you have to shutdown Linux and boot from Windows.

One of the advantages of virtualization is that it makes it possible to run Windows in a virtual machine on top of a running Linux system. This means that it is possible to have both operating systems running concurrently on the computer system without need to shut one down and boot another.

In this chapter of Fedora Linux Essentials we will cover in detail every step necessary to install and run Windows inside a KVM virtual machine on Fedora Linux.


Contents


System Requirements

Before embarking on the configuration outlined in this chapter it is important to understand some hardware requirements. Unlike a dual booting environment a virtualized environment involves the running of two complete operating systems concurrently on a single computer system. This means that the system must have enough physical memory, disk space and CPU processing power to comfortably accommodate both systems in parallel. Before beginning configuration and installation process check on the minimum system requirements for both Fedora Linux and your chosen Windows version and verify that your system has sufficient resources to handle the requirements of both systems.

Preparing Fedora for KVM Virtualization

KVM support is pre-built into the Fedora Linux kernel for Fedora release 7 and later. As a result KVM support is already available in the standard kernel avoiding the necessity to install and boot from a special kernel.

The tools required to setup and maintain virtualized system are not, however, installed by default. To fully utilize the KVM support built into the kernel the following packages are required:

  • kvm
  • virt-manager
  • qemu

Check to find out if these packages are already installed on your system by running the following commands:

rpm -q qemu kvm virt-manager

If any of these packages are reported as not installed they may be installed using the yum package manager:

su -
yum install kvm qemu virt-manager

This command will install all the required packages. All that is required to enable KVM support at this point is to reboot the system. When the re-boot has completed, log in as usual.


Building a Fedora KVM Virtual System

Virtual systems can easily be configured using either the virt-install command-line tool, or the virt-manager GUI tool. For the purposes of this chapter we will use the virt-manager tool.

Begin by launching virt-manager either by selecting the Applications->System Tools->Virtual Machine Manager or from the command-line by running /usr/sbin/virt-manager. Once loaded, the virtual manager will display the following screen:

The KVM Virtual Machine Manager Main Screen

The main virt-manager screen lists the current virtual machines running on the system. At this point there should only be one, the host system. Connect to the host system by right clicking on the entry in the list and selecting Connect from the popup menu. The Status field for this VM should now change to Active, and the New and Details buttons at the bottom of the dialog should be enabled.

To create a new virtual system, click on the New button to display the first configuration screen. Click the Forward button to proceed to the Naming screen and enter a name for the virtual system can be any name you choose. Clicking Forward once more will display the virtualization options screen. As KVM supports only full virtualization this is the sole option on this screen.

Configuring the KVM Virtual System

On the next page, you can choose where the installation media can be found for this virtual system. Options include CDROM or ISO image. You can also choose whether you plan to install Windows or Linux into the virtual system. Select Windows from the OS Type menu and your Windows version from the OS Variant menu. The following figure shows the screen configured for Windows XP.

Selecting KVM virtual system configuration options for Windows XP

Once an appropriate configuration has been entered, click the next button to assign storage space:

Assigning Storage Space for a KVM Guest System

If you have a disk partition available for the guest operating system, enter the device path. Otherwise, select Simple file, enter the path of the file to be created and select a file size (keeping in mind the space requirements for your chosen guest OS). Click the Forward key once more, configure your networking options and click the Forward button once again.

The next screen allows configuration of memory and CPU usage:

KVM memory and CPU settings

Setting the startup memory lower than the maximum will configure the system to allocate the minimum specified memory at start up and then acquire more as needed until the maximum is reached.

Select a memory setting which 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. The final screen displays a summary of the configuration:

KVM Windows settings summary

Starting the KVM Virtual System

Click on the Finish button to begin the creation process. The virtualization manager will create the disk and configure KVM before starting the system. Once started, the guest OS installation will begin:

Fedora kvm windows install.jpg

From this point on, simply follow the operating installation instructions to install the guest OS.

For information on starting, stopping, configuring and monitoring your Windows guest system read the chapter entitled Managing and Monitoring Fedora based KVM Guest Systems.



PreviousTable of ContentsNext
Installing a Xen Guest OS from the Command-line (virt-install)Managing and Monitoring Fedora based KVM Guest Systems