Zeta Systems Blog
Insights, comments, tips and random ramblings.
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.
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:
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 the 2nd CD-ROM drive leaving 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.
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»
The driver required is the «VirtIO SCSI pass-through controller» located at:
For other editions of Windows, the driver will be located in the relevant directory on the ISO.
Select the driver and click «Next».
The driver is loaded and the and the disk is now detected.
Select the disk for installation and click «Next».
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».
Select «This PC» then double click «CD Drive (E:) virtio-win-0.1.1».
Open the «guest-agent» folder.
Right click the «qemu-ga-x64» file and select «Install».
The QEMU guest agent will now install.
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.
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. «
Select «Browse my computer for driver software».
Select «Let me pick from a list of device drivers on my computer».
Select the model «Generic Bus».
This resolves the bug, and removes the driver warning.
Virtio Ethernet Adapter
This is a high speed driver capable of 10GbE and better.
Right click on «Ethernet Controller» and select «Update Driver Software. «.
Select «Browse my computer for driver software».
Select «CD Drive (E:) virtio-win-0.1.1» and click OK.
Device Manager will automatically find the correct driver. The path to the driver does not need to be specified.
At the prompt click «Install».
The driver is installed.
The device description has now changed in Device Manager.
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. «.
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. «.
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. «.
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. «.
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».
Click «Mouse & touchpad».
Click «Additional mouse options».
In the Pointers tab, enable «Enable pointer shadow» and click OK to update.
This allows the use of black and extra large cursors.
Установка Windows XP с VirtIO драйверами на KVM
Подскажите как это правильно делать и как вообще пользоваться kvm если на сервере нет иксов и соответственно и virt-manager’а. В разной документации предлагают различные варианты и общего понимания как это все должно работать у меня пока нет
нет иксов и соответственно и virt-manager’а
virt-install. если в лок. сети сервер — как вывод графики юзай spice.
Берешь линукс с иксами и коннектишься с него virt-manager’ом по ssh.
Подскажите как это правильно делать и как вообще пользоваться kvm если на сервере нет иксов и соответственно и virt-manager’а.
virt-manager и не должен быть на сервере. На сервере должен быть libvirt. А virt-manager ты ставишь на клиенте и подключаешься к серверу через ssh (например). Для установки windows сразу на устройства virtio где-то был образ флопика с драйверами, погугли.
у меня на рабочем месте ШИНДОШЗ, поэтому virt-manager можно только с сервера запустить
ну это понятно 🙂 Я просто хочу какое нибудь пошаговое руководство хотя бы. Сейчас я поставил венду так:
В итоге I/O и сеть виртуализированные, VGA не распозналось. В virsh edit нифига не понятно как поменять vga с std на vmware. Ну и с паравиртуализированными драйверами тоже не понятно как теперь поступать
Перестань извращениями заниматься и используй virt-manager так, как мы с mironov_ivan советуем. И да, поставить можно на IDE, а затем поменять его на virtio. Для этого после установки системы надо в нее добавить еще один диск, на этот раз virtio, поставить на него драйверы, потушить оффтопик, удалить диск добавленный и переключить основной с IDE на virtio. Так сложно, потому что оффтопик не умеет ставить дрова на отсутствующие в системе устройства.
у меня на рабочем месте ШИНДОШЗ, поэтому virt-manager можно только с сервера запустить
Хороший повод как минимум завести виртуалку с линуксом, а как максимум — снести нахрен это непригодное для администрирования чего-либо поделие и поставить нормальную ОС.
ребята, что нужно сделать я знаю, у меня другой вопрос — как это сделать. В интернетах предлагается тысяча и одна рекомендация по этому поводу и одна другой противоречит либо просто не подходят. Для начала я хочу что бы кто нибудь рассказал как правильно ставить через virt-install и как потом править конфиг виртуалки. Неужели ни у кого нет историй успеха?
у нас тут так нельзя, к сожалению
Ну тогда остается извращаться с ssh -X
получается все поголовно пользуются virt-manager’ом и руками не настраивают? Мельчают линупсисты 🙂
получается все поголовно пользуются virt-manager’ом и руками не настраивают? Мельчают линупсисты 🙂
Глупости. Ручной труд — признаком «крупного специалиста» не был никогда. Нормальный айтишник стремится все по максимуму автоматизировать.
никакого хардкора и красноглазия
Историю успеха могу подсказать, правда, она для винфака.
Нужно собрать образ оффтопика с unattended setup, впиленными внутрь дровами virtio и скриптом автоподнятия RDP или VNC, тогда можно и virt-install’ом. А ванильный инсталлер оффтопика не подразумевает неинтерактивной работы.
Да, еще можно просунуть наружу VNC виртуалки на внешний адрес сервера и подконнектиться к нему с оффтопика. Либвирт по дефолту их биндит к локалхосту, можно ли заставить слушать на всех интерфейсах, никогда не задумывался, но в качестве говна и палок вполне сойдет ssh-туннель в putty.
Для начала я хочу что бы кто нибудь рассказал как правильно ставить через virt-install
Твой вариант вполне рабочий. Ну, то есть, я ставлю также и всё нормально.
как потом править конфиг виртуалки.
И снова да, virsh edit. Хотя я пользую dumpxml, но разницы быть не должно. И тоже всё работает. Просто не понятно, в чём проблема-то, собственно.
у меня на рабочем месте ШИНДОШЗ, поэтому virt-manager можно только с сервера запустить
Поставь X-сервер на винду [. пока это возможно. А вот как придет сделанная через жопу мечта хомячков на букву «W» — возможности не станет].
Ну и с паравиртуализированными драйверами тоже не понятно как теперь поступать
2. Добавляешь второй диск virtio
3. доставляешь дарйверы
4. меняешь первый диск на virtio
Или — ставишь два виртуальных CD, в один дистрибутив, во второй — драйверы virtio. Их в инсталлере указываешь.
ты вообще в курсе каким образом устанавливается winxp?
никогда такой ерундой раньше не занимался, а что?
ок, это понятно. Как это сделать без virt-manager’а?
И снова да, virsh edit. Хотя я пользую dumpxml, но разницы быть не должно. И тоже всё работает. Просто не понятно, в чём проблема-то, собственно.
я так и не раскурил как в virsh edit поменять vga std на vga vmware например
1. Собрать с помощью nlite winxp и интегрировать дрова.
Взять оттуда http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/
2. WinXP может подгрузить дрова только с floppy, тогда скачать vfd образ https://launchpad.net/kvm-guest-drivers-windows/ download
подключить vfd (https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6. ), как floppy и в процессе установки нажать f6 и выбрать драйвер.
Лень сделать вариант 1, поэтому использую вариант 2.
Создать машину virsh’ем, просунуть VNC наружу и дальше все как в virt-manager’е.
Пробовал — выглядит страшно.
Я просто виртуалку поднял в virtualbox с debian minimal с xfce и там уже virt-manager установил, хоть выглядит не как говно.
Ну ТСу запретили видимо в конторе так делать, иначе бы точно не искал приключений на свою пятую точку