Windows Guest Virtual Machines on Red Hat Enterprise Linux 7
Table of Contents
- Installing a Fully-virtualized Windows Guest
- Tips for More Efficiency with Windows Guest Virtual Machines
- Using libguestfs with Windows Virtual Machines
- KVM Paravirtualized (virtio) Drivers
- Installing the KVM Windows virtio Drivers
- Installing the Drivers on an Installed Windows Guest Virtual machine
- Installing Drivers During the Windows Installation
Important: On Red Hat Enterprise Linux 7, Windows guest virtual machines are supported only under specific subscription programs, such as Advanced Mission Critical (AMC). If you are unsure whether your subscription model includes support for Windows guests, contact customer support.
This article provides information for those subscription programs under which Windows guest virtual machines are supported in Red Hat Enterprise Linux 7.
Installing a Fully-virtualized Windows Guest
This section describes how to create a fully-virtualized Windows guest, launch the operating system's installer inside the guest, and access the installer using virt-viewer.
To install a Windows operating system on the guest, use the virt-viewer tool. This tool allows you to display the graphical console of a virtual machine (using the VNC protocol). As such, virt-viewer
allows you to install a fully-virtualized guest's operating system using that operating system's installer (for example, the Windows 10 installer).
Installing a Windows operating system involves two major steps:
- Creating the guest virtual machine, using either
virt-install
orvirt-manager
. For more information on creating a guest virtual machine, refer to Installing a Virtual Machine. - Installing the Windows operating system on the guest virtual machine, using
virt-viewer
.
For information on how to install a Windows operating system, refer to the relevant Microsoft installation documentation.
Before creating the guest, consider if the guest needs to use KVM Windows paravirtualized (virtio) drivers. If it does, keep in mind that you install the virtio drivers during or after installing the Windows operating system on the guest. For more information about virtio drivers, refer to KVM Paravirtualized Drivers below.
Tips for More Efficiency with Windows Guest Virtual Machines
The following flags should be set with libvirt to make sure the Windows guest virtual machine works efficiently:
- hv_relaxed
- hv_spinlocks=0x1fff
- hv_vapic
- hv_time
Using libguestfs with Windows Virtual Machines
To use libguestfs
with Windows guest virtual machines, install libguestfs-winsupport:
$ sudo yum install libguestfs-tools libguestfs-winsupport
KVM Paravirtualized (virtio) Drivers
Paravirtualized drivers enhance the performance of guests, decreasing guest I/O latency and increasing throughput to near bare-metal levels. It is recommended to use the paravirtualized drivers for fully virtualized guests running I/O heavy tasks and applications.
virtio drivers are KVM's paravirtualized device drivers, available for Windows guest virtual machines running on KVM hosts. These drivers are included in the virtio-win package. The virtio-win package supports block (storage) devices, network interface controllers, video controllers, memory ballooning device, paravirtual serial port device, entropy source device, paravirtual panic device, and a small set of emulated devices.
Note: Refer to Guest Virtual Machine Device Configuration for additional information about emulated, virtio, and assigned devices.
Using KVM virtio drivers, the following Microsoft Windows versions are expected to run similarly to bare-metal-based systems:
-
Windows Server versions: See Certified guest operating systems for Red Hat Enterprise Linux with KVM
-
Windows Desktop (non-server) versions:
- Windows 7 (32-bit and 64-bit versions)
- Windows 8 (32-bit and 64-bit versions)
- Windows 8.1 (32-bit and 64-bit versions)
- Windows 10 (32-bit and 64-bit versions)
Note: Network connectivity issues sometimes arise when attempting to use older virtio drivers with newer versions of QEMU. Keeping the drivers up to date is therefore recommended.
Installing the KVM Windows virtio Drivers
This section covers the installation process for the KVM Windows virtio drivers. The KVM virtio drivers can be loaded during the Windows installation or installed after the guest's installation.
You can install the virtio drivers on a guest virtual machine using one of the following methods:
- hosting the installation files on a network accessible to the virtual machine
- using a virtualized CD-ROM device of the driver installation disk
.iso
file - using a USB drive, by mounting the same (provided)
.iso
file that you would use for the CD-ROM - using a virtualized floppy device to install the drivers during boot time (required and recommended only for Windows Server 2003)
This procedure describes installation from the paravirtualized installer disk as a virtualized CD-ROM device.
-
Download the drivers
The virtio-win package contains the virtio (block, network, and other) drivers for all supported Windows guest virtual machines.
Note: The virtio-win package can be found here. Search for virtio-win and click Download Latest. It requires access to one of the following channels:- RHEL Client Supplementary (v. 7)
- RHEL Server Supplementary (v. 7)
- RHEL Workstation Supplementary (v. 7)
Download and install the virtio-win package on the host with the
yum
command.$ sudo yum install virtio-win
The list of virtio-win packages that are supported on Windows operating systems, and the current certified package version, can be found here.
Note that the Red Hat Virtualization Hypervisor and Red Hat Enterprise Linux are created on the same code base, so the drivers for the same version (for example, Red Hat Virtualization Hypervisor 4.0 and Red Hat Enterprise Linux 7.3) are supported for both environments.
The virtio-win package installs a CD-ROM image,
virtio-win.iso
, in the/usr/share/virtio-win/
directory. -
Install the virtio drivers
When booting a Windows guest that uses virtio storage devices, the relevant virtio device drivers must already be installed on this guest. The virtio drivers are not provided as inbox drivers in Microsoft's Windows installation kit, so installation of a Windows guest on a virtio storage device (
viostor/virtio-scsi
) requires that you provide the appropriate driver during the installation, either directly from thevirtio-win.iso
or from the supplied Virtual Floppy imagevirtio-win<
version>_<
arch>.vfd
.
Installing the Drivers on an Installed Windows Guest Virtual machine
This procedure describes installing the virtio drivers with a virtualized CD-ROM after Windows is installed.
Follow this procedure to add a CD-ROM image with virt-manager and then install the drivers.
-
Open virt-manager and the guest virtual machine
Open virt-manager, then open the guest virtual machine from the list by double-clicking the guest name.
-
Open the hardware window
Click
on the toolbar at the top of the window to view virtual hardware details.
Click Add Hardware at the bottom of the new view that appears.
A wizard opens for adding the new device.
-
Select the ISO file
Ensure that the Select managed or other existing storage radio button is selected, and browse to the virtio driver's
.iso
image file. The default location for the latest version of the drivers is/usr/share/virtio-win/virtio-win.iso
.Change the Device type to IDE cdrom and click Forward to proceed.
-
Reboot
Reboot or start the virtual machine to begin using the driver disk. Virtualized IDE devices require a restart to for the virtual machine to recognize the new device.
-
Open the Device Manager
For information on opening Device Manager, refer to the Windows documentation.
-
Start the driver update wizard
-
View available devices
Expand Other devices by clicking the arrow to its left.
-
Locate the appropriate device
There are up to eight devices available: the memory ballooning device, the paravirtual serial port device, the network device, the block device, the SCSI block device, the entropy source device, the emulated PCI serial port device, and the paravirtual panic device. Additionally, the video device is available in the Display adapters group.
- Balloon, the balloon driver, applies to PCI Device in the Other devices group
- vioserial, the paravirtual serial driver, applies to PCI Simple Communications Controller in the Other devices group.
- NetKVM, the network driver, applies to Ethernet Controller in the Other devices group. This driver is only available if a virtio NIC is configured. Configurable parameters for this driver are documented in Appendix E, NetKVM Driver Parameters.
- viostor, the block driver, applies to SCSI Controller in the Other devices group.
- viocsci, the SCSI block driver, applies to SCSI Controller in the Other devices group.
- viorng, the entropy source driver, applies to PCI Device in the Other devices group.
- qemupciserial, the emulated PCI serial driver, applies to PCI Serial Port in the Other devices group.
- qxl, the paravirtual video driver, applied to Microsoft Basic Display Adapter in the Display adapters group.
-
pvpanic, the paravirtual panic driver, applies to Unknown device in the Other devices group.
Note: Both the memory balloon and entropy source devices are initially represented by PCI Device in the Other devices group. Similarly, both block devices are represented by SCSI Controller. Use the following procedure to tell them apart.
Right-click the device that you wish to identify and select the Details tab. Select the Hardware Ids property in the list. Match the hardware ID with one of the IDs below:
VEN_1AF4&DEV_1002
orVEN_1AF4&DEV_1045
, the balloon device.VEN_1AF4&DEV_1003
orVEN_1AF4&DEV_1043
, the paravirtual serial port device.VEN_1AF4&DEV_1000
orVEN_1AF4&DEV_1041
, the network device.VEN_1AF4&DEV_1001
orVEN_1AF4&DEV_1042
, the block device.VEN_1AF4&DEV_1004
orVEN_1AF4&DEV_1048
, the SCSI block device.VEN_1AF4&DEV_1005
orVEN_1AF4&DEV_1044
, the entropy source device.VEN_1B36&DEV_0002
, the emulated PCI serial driver.VEN_1B36&DEV_0100
, the video device.VEN_QEMU&DEV_0001
, the guest panic device.
Right-click the device whose driver you wish to update, and select Update Driver from the pop-up menu.
This example installs the balloon driver, so right-click PCI Device.
-
Open the driver update wizard
From the drop-down menu, select Update Driver Software to access the driver update wizard.
-
-
Specify how to find the driver
The first page of the driver update wizard asks how you want to search for driver software. Click Browse my computer for driver software.
-
Select the driver to install
-
Open a file browser
Click Browse.
-
Browse to the location of the driver
A separate driver is provided for each combination of operating systems and architectures. The drivers are arranged hierarchically according to their driver type, the operating system, and the architecture on which they will be installed:
driver_type/os/arch/
.For example, the Balloon driver for a Windows 10 operating system with an x86 (32-bit) architecture, resides in the
Balloon/w10/x86
directory.Once you have navigated to the correct location, click OK.
-
Click Next to continue
The following screen is displayed while the driver installs:
-
-
Close the installer
The following screen is displayed when installation is complete:
Click Close to close the installer.
-
Reboot
Reboot the virtual machine to complete the driver installation.
Note: After the driver is successfully installed, the device no longer appears in the Other devices group. Find the device in the Multifunction adapters
group (1x QEMU PCI Serial Card), Network adapters group (Red Hat VirtIO Ethernet Adapter), Storage controllers group (Red Hat VirtIO SCSI controller and Red Hat VirtIO SCSI pass-through controller), and System devices group (QEMU PVPanic Device, VirtIO Balloon Driver, VirtIO RNG Device, and VirtIO
Serial Driver).
Installing Drivers During the Windows Installation
You can install the virtio drivers during a Windows installation.
This method allows a Windows guest virtual machine to use the virtio drivers for the default storage device.
-
Install the virtio-win package
$ sudo yum install virtio-win
Note: The virtio-win package can be found here. Search for virtio-win and click Download Latest
It requires access to one of the following channels:
- RHEL Client Supplementary (v. 7)
- RHEL Server Supplementary (v. 7)
- RHEL Workstation Supplementary (v. 7)
-
Creating the guest virtual machine
Important: Create the virtual machine, as normal, without starting the virtual machine. Follow one of the procedures below.
Select one of the following guest-creation methods, and follow the instructions.
-
Create the guest virtual machine with
virsh
This method attaches the virtio driver floppy disk to a Windows guest before the installation.
If the virtual machine is created from an XML definition file with
virsh
, use thevirsh define
command not thevirsh create
command.-
Create, but do not start, the virtual machine. Refer to Defining a Guest Virtual Machine with an XML File for details on creating virtual machines with the
virsh
command. -
Add the driver disk as a virtualized floppy disk with the
virsh
command. This example can be copied and used if there are no other virtualized floppy devices attached to the guest virtual machine. Note that vm_name should be replaced with the name of the virtual machine and arch with the Windows architecture,x86
oramd64
.$ sudo virsh attach-disk *vm_name* /usr/share/virtio-win/virtio-win_*arch*.vfd fda --type floppy
Continue with step 3.
-
-
Create the guest virtual machine with virt-manager and change the disk type
-
At the final step of the virt-manager guest creation wizard, check the Customize configuration before install checkbox.
Click Finish.
-
Open the Add Hardware wizard
Click Add Hardware in the bottom left of the new panel.
-
Select storage device
Storage is the default selection in the Hardware type list.
Ensure that the Select managed or other existing storage radio button is selected.
Click Browse.
In the window that opens, click Browse Local.
Navigate to
/usr/share/virtio-win/virtio-win_*arch*.vfd
, and click Select to confirm.Change Device type to Floppy disk.
Click Finish to continue.
-
Confirm settings
Review the device settings.
You have now created a removable device accessible by your virtual machine.
-
Change the hard disk type
Select the disk and click Remove.
Add a new virtual storage device by clicking Add Hardware.
Change the Device type from IDE disk to Virtio Disk.
Click Finish to confirm the operation.
-
Ensure settings are correct
Review the settings for VirtIO Disk 1.
When you are satisfied with the configuration details, click Begin Installation.
Continue with step 3.
-
-
Create the guest virtual machine with
virt-install
Append the following parameter below to add the driver disk to the installation with the
virt-install
command:--disk path=/usr/share/virtio-win/virtio-win_*arch*.vfd,device=floppy
Important: If the device you want to add is a disk (that is, not a floppy disk or a CD-ROM), you will also need to add the
bus=virtio
option to the end of the--disk
parameter:--disk path=/usr/share/virtio-win/virtio-win_*arch*.vfd,device=disk,bus=virtio
Based on the version of Windows you are installing, append the relevant option to the
virt-install
command. For a list of Windows versions and the appropriate option, run the following command:osinfo-query os
The following is an example of the option for Windows 10:
--os-variant win10
-
-
Additional steps for driver installation
During the installation, additional steps are required to install drivers.
For information on installing these drivers, refer to the documentation for the version of Windows that you are installing.
NetKVM Driver Parameters
After the NetKVM driver is installed, you can configure it to better suit your environment. The parameters listed in this section can be configured in Windows Device Manager (devmgmt.msc
).
Important: Modifying the driver's parameters causes Windows to re-load that driver. This interrupts existing network activity.
Configuring NetKVM Parameters
To configure NetKVM Parameters:
-
Open Device Manager
For information on opening Device Manager, refer to the Windows documentation.
-
Locate the correct device
In the Device Manager window, click + next to Network adapters.
Under the list of network adapters, double-click Red Hat VirtIO Ethernet Adapter. The Properties window for the device opens.
-
View device parameters
In the Properties window, click the Advanced tab.
-
Modify device parameters
Click the parameter you want to modify. Options for that parameter are displayed.
Modify the options as needed.
Click OK to save the changes.
Configurable NetKVM Parameters
This section provides information about the configurable NetKVM parameters.
Logging parameters
-
Logging.Enable
A Boolean value that determines whether logging is enabled. The default value is Enabled.
-
Logging.Level
An integer that defines the logging level. As the integer increases, so does the verbosity of the log. The default value is
0
(errors only).1
-2
adds configuration messages.3
-4
adds packet flow information.5
-6
adds interrupt and DPC level trace information.Important: High logging levels will slow down your guest virtual machine.
-
Logging.Statistics(sec)
An integer that defines whether log statistics are printed, and the time in seconds between each periodical statistics printout. The default value is
0
(no logging statistics).
Initial parameters
-
Assign MAC
A string that defines the locally-administered MAC address for the paravirtualized NIC. This is not set by default.
-
Init.ConnectionRate(Mb)
An integer that represents the connection rate in megabits per second. The default value for Windows 2008 and later is
10G
(10,000 megabits per second). -
Init.Do802.1PQ
A Boolean value that enables Priority/VLAN tag population and removal support. The default value is Enabled.
-
Init.MTUSize
An integer that defines the maximum transmission unit (MTU). The default value is
1500
. Any value from500
to65500
is acceptable. -
Init.MaxTxBuffers
An integer that represents the number of TX ring descriptors that will be allocated. The default value is
1024
. Valid values are:16
,32
,64
,128
,256
,512
, or1024
. -
Init.MaxRxBuffers
An integer that represents the number of RX ring descriptors that will be allocated. The default value is
256
. Valid values are:16
,32
,64
,128
,256
,512
, or1024
. -
Offload.Tx.Checksum
Specifies the TX checksum offloading mode.
In Red Hat Enterprise Linux 7, the valid values for this parameter are:
All
(the default) which enables IP, TCP, and UDP checksum offloading for both IPv4 and IPv6TCP/UDP(v4,v6)
which enables TCP and UDP checksum offloading for both IPv4 and IPv6TCP/UDP(v4)
which enables TCP and UDP checksum offloading for IPv4 onlyTCP(v4)
which enables only TCP checksum offloading for IPv4 only
-
Offload.Tx.LSO
A Boolean value that enables TX TCP Large Segment Offload (LSO). The default value is
Maximal
. -
Offload.Rx.Checksum
Specifies the RX checksum offloading mode.
In Red Hat Enterprise Linux 7, the valid values for this parameter are:
All
(the default) which enables IP, TCP, and UDP checksum offloading for both IPv4 and IPv6TCP/UDP(v4,v6)
which enables TCP and UDP checksum offloading for both IPv4 and IPv6TCP/UDP(v4)
which enables TCP and UDP checksum offloading for IPv4 onlyTCP(v4)
which enables only TCP checksum offloading for IPv4 only
Test and debug parameters
Important: Test and debug parameters should only be used for testing or debugging; they should not be used in production. Changes to any of the following parameters are not supported.
-
TestOnly.RXThrottle
An integer that determines the number of receive packets handled in a single DPC. The default value is
1000
.
Known Issues
-
Due to a Windows bug that causes incompatibility with SeaBIOS, Windows 10 RS1 and Windows Server 2016 guest virtual machines running on the KVM hypervisor are currently unable to generate a kernel crash dump. To work around this problem, do the following:
- Update the SeaBIOS version:
- For RHEL 7.3: seabios-1.9.1-5.el7_3.1 or later
- For RHEL 7.4: seabios-1.10.1-1.el7 or later
- Avoid using the cirrus virtual video adapter. (BZ#1377575)
- Update the SeaBIOS version:
-
Guests with Windows 8 and later OS that use virtio-blk storage and were installed on a Red Hat Enterprise 6 host currently cannot boot on a Red Hat Enterprise Linux 7 host. To work around this problem, use a different storage type, such as IDE. Note, however, that using a different storage type has a negative impact on storage performance. For an alternate workaround, see Windows Support Case 2795397. (BZ#1523097)
Comments