mirror of
https://github.com/croit/load-virtio-scsi-on-boot.git
synced 2026-09-24 16:00:09 +01:00
5e90b4461a1922e0f509eb604c0a2c9bf82854a0
synchronize name with external resources
Purpose of this script
- make Windows load the VirtIO SCSI pass-through driver on boot without reboot or external programs
Prerequisites
- VirtIO SCSI driver (vioscsi) must be installed OR path to the INF-File must be given as argument to the script
- Windows 7/8 or Windows Server 2008 or newer versions
Remarks
- On Windows before Windows Server 2022 and Windows 10 2004 the software device created by the script will not be removed automatically, but this can be done via device manager. It can also be left there, no harm in that.
- You should have a backup of your system.
- This script was tested
- on Windows Server 2025 Standard Edition (24H2)
- on Windows Server 2022 Datacenter Edition (21H2)
- with virtio drivers version .266, .271, .285
- nearly all code in here was written by AI
How to use either
- install the
vioscsi.infbefore OR - tell the script to do it by
-InfPathparameter OR - use
virtio-win-guest-tools.exe /Sto install it
depending on the set security policy it might be required to run the script via
PowerShell /ExecutionPolicy Bypass /File <path-to-this-script-file> [-InfPath <path-to-vioscsi.inf>]
How does the script work?
- install the vioscsi driver, if requested
- create a software based device via Win32-API
- add some registry settings
- use
pnputilto install the driver for this device - use
pnputilto remove the device
The driver-to-device assignment marks the driver for being loaded on boot. Now the Windows is ready for migration to a VirtIO based SCSI disk.
Description
PowerShell script to enable Windows to load VirtIO SCSI driver on boot without reboot. Creates a phantom device to preload the driver, preparing Windows for migration to VirtIO-based virtualization (e.g., VMware to Proxmox). Supports Windows 7/8/10/11 and Server 2008-2025.
168 KiB
Languages
PowerShell
100%