Installing Virtio Drivers In Windows On KVM

布满荆棘的人生 2024-04-19 15:30 161阅读 0赞

Installing Virtio Drivers In Windows On KVM

3rd July 2018

Virtio drivers are paravirtualized device drivers for KVM virtual machines.

Paravirtualized drivers enhance the performance of machines, decreasing I/O latency and increasing throughput to near bare-metal levels.

It is recommended to use the paravirtualized drivers for fully virtualized machines.

Most Linux distributions include the virtio drivers as standard. This guide explains how to install them in Windows.

This guide was written for Zetastack users but applies to any Windows guest VM running on a KVM host.

This includes Nutanix, Red Hat Virtualization (RHEV), Proxmox VE, oVirt and OpenStack.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70

If your device manager looks like this, then this guide will help you.


Download ISO

We recommend the stable release, the same as what is shipped with Red Hat Enterprise Linux.

This is the link to download:

https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso

Download and add the ISO to your virtualization platform.

In Zetastack this is done in Settings Import.


Machine Configuration

Edit the machine configuration and set these:

  • Disk bus: Virtio SCSI pass-through controller
  • NIC model: Virtio Ethernet
  • Video model: QXL
  • Video RAM: 32MB

Attach ISO

This bit depends on whether you are installing a new Windows VM or you already have an existing Windows VM.

If you are installing a new Windows VM, set the ISO to be the2nd CD-ROM driveleaving the Windows install ISO as the 1st CD-ROM drive.


Begin Install

If you are not installing a new Windows VM, you can skip this section.

Storage Driver

At the disk detection stage, the Windows installer cannot detect any disks for installation.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 1

This is expected behaviour, since the virtio drivers have not been loaded yet and are not included by Microsoft in the installation media.

Click “Load driver” and select “CD Drive (E:) virtio-win-0.1.1”

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 2

The driver required is the “VirtIO SCSI pass-through controller” located at:

E:\vioscsi\2k16\amd64\vioscsi.inf

For other editions of Windows, the driver will be located in the relevant directory on the ISO.

Select the driver and click “Next”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 3

The driver is loaded and the and the disk is now detected.

Select the disk for installation and click “Next”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 4


Post Install

Once the installation is complete and the VM has booted, the next steps are to install the guest agent and resolve any missing drivers.

Guest Agent

It is essential the guest agent is installed.

The guest agent is used by the hypervisor to communicate directly with the VM.

The guest agent is required for clean VM shutdown and to enable live snapshots of the VM images.

On the task bar click “File Explorer”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 5

Select “This PC” then double click “CD Drive (E:) virtio-win-0.1.1”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 6

Open the “guest-agent” folder.

Right click the “qemu-ga-x64” file and select “Install”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 7

The QEMU guest agent will now install.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 8

Once installed the VM must be completely shutdown before the agent can run.

When the VM is started again, the guest agent service will automatically start.


Device Manager

In Device Manager we can see the following unconfigured devices.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 9

This table lists the devices and the drivers required.




































Device

Driver

Storage controller

Virtio SCSI pass-through controller (already installed)

Ethernet controller

Virtio Ethernet adapter

PCI device

Virtio balloon driver

PCI input device

Virtio input driver

PCI simple communications controller

Virtio serial driver

Display adapter

QXL video driver

HID button over interrupt driver

Generic bus

The procedure is simple but repetitive.

Generic Bus

This is a Microsoft bug which is easily resolved.

Right click on “HID Button over Interrupt Driver” and select “Update Driver Software…”

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 10

Select “Browse my computer for driver software”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 11

Select “Let me pick from a list of device drivers on my computer”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 12

Select the model “Generic Bus”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 13

This resolves the bug, and removes the driver warning.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 14


Virtio Ethernet Adapter

This is a high speed driver capable of 10GbE and better.

Right click on “Ethernet Controller” and select “Update Driver Software…”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 15

Select “Browse my computer for driver software”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 16

Select “CD Drive (E:) virtio-win-0.1.1” and click OK.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 17

Device Manager will automatically find the correct driver. The path to the driver does not need to be specified.

At the prompt click “Install”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 18

The driver is installed.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 19

The device description has now changed in Device Manager.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 20


Virtio Balloon Driver

The balloon driver allows the memory in the VM to be changed dynamically.

Right click on “PCI Device” and select “Update Driver Software…”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 21

Follow the same steps for the Ethernet adapter above to complete the driver installation.


Virtio Input Driver

This provides accurate mouse tracking within the console.

Right click on “PCI Input Device” and select “Update Driver Software…”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 10

Follow the same steps for the Ethernet adapter above to complete the driver installation.


Virtio Serial Driver

This is a virtual serial port for communication between the hypervisor and the VM.

Right click on “PCI Simple Communications Controller” and select “Update Driver Software…”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 22

Follow the same steps for the Ethernet adapter above to complete the driver installation.


QXL Video Driver

This is a video driver that improves performance and allows for higher resolutions.

It also provides a seamless cursor when using the console to manage the VM.

Right click on “Microsoft Basic Display Adapter” and select “Update Driver Software…”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 23

Follow the same steps for the Ethernet adapter above to complete the driver installation.


Cursor Tweak

When using the QXL driver, the mouse cursor needs to be tweaked.

This will provide a seamless cursor in web based VM consoles.

On the start menu click “Settings”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 24

Click “Devices”.

20190919153645140.png

Click “Mouse & touchpad”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 25

Click “Additional mouse options”.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 26

In the Pointers tab, enable “Enable pointer shadow” and click OK to update.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2FsbHdheTI_size_16_color_FFFFFF_t_70 27

This allows the use of black and extra large cursors.


This concludes the guide.

发表评论

表情:
评论列表 (有 0 条评论,161人围观)

还没有评论,来说两句吧...

相关阅读

    相关 linux install kvm

    linux install kvm,KVM是在虚拟机和硬件之间加了一个软件层--Hypervisor,或者叫做虚拟机管理程序(VMM),KVM的hypervisor是直接运行在