Install virtio drivers offline for Windows instances
Install virtio drivers offline to fix ECS instances that fail to start due to missing drivers.
Because the instance cannot start, you must mount its disk to a working instance to install the drivers. This is called offline installation.
Procedure
-
Create a snapshot of the abnormal instance to back up your data.
NoteSnapshots incur fees. See Snapshot billing.
-
Create a new ECS instance. See Create an instance by using the wizard.
The new instance must meet these requirements:
-
VPC: Same VPC as the abnormal instance.
-
Image: Use an official image with the same operating system as the abnormal instance.
NoteA new ECS instance incurs fees for computing, storage, image, and other resources. Check each billing item. Release the instance after use to avoid ongoing charges.
-
-
Detach the system disk of the abnormal instance and attach it as a data disk to the new instance created in Step 2. See Detach or attach a system disk and Attach as a data disk.
-
Connect to the new instance. Check the attached disk status in Disk Management and take action accordingly.
Disk status
Solution
Disk is offline
Right-click the disk, and then select Online.
Disk is read-only
Clear the read-only property in Windows PowerShell:
diskpart list disk # Confirm the abnormal disk number (such as disk 1) select disk 1 # Select the abnormal system disk attributes disk # View current disk properties attributes disk clear readonly # If the disk is read-only, clear the read-only property exitPartition has no drive letter
Right-click the partition, select Change Drive Letter And Paths, and assign a drive letter.
-
Export virtio drivers from the new instance to a local directory in PowerShell.
Export-WindowsDriver -Online -Destination <directory for storing the exported data>Replace
<directory for storing the exported data>with your actual path, for example,C:\test. -
Install the exported drivers on the abnormal disk.
Add-WindowsDriver -Path <abnormal disk drive letter> -Driver <directory for restoring exported data> -RecurseReplace
<abnormal disk drive letter>and<directory for restoring exported data>with your actual values, for example:Add-WindowsDriver -Path D: -Driver C:\test -Recurse -
Process the abnormal disk in the following order:
-
Take offline: In Disk Management, right-click the disk and select Offline.
-
Detach the disk. See Detach data disk.
-
Reattach to the source instance as a system disk. See Attach as a system disk.
-
-
Restart the source instance and verify that it starts and loads the virtio drivers.