Product SiteDocumentation Site

Chapter 9. KVM Para-virtualized Drivers

9.1. Installing the KVM Windows para-virtualized drivers
Para-virtualized drivers are available for virtualized Windows guests running on KVM hosts. These para-virtualized drivers are included in the virtio package. The virtio package supports block (storage) devices and network interface controllers.
Para-virtualized drivers enhance the performance of fully virtualized guests. With the para-virtualized drivers guest I/O latency decreases and throughput increases to near bare-metal levels. It is recommended to use the para-virtualized drivers for fully virtualized guests running I/O heavy tasks and applications.
The KVM para-virtualized drivers are automatically loaded and installed on newer versions of Fedora. Those Fedora versions detect and install the drivers so additional installation steps are not required.
As with the KVM module, the virtio drivers are only available on hosts running newer versions of Fedora.

Note

There are only 28 PCI slots available for additional devices per guest. Every para-virtualized network or block device uses one slot. Each guest can use up to 28 additional devices made up of any combination of para-virtualized network, para-virtualized disk devices, or other PCI devices using VTd.
The following Microsoft Windows versions have supported KVM para-virtualized drivers:

9.1. Installing the KVM Windows para-virtualized drivers

This section covers the installation process for the KVM Windows para-virtualized drivers. The KVM para-virtualized drivers can be loaded during the Windows installation or installed after the guest is installed.
You can install the para-virtualized drivers on your guest by one of the following methods:
  • hosting the installation files on a network accessible to the guest,
  • using a virtualized CD-ROM device of the driver installation disk .iso file, or
  • using a virtualized floppy device to install the drivers during boot time (for Windows guests).
This guide describes installation from the para-virtualized installer disk as a virtualized CD-ROM device.
  1. Download the drivers

    The drivers are available from Microsoft (windowsservercatalog.com).
    The virtio-win package installs a CD-ROM image, virtio-win.iso, in the /usr/share/virtio-win/ directory.
  2. Install the para-virtualized drivers

    It is recommended to install the drivers on the guest before attaching or modifying a device to use the para-virtualized drivers.
    For block devices storing root file systems or other block devices required for booting the guest, the drivers must be installed before the device is modified. If the drivers are not installed on the guest and the driver is set to the virtio driver the guest will not boot.
Mounting the image with virt-manager
Follow Procedure 9.1, “Using virt-manager to mount a CD-ROM image for a Windows guest” to add a CD-ROM image with virt-manager.
Procedure 9.1. Using virt-manager to mount a CD-ROM image for a Windows guest
  1. Open virt-manager, select your virtualized guest from the list of virtual machines and press the Details button.
  2. Click the Add button in the Details panel.
  3. This opens a wizard for adding the new device. Select Storage device from the drop down menu, then click Forward.
  4. Choose the File (disk image) option and set the file location of the para-virtualized drivers .iso file. The location of the .iso files is /usr/share/xenpv-win if you used yum to install the para-virtualized driver packages.
    If the drivers are stored physical CD, use the Normal Disk Partition option.
    Set the Device type to IDE cdrom and click Forward to proceed.
  5. The disk has been assigned and is available for the guest once the guest is started. Click Finish to close the wizard or back if you made a mistake.
Installing with a virtualized floppy disk
This procedure covers installing the para-virtualized drivers during a Windows installation.
  • Upon installing the Windows VM for the first time using the run-once menu attach viostor.vfd as a floppy
    1. Windows Server 2003

      When windows prompts to press F6 for third party drivers, do so and follow the onscreen instructions.
    2. Windows Server 2008

      When the installer prompts you for the driver, click on "Load Driver", point the installer to drive A: and pick the driver that suits your OS and bittage
Using KVM para-virtualized drivers for existing devices
Modify an existing hard disk device attached to the guest to use the virtio driver instead of virtualized IDE driver. This example edits libvirt configuration files. Alternatively, virt-manager, virsh attach-disk or virsh attach-interface can add a new device using the para-virtualized drivers Using KVM para-virtualized drivers for new devices.
  1. Below is a file-based block device using the virtualized IDE driver. This is a typical entry for a virtualized guest not using the para-virtualized drivers.
    <disk type='file' device='disk'>
       <source file='/var/lib/libvirt/images/disk1.img'/>
       <target dev='hda' bus='ide'/>
    </disk>
    
  2. Change the entry to use the para-virtualized device by modifying the bus= entry to virtio.
    <disk type='file' device='disk'>
       <source file='/var/lib/libvirt/images/disk1.img'/>
       <target dev='hda' bus='virtio'/>
    </disk>
    
Using KVM para-virtualized drivers for new devices
This procedure covers creating new devices using the KVM para-virtualized drivers with virt-manager.
Alternatively, the virsh attach-disk or virsh attach-interface commands can be used to attach devices using the para-virtualized drivers.

Install the drivers first

Ensure the drivers have been installed on the Windows guest before proceeding to install new devices. If the drivers are unavailable the device will not be recognized and will not work.
  1. Open the virtualized guest by double clicking on the name of the guest in virt-manager.
  2. Open the Hardware tab.
  3. Press the Add Hardware button.
  4. In the Adding Virtual Hardware tab select Storage or Network for the type of device.
    1. New disk devices
      Select the storage device or file based image. Select Virtio Disk as the Device type and press Forward.
    2. New network devices
      Select Virtual network or Shared physical device. Select virtio as the Device type and press Forward.
  5. Press Finish to save the device.
  6. Reboot the guest. The device may to be recognized by the Windows guest until it restarts.