The virtio driver is a high-performance I/O driver that is used for virtualization devices. The virtio driver is a required component of images that are released in Alibaba Cloud. In most cases, Windows images do not contain the virtio driver, which is suitable for cloud-based environments. If you want to create a Windows image based on a source server, install the virtio driver on the source server, which can be a virtual machine. This way, you can ensure that after you import the image to Alibaba Cloud and use the image to create Elastic Compute Service (ECS) instances, the instances can properly recognize virtio virtualization devices and start as expected. This topic describes how to install the virtio driver on a Windows virtual machine based on which you want to create an image.
Limits
The operations that are described in this topic are suitable for the following Windows operating system versions: Windows 7 and later 64-bit and Windows Server 2008 R2 and later 64-bit.
Procedure
Virtio driver versions may change. In this topic, virtio driver version 58101 and Windows Server 2016 64-bit are used.
When you create an image based on a virtual machine, download the installation package of a specific virtio driver version based on the operating system of the virtual machine and decompress the installation package.
The following table describes the URLs from which you can download the virtio driver installation packages for different Windows operating systems.
Operating system
Installation package
Download URL
Windows 7 64-bit or Windows Server 2008 R2 64-bit
AliyunVirtio_58101_WIN2008R2_x64.exe
Windows 8.1 64-bit or Windows Server 2012 R2 64-bit
AliyunVirtio_58101_WIN2012R2_x64.exe
Windows 10 or later 64-bit or Windows Server 2016 or later 64-bit
AliyunVirtio_58101_WIN2016_x64.exe
Install the virtio driver.
Install the virtio driver by using a GUI-based installation program
ImportantDuring the GUI-based installation of the virtio driver, network interface controller (NIC) drivers are updated. As a result, network connections are interrupted for approximately 10 seconds. To prevent the impacts of the network connection interruptions on your business, assess the risks and make preparations in advance.
Find and double-click the
AliyunVirtio_58101_WIN2016_x64.exe
file in the directory to which you downloaded the virtio driver installation package.Install the virtio driver as prompted.
Click Finish on the page shown in the following figure to restart the system for the configurations to take effect.
NoteIf you receive an error message that is similar to "
The SHA-2 patch must be installed for Windows 7 and Windows Server 2008 R2
", the patch that enables SHA2 code signing support is not installed. If you want to create an image based on the virtual machine and import the image to Alibaba Cloud, we recommend that you install the patch on the virtual machine to ensure that ECS instances created from the imported image start as expected.
Install the virtio driver by using a CLI
Run the following command in Windows PowerShell to switch to the directory to which you downloaded the virtio driver installation package. Example directory:
C:\test
.cd C:\test
Run the following command to install the virtio driver:
./AliyunVirtio_58101_WIN2016_x64.exe /SILENT /FORCE /NORESTART
Note/SILENT
: installs the virtio driver in silent mode./FORCE
: installs the virtio driver in force mode and force-overwrites existing virtio driver settings./NORESTART
: installs the virtio driver without automatically restarting the system.
Check whether the virtio driver is installed.
Run the following command in Windows PowerShell to query the version number of the virtio driver:
(Get-Item C:\Windows\System32\drivers\viostor.sys).VersionInfo.ProductVersion
The following command output is returned, which includes a driver version number and indicates that the virtio driver is installed.
Run the following command to obtain the registry configurations of the
viostor
service:Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\viostor"
NoteIn most cases, the
viostor
service is linked to the virtio driver in virtualization environments. If an entry about theviostor
service exists in the registry, a command output is returned indicating that the virtio driver is installed.The following command output indicates that the virtio driver is installed.
After you perform the preceding steps and verify that the virtio driver is installed, you can import the images that are created based on the virtual machine to Alibaba Cloud.
References
After you install the virtio driver on a Windows operating system, you can obtain the Windows image file and import the image file to Alibaba Cloud.
Specific operations on Windows instances depend on the version of the virtio driver contained in the images. For example, the online disk resizing operation requires a virtio driver version that is later than
58011
, and queries for disk serial numbers require a virtio driver version that is later than58017
. If the current virtio driver version does not meet the requirement of the operation that you want to perform, update the driver before you perform the operation. For more information, see Update Red Hat virtio drivers of Windows instances.