This patch fixes the problem of the first boot after installation virtio block drivers on Windows 10 / Server 2016. Apparently in w10/w2k16 was changed the behavior of Windows-Kernel-Pnp where driver installation can now be done from the kernel. But those records (ddb_regedits) which we write to the registry is not enough for correct kernel-pnp installation:
[Device Install (Hardware initiated) - PCI\VEN_1AF4&DEV_1004&SUBSYS_00081AF4&REV_00\3&13c0b0c5&0&18] Section start 2017/03/29 20:06:28.109 dvi: {Build Driver List} 20:06:28.203 dvi: Searching for hardware ID(s): dvi: pci\ven_1af4&dev_1004&subsys_00081af4&rev_00 dvi: pci\ven_1af4&dev_1004&subsys_00081af4 dvi: pci\ven_1af4&dev_1004&cc_010000 dvi: pci\ven_1af4&dev_1004&cc_0100 dvi: Searching for compatible ID(s): dvi: pci\ven_1af4&dev_1004&rev_00 dvi: pci\ven_1af4&dev_1004 dvi: pci\ven_1af4&cc_010000 dvi: pci\ven_1af4&cc_0100 dvi: pci\ven_1af4 dvi: pci\cc_010000 dvi: pci\cc_0100 dvi: {Build Driver List - exit(0x00000000)} 20:06:28.219 dvi: {DIF_SELECTBESTCOMPATDRV} 20:06:28.219 dvi: Default installer: Enter 20:06:28.219 dvi: {Select Best Driver} ! dvi: Selecting driver failed(0xe0000228) dvi: {Select Best Driver - exit(0xe0000228)} ! dvi: Default installer: failed! ! dvi: Error 0xe0000228: There are no compatible drivers for this device. dvi: {DIF_SELECTBESTCOMPATDRV - exit(0xe0000228)} 20:06:28.219 ndv: {Core Device Install} 20:06:28.219 ndv: {Install Device - PCI\VEN_1AF4&DEV_1004&SUBSYS_00081AF4&REV_00\3&13C0B0C5&0&18} 20:06:28.219 ndv: Parent device: ACPI\PNP0A03\1 dvi: {DIF_ALLOW_INSTALL} 20:06:28.219 dvi: Default installer: Enter 20:06:28.219 dvi: Default installer: Exit dvi: {DIF_ALLOW_INSTALL - exit(0xe000020e)} 20:06:28.219 dvi: {DIF_REGISTER_COINSTALLERS} 20:06:28.234 dvi: Default installer: Enter 20:06:28.359 dvi: Default installer: Exit dvi: {DIF_REGISTER_COINSTALLERS - exit(0x00000000)} 20:06:28.359 dvi: {DIF_INSTALLDEVICE} 20:06:28.359 dvi: Default installer: Enter 20:06:28.359 ! dvi: Installing NULL driver! dvi: Install Null Driver: Removing device sub-tree. 20:06:28.359 dvi: Install Null Driver: Removing device sub-tree completed. 20:06:28.625 dvi: Install Device: Removing device sub-tree. 20:06:28.625 dvi: Install Device: Removing device sub-tree completed. 20:06:28.891 ! dvi: Device required reboot: Query remove failed (install) 0x13: CR_FAILURE. dvi: Default installer: Exit dvi: {DIF_INSTALLDEVICE - exit(0x00000000)} 20:06:28.891 ndv: {Install Device - exit(0x00000000)} 20:06:28.891 ndv: {Core Device Install - exit(0xe0000203)} 20:06:28.891 <<< Section end 2017/03/29 20:06:28.906 <<< [Exit status: FAILURE(0xe0000203)]
As a result, the driver is installed as "Null Driver", this condition doesn't allow to boot a second time(usually a reboot is required after adding new hardware) and we will get 0x0000007B: INACCESSIBLE_BOOT_DEVICE. However, for Windows-UserPnp our entries in the registry(ddb_regedits) is quite enough, therefore if Windows-UserPnp manages to work out for virtio block device before the reboot we were lucky and the next boot will be successful. But when we have many new devices for which Windows-UserPnp also need to install drivers, there is a very little chance that Windows-UserPnp will have time to install drivers for disk before reboot. it looks like this: ... sto: {DRIVERSTORE IMPORT END} 17:18:13.580 dvi: Flushed all driver package files to disk. Time = 313 ms !!! sig: Failed to install catalog 'vioscsi.cat' as 'oem11.cat'. Error = 0x00000426 sto: {DRIVERSTORE IMPORT END: exit(0x00000426)} 17:18:14.033 sto: Flushed driver database node 'SYSTEM'. Time = 172 ms sto: Rolled back driver package publishing. sto: Rolled back driver package registration. sto: Rolled back driver package import. !!! sto: Failed to import driver package into Driver Store. Error = 0x00000426 sto: {Stage Driver Package: exit(0x00000426)} 17:18:14.267 sto: {Setup Import Driver Package - exit (0x00000426)} 17:18:14.408 !!! ndv: Driver package import failed for device. !!! ndv: Error 1062: The service has not been started. ndv: Installing NULL driver. <<< Section end 2017/03/29 17:18:15.095 <<< [Exit status: FAILURE(0x00000426)] (The service was started, but then stopped because of the reboot). Here Windows-UserPnp driver installation is interrupted by reboot "winlogon.exe (WIN-SR0JQJLUQQU) has initiated the restart of computer WIN-9UQ6UAVOUQR onbehalf of user NT AUTHORITY\SYSTEM for the following reason: Operating System: Upgrade (Planned))." The solution is quite simple need to add a field "Version" to HKLM/SYSTEM/DriverDatabase/DriverPackages/drv_inf_label then Windows-Kernel-Pnp will be able to correctly install the virtio block driver. Pavel Butsykin (1): v2v: windows convert: fix virtio block driver installation for w10/w2k16 v2v/windows_virtio.ml | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.11.0