- Installing the QEMU guest agent and VirtIO drivers
- Installing the QEMU guest agent
- Installing VirtIO drivers on Windows VMs
- Attaching VirtIO container disk to Windows VMs during installation
- Attaching VirtIO container disk to an existing Windows VM
- Installing VirtIO drivers during Windows installation
- Installing VirtIO drivers from a SATA CD drive on an existing Windows VM
- Installing VirtIO drivers from a container disk added as a SATA CD drive
- Updating VirtIO drivers
Installing the QEMU guest agent and VirtIO drivers
The QEMU guest agent is a daemon that runs on the virtual machine (VM) and passes information to the host about the VM, users, file systems, and secondary networks.
You must install the QEMU guest agent on VMs created from operating system images that are not provided by Red Hat.
Installing the QEMU guest agent
Installing the QEMU guest agent on a Linux VM
The qemu-guest-agent
is widely available and available by default in Fedora virtual machines (VMs). Install the agent and start the service.
To create snapshots of an online (Running state) VM with the highest integrity, install the QEMU guest agent. The QEMU guest agent takes a consistent snapshot by attempting to quiesce the VM file system as much as possible, depending on the system workload. This ensures that in-flight I/O is written to the disk before the snapshot is taken. If the guest agent is not present, quiescing is not possible and a best-effort snapshot is taken. The conditions under which the snapshot was taken are reflected in the snapshot indications that are displayed in the web console or CLI. |
Procedure
Log in to the VM by using a console or SSH.
Install the QEMU guest agent by running the following command:
$ yum install -y qemu-guest-agent
Ensure the service is persistent and start it:
$ systemctl enable --now qemu-guest-agent
Verification
Run the following command to verify that
AgentConnected
is listed in the VM spec:$ oc get vm <vm_name>
Installing the QEMU guest agent on a Windows VM
For Windows virtual machines (VMs), the QEMU guest agent is included in the VirtIO drivers. You can install the drivers during a Windows installation or on an existing Windows VM.
To create snapshots of an online (Running state) VM with the highest integrity, install the QEMU guest agent. The QEMU guest agent takes a consistent snapshot by attempting to quiesce the VM file system as much as possible, depending on the system workload. This ensures that in-flight I/O is written to the disk before the snapshot is taken. If the guest agent is not present, quiescing is not possible and a best-effort snapshot is taken. The conditions under which the snapshot was taken are reflected in the snapshot indications that are displayed in the web console or CLI. |
Procedure
In the Windows guest operating system, use the File Explorer to navigate to the
guest-agent
directory in thevirtio-win
CD drive.Run the
qemu-ga-x86_64.msi
installer.
Verification
Obtain a list of network services by running the following command:
$ net start
Verify that the output contains the
QEMU Guest Agent
.
Installing VirtIO drivers on Windows VMs
VirtIO drivers are paravirtualized device drivers required for Microsoft Windows virtual machines (VMs) to run in OKD Virtualization. The drivers are shipped with the rest of the images and do not require a separate download.
The container-native-virtualization/virtio-win
container disk must be attached to the VM as a SATA CD drive to enable driver installation. You can install VirtIO drivers during Windows installation or added to an existing Windows installation.
After the drivers are installed, the container-native-virtualization/virtio-win
container disk can be removed from the VM.
Driver name | Hardware ID | Description |
---|---|---|
viostor | VEN_1AF4&DEV_1001 | The block driver. Sometimes labeled as an SCSI Controller in the Other devices group. |
viorng | VEN_1AF4&DEV_1005 | The entropy source driver. Sometimes labeled as a PCI Device in the Other devices group. |
NetKVM | VEN_1AF4&DEV_1000 | The network driver. Sometimes labeled as an Ethernet Controller in the Other devices group. Available only if a VirtIO NIC is configured. |
Attaching VirtIO container disk to Windows VMs during installation
You must attach the VirtIO container disk to the Windows VM to install the necessary Windows drivers. This can be done during creation of the VM.
Procedure
When creating a Windows VM from a template, click Customize VirtualMachine.
Select Mount Windows drivers disk.
Click the Customize VirtualMachine parameters.
Click Create VirtualMachine.
After the VM is created, the virtio-win
SATA CD disk will be attached to the VM.
Attaching VirtIO container disk to an existing Windows VM
You must attach the VirtIO container disk to the Windows VM to install the necessary Windows drivers. This can be done to an existing VM.
Procedure
Navigate to the existing Windows VM, and click Actions → Stop.
Go to VM Details → Configuration → Disks and click Add disk.
Add
windows-driver-disk
from container source, set the Type to CD-ROM, and then set the Interface to SATA.Click Save.
Start the VM, and connect to a graphical console.
Installing VirtIO drivers during Windows installation
You can install the VirtIO drivers while installing Windows on a virtual machine (VM).
This procedure uses a generic approach to the Windows installation and the installation method might differ between versions of Windows. See the documentation for the version of Windows that you are installing. |
Prerequisites
- A storage device containing the
virtio
drivers must be attached to the VM.
Procedure
In the Windows operating system, use the
File Explorer
to navigate to thevirtio-win
CD drive.Double-click the drive to run the appropriate installer for your VM.
For a 64-bit vCPU, select the
virtio-win-gt-x64
installer. 32-bit vCPUs are no longer supported.Optional: During the Custom Setup step of the installer, select the device drivers you want to install. The recommended driver set is selected by default.
After the installation is complete, select Finish.
Reboot the VM.
Verification
Open the system disk on the PC. This is typically
C:
.Navigate to Program Files → Virtio-Win.
If the Virtio-Win directory is present and contains a sub-directory for each driver, the installation was successful.
Installing VirtIO drivers from a SATA CD drive on an existing Windows VM
You can install the VirtIO drivers from a SATA CD drive on an existing Windows virtual machine (VM).
This procedure uses a generic approach to adding drivers to Windows. See the installation documentation for your version of Windows for specific installation steps. |
Prerequisites
- A storage device containing the virtio drivers must be attached to the VM as a SATA CD drive.
Procedure
Start the VM and connect to a graphical console.
Log in to a Windows user session.
Open Device Manager and expand Other devices to list any Unknown device.
Open the Device Properties to identify the unknown device.
Right-click the device and select Properties.
Click the Details tab and select Hardware Ids in the Property list.
Compare the Value for the Hardware Ids with the supported VirtIO drivers.
Right-click the device and select Update Driver Software.
Click Browse my computer for driver software and browse to the attached SATA CD drive, where the VirtIO drivers are located. The drivers are arranged hierarchically according to their driver type, operating system, and CPU architecture.
Click Next to install the driver.
Repeat this process for all the necessary VirtIO drivers.
After the driver installs, click Close to close the window.
Reboot the VM to complete the driver installation.
Installing VirtIO drivers from a container disk added as a SATA CD drive
You can install VirtIO drivers from a container disk that you add to a Windows virtual machine (VM) as a SATA CD drive.
Downloading the |
Prerequisites
- You must have access to the Red Hat registry or to the downloaded
container-native-virtualization/virtio-win
container disk in a restricted environment.
Procedure
Add the
container-native-virtualization/virtio-win
container disk as a CD drive by editing theVirtualMachine
manifest:# ...
spec:
domain:
devices:
disks:
- name: virtiocontainerdisk
bootOrder: 2 (1)
cdrom:
bus: sata
volumes:
- containerDisk:
image: container-native-virtualization/virtio-win
name: virtiocontainerdisk
1 OKD Virtualization boots the VM disks in the order defined in the VirtualMachine
manifest. You can either define other VM disks that boot before thecontainer-native-virtualization/virtio-win
container disk or use the optionalbootOrder
parameter to ensure the VM boots from the correct disk. If you configure the boot order for a disk, you must configure the boot order for the other disks.Apply the changes:
If the VM is not running, run the following command:
$ virtctl start <vm>
If the VM is running, reboot the VM or run the following command:
$ oc apply -f <vm.yaml>
After the VM has started, install the VirtIO drivers from the SATA CD drive.
Updating VirtIO drivers
Updating VirtIO drivers on a Windows VM
Update the virtio
drivers on a Windows virtual machine (VM) by using the Windows Update service.
Prerequisites
- The cluster must be connected to the internet. Disconnected clusters cannot reach the Windows Update service.
Procedure
In the Windows Guest operating system, click the Windows key and select Settings.
Navigate to Windows Update → Advanced Options → Optional Updates.
Install all updates from Red Hat, Inc..
Reboot the VM.
Verification
On the Windows VM, navigate to the Device Manager.
Select a device.
Select the Driver tab.
Click Driver Details and confirm that the
virtio
driver details displays the correct version.