All Products
Search
Document Center

Elastic Compute Service:Update the Red Hat virtio driver on a Windows instance

Last Updated:May 06, 2025

Specific operations performed on a Windows Elastic Compute Service (ECS) instance depend on the virtio driver version of the image that runs on the instance. For example, if you want to resize a disk online, the virtio driver version must be later than 58011. The virtio driver version of a Windows ECS instance created earlier than March 30, 2019 may not meet the requirement. If you want to query the serial numbers of disks, the virtio driver version must be later than 58017. The virtio driver version of a Windows ECS instance created earlier than May 1, 2020 may not meet the requirement. If the virtio driver version of the current Windows instance does not meet the requirements, you must update the virtio driver. This topic describes how to view and update the virtio driver of a Windows instance.

Limits

You can update the virtio driver only for Windows Server 2008 and later versions.

Procedure

Step 1: Check the virtio driver

  1. (Optional) Create snapshots to back up data.

    We recommend that you create snapshots for the Windows instance whose virtio driver you want to update to back up instance data. If an exception occurs on the instance when you update the virtio driver, you can use the snapshots to roll back the data of the instance. For more information, see Create a snapshot.

  2. Disable third-party antivirus software.

    To ensure that the virtio driver can be updated as expected, we recommend that you temporarily disable third-party antivirus software installed on the instance. You do not need to disable the built-in antivirus software of the instance. After you confirm that the virtio driver update is complete, restart the third-party antivirus software at the earliest opportunity.

  3. View the virtio driver version of the current instance and determine whether to update the virtio driver based on your business requirements.

    View the virtio driver version by using PowerShell

    1. Connect to the Windows instance.

      For more information, see Use Workbench to connect to a Windows instance over RDP.

    2. Open the Run dialog box, enter powershell, and then click OK to start PowerShell.

    3. Run the following command to check the virtio driver version:

      [System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Windows\System32\drivers\viostor.sys")
      Note

      The viostor.sys file is associated with storage device drivers in virtualization environments, specifically for virtual disk controllers on Microsoft Hyper-V virtual machines. When an operating system runs as a virtual machine on a Hyper-V platform, the driver associated with the viostor.sys file works with the virtualization layer of the host to ensure that the guest operating system can read data from and write data to the virtual hard disk like on a physical hard disk. The viostor.sys driver is an important component that ensures virtual machine disk I/O performance and compatibility.

      The following command output is returned.virtio版本信息

      Determine whether the virtio driver needs to be updated based on whether the end number of the ProductVersion value is lower than 58011 or 58017.

      Scenario

      Virtio driver version

      Operation

      Resize a disk online

      58011 or later

      You can resize the disk online without the need to update the virtio driver. For more information, see Step 1: Resize a disk to extend the disk capacity.

      Earlier than 58011

      You cannot resize the disk online. You must perform Step 2: Update the virtio driver.

      Query the serial number of a disk

      58017 or later

      You can query the serial number of the disk without the need to update the virtio driver. For more information, see Query the serial numbers of block storage devices.

      Earlier than 58017

      You cannot query the serial number of the disk. You must perform Step 2: Update the virtio driver.

    View the virtio driver version by querying the corresponding system file

    1. Connect to the Windows ECS instance.

      For more information, see Use Workbench to connect to a Windows instance over RDP.

    2. Go to the C:\Windows\System32\drivers directory.

    3. Right-click the viostor.sys file and select Properties. On the Details tab, view the File version parameter.

      Note

      The viostor.sys file is associated with storage device drivers in virtualization environments, specifically for virtual disk controllers on Microsoft Hyper-V virtual machines. When an operating system runs as a virtual machine on a Hyper-V platform, the driver associated with the viostor.sys file works with the virtualization layer of the host to ensure that the guest operating system can read data from and write data to the virtual hard disk like on a physical hard disk. The viostor.sys driver is an important component that ensures virtual machine disk I/O performance and compatibility.

      文件版本号

      Determine whether the virtio driver needs to be updated based on whether the end number of the file version is lower than 58011 or 58017.

      Scenario

      Virtio driver version

      Operation

      Resize a disk online

      58011 or later

      You can resize the disk online without the need to update the virtio driver. For more information, see Step 1: Resize a disk to extend the disk capacity.

      Earlier than 58011

      You cannot resize the disk online. You must perform Step 2: Update the virtio driver.

      Query the serial number of a disk

      58017 or later

      You can query the serial number of the disk without the need to update the virtio driver. For more information, see Query the serial numbers of block storage devices.

      Earlier than 58017

      You cannot query the serial number of the disk. You must perform Step 2: Update the virtio driver.

    Note

    You can also log on to the Security Center console. On the Vulnerabilities page, click the Windows System Vulnerability tab and check whether the Windows virtio driver BUG causes disk data loss Risk Update vulnerability exists to determine whether you need to update the virtio driver.

    • If the vulnerability does not exist, you do not need to update the virtio driver for Windows instances that belong to your Alibaba Cloud account.

    • If the vulnerability exists, perform one of the following operations:

      • If the Security Center version allows you to detect and fix vulnerabilities, follow the instructions to fix the vulnerabilities. You do not need to perform the subsequent operations in this topic to update the virtio driver. For more information, see View and handle vulnerabilities.

      • If your Security Center version supports vulnerability detection but does not support vulnerability fixing, you must perform Step 2: Update the virtio driver.

Step 2: Update the virtio driver

Important

The virtio driver update involves updating the network interface controller (NIC) driver. As a result, the network connection may be transiently interrupted, which may affect your business. We recommend that you make preparations.

You can use one of the following methods to update the virtio driver based on your business scenario.

Use a script to update the virtio driver if the instance can access the Internet

If the Windows instance can access the Internet, you can use a script to update the virtio driver of your instance.

  1. Connect to the Windows instance.

    For more information, see Use Workbench to connect to a Windows instance over RDP.

  2. Open the Run dialog box, enter powershell, and then click OK to start PowerShell.

    Note
    • If you log on to the Windows instance as a regular user, the regular user must be granted the administrative permissions to run the script. If you log on as an administrator, you can directly run the script.

    • If you are not allowed to run the script, you must modify the script execution policy of PowerShell. For more information, see the What do I do if I am not allowed to run a script in PowerShell? section of this topic.

  3. Run the following command to download the script:

    Invoke-WebRequest -Uri "https://windows-driver-cn-beijing.oss-cn-beijing.aliyuncs.com/virtio/InstallVirtIo.ps1" -OutFile "C:\Users\Administrator\Downloads\InstallVirtIo.ps1"
  4. Run the following command to run the script:

    powershell -ExecutionPolicy Bypass -File "C:\Users\Administrator\Downloads\InstallVirtIo.ps1"
  5. After the script is run, restart the Windows instance for the new driver version to take effect.

    For more information, see Restart an instance.

Update the virtio driver version by using the installation package if the instance cannot access the Internet

  1. On the on-premises host, download the virtio driver installation package of the corresponding version based on the actual operating system.

    For information about the download URL, see Install the virtio driver.

  2. Upload the installation package to the Windows instance.

    For more information, see Use Remote Desktop Connection or Windows App to transfer files to a Windows instance.

  3. Install the new version of the virtio driver on the Windows instance.

    For more information, see Install the virtio driver.

Use Cloud Assistant to batch update the virtio drivers on multiple instances

If you need to update the virtio drivers of multiple ECS instances and the Windows instances can access the Internet or the virtual private clouds (VPCs), you can use Cloud Assistant to batch update the virtio drivers.

Note

To batch update virtio drivers by using Cloud Assistant, you must download the required installation package. The system downloads the installation package over the internal network within VPCs. If the package cannot be downloaded over the internal network, the system downloads the package over the Internet.

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Maintenance & Monitoring > Cloud Assistant.

  3. In the top navigation bar, select a region.

    The selected region must be the region in which your instances reside.

  4. Use Cloud Assistant to batch update the virtio drivers.

    You use Cloud Assistant to specify the command content or run a common command to update the virtio drivers. The following section describes the different methods for updating virtio drivers by using Cloud Assistant:

    • (Recommended) Use a common command to batch update virtio drivers on multiple ECS instances

      1. On the ECS Cloud Assistant page, click the Common Commands tab. Search for and run the ACS-ECS-InstallVirtioDriver-windows.ps1 command.

      2. In the Select Instance section of the Run Command panel, select the IDs of the instances whose virtio drivers need to be updated. Then, click Run.

    1. Specify the command content to batch update virtio drivers on multiple ECS instances

      1. On the ECS Cloud Assistant page, click Create/Run Command in the upper-right corner.

      2. In the Create Command panel, configure the parameters.

        • The following table describes the required parameters in the Command Information section. Use the default values for other parameters. For more information, see Create and run a command.

          Parameter

          Description

          Command Source

          Select Enter Command Content.

          Command Type

          Select PowerShell.

          Command content

          You can use one of the following methods to update the virtio drivers:

          • Run the InstallVirtIo.ps1 script to update the virtio drivers.

            You must download the InstallVirtIo.ps1 script to your on-premises computer and copy the entire script to the Command content field.

          • Use a Cloud Assistant plug-in to update the virtio drivers.

            Copy the following command content to the Command content field:

            acs-plugin-manager.exe --exec --plugin=UpdateVirtIo

          Execution Plan

          Select Immediate execution.

        • In the Select Instance section, select the IDs of the instances whose virtio drivers need to be updated and click Run.

  5. View the command execution results.

    You can view the execution results of the command on the Command Execution Result tab. The following figure shows the command output for one of the Windows instances, which indicates that the virtio driver on the instance is updated as expected.云助手更新

  6. Batch restart the Windows instances for the update to take effect.

    For more information, see Restart an instance.

FAQ

  • What do I do if I am not allowed to run a script in PowerShell?

    Solution: For security reasons, PowerShell prohibits running scripts in specific versions of Windows operating systems. You can modify the script execution policy of PowerShell to enable PowerShell to run the script. Perform the following steps:

    1. Run the following command to enable PowerShell to run scripts:

      Set-ExecutionPolicy Unrestricted
    2. Enter A and press the Enter key to modify the script execution policy.

    3. Rerun the script.

    4. To ensure system security, PowerShell returns a warning message in the command output. Enter R and press the Enter key to run the script again.

    5. After the script is run, we recommend that you run the following command to restore the default configurations of PowerShell to ensure system security:

      Set-ExecutionPolicy Restricted
    6. Enter A and press the Enter key to modify the script execution policy.

  • What do I do if I am prompted that no digital signature is available for the NIC driver after the virtio driver is updated?

    You can manually download the latest Windows driver package to replace the faulty NIC driver. Perform the following steps:

    1. Connect to the Windows instance.

      For more information, see Connect to a Windows instance by using a username and password.

    2. Click Windows driver package to download the latest Windows driver package.

      Note

      If you cannot download the driver package to your Windows instance, you can download the driver package to an on-premises host. Then, use Remote Desktop Connection or an FTP site to upload the driver package to the Windows instance. For information about how to upload a file, see Select a file transfer method.

      After the package is downloaded, find the new_virtio.zip driver package.

    3. Decompress the driver package and open the new_virtio folder.

      image

      The subfolders contain the virtio driver installation files for different Windows versions. Take note of the following subfolders. Select a subfolder based on your actual Windows version.

      • win10: This subfolder contains an amd64 subfolder that stores driver installation files for Windows Server 2016, Windows Server 2019, and Windows 10.

      • Win8: This subfolder contains an amd64 subfolder that stores driver installation files for Windows Server 2012 R2 and Windows 8.1.

      • win7: This subfolder contains an amd64 subfolder that stores driver installation files for Windows Server 2008 R2 and Windows 7.

    4. Uninstall the existing NIC driver.

      In this example, Windows Server 2019 64-bit is used. You can perform similar steps for other Windows operating system versions.

      1. Open Windows Control Panel. In the Search Control Panel search box, search for and open Device Manager.设备管理器

      2. In the Network adapters section, right-click Red Hat VirtIO Ethernet Adapter and select Uninstall device.

        卸载设备

      3. In the Confirm Device Removal dialog box, select Delete the driver software for this device and click OK.

    5. Install the latest NIC driver.

      1. In PowerShell, run the following command to open the corresponding driver folder.

        In this example, Windows Server 2019 64-bit is used, and the Windows driver package is stored in the C:\test directory. Therefore, the directory is C:\test\new_virtio\win10\amd64.

        cd C:\test\new_virtio\win10\amd64
      2. Run the following command to install the latest NIC driver:

        pnputil -i -a netkvm.inf

        The following figure shows that the NIC driver is installed.

        安装网卡驱动

    6. Return to or reopen Device Manager, right-click the hostname, and then select Scan for hardware changes.

      In this example, the hostname of the Windows instance is test, as shown in the following figure.

      扫描检测

      After the scan is complete, the NIC driver is displayed in Device Manager.

    7. View information about the latest NIC driver.

      1. In the Network adapters section, right-click Red Hat VirtIO Ethernet Adapter and select Properties.

      2. In the Red Hat VirtIO Ethernet Adapter Properties dialog box, click the Driver tab to view the virtio driver information.

        image

    8. Restart the Windows instance for the virtio driver update to take effect.

      For more information, see Restart an instance.

References