How to add PVSCSI Driver to an offline Windows Image using DISM
search cancel

How to add PVSCSI Driver to an offline Windows Image using DISM

book

Article ID: 313850

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
This article provides information on how to add PVSCSI Driver to an offline Windows Image using DISM

Environment

VMware vSphere 6.5.x
VMware vSphere 7.0.x
VMware vSphere 6.7.x

Resolution

Perform below steps in a VM or physical machine running Windows 10, Windows Server 2016 or Windows Server 2019.
Firstly, get the Windows installation ISO image to be customized in this machine. Download oscdimg command-line tool or install this tool with Windows Assessment and Deployment Kit (ADK). We will use this tool to create a bootable ISO image.

Create 4 folders in your working directory. For example:
1. C:\test\ISO\: extract the offline Windows installation ISO image to this folder.
2. C:\test\drivers\: put PVSCSI driver files in this folder.
3. C:\test\wim\: a temp folder for boot.wim file.
4. C:\test\mount\: the mount folder of Windows image.

You can get PVSCSI driver files from a Windows VM with VMware tools installed. The driver files is located in: C:\Program Files\Common Files\VMware\Drivers\pvscsi\Win8\. Please be aware that you get 64bit driver files from 64bit guest OS with VMware tools installed or from VMware tools installation ISO file:

1. Download VMware tools ISO file, or get it from ESXi host in this path: /vmimages/tools-isoimages/windows.iso
2. Extract it and get PVSCSI driver files in this path: Program Files\VMware\VMware Tools\Drivers\pvscsi\Win8\amd64\ or i386\.
Please refer To install PVSCSI drivers through CD/DVD drive section in KB article Configuring disks to use VMware Paravirtual SCSI (PVSCSI) controllers (1010398)
Then copy all the driver files to this folder C:\test\drivers\.

Add PVSCSI driver to Windows image and create a new Windows installation ISO file.

1. Get boot.wim file from offline Windows installation ISO Image,
a. Extract Windows ISO file to this folder C:\test\ISO\, copy file boot.wim from C:\test\ISO\sources\ to C:\test\wim\.
b. Execute this command to get the image information in boot.wim file:
      DISM /Get-ImageInfo /ImageFile:C:\test\wim\boot.wim
c. Execute this command to mount the Windows Setup image, e.g., at index 2 listed from above command:
      DISM /Mount-Image /ImageFile:C:\test\wim\boot.wim /Index:2 /MountDir:C:\test\mount

2. Add PVSCSI driver to Microsoft Windows Setup image,
a. Add specified driver to the mounted image:
      DISM /Image:C:\test\mount /Add-Driver /Driver:C:\test\drivers\pvscsi.inf
      Or add all the drivers in the folder and its subfolders:
      DISM /Image:C:\test\mount /Add-Driver /Driver:C:\test\drivers /Recurse
b. Check that the driver is added successfully, ‘Published Name’ is ‘oem*.inf’, ‘Original File Name’ is ‘pvscsi.inf’:
      DISM /Image:C:\test\mount /Get-Drivers
      Execute this command if you want to remove this driver from the image, e.g., ‘oem0.inf’ is the added driver name from above command:
      DISM /Image:C:\test\mount /Remove-Driver /Driver:oem0.inf
c. Commit the changes and unmount the image:
      DISM /Unmount-Image /MountDir:C:\test\mount /Commit

3. Copy the changed image file C:\test\wim\boot.wim back to this folder C:\test\ISO\sources\ and overwrite the old file.

4. Create a new custom Windows installation ISO image using oscdimg tool, e.g., C:\test\windows_new.iso
oscdimg.exe
-bootdata:2#p0,e,bC:\test\ISO\boot\Etfsboot.com#pEF,e,bC:\test\ISO\efi\microsoft\boot\Efisys.bin
-u1 -udfver102 C:\test\ISO C:\test\windows_new.iso

Please refer to the Oscdimg Command-Line Options in this microsoft document

Now you can create a new VM with PVSCSI boot disk controller, and mount the new created Windows installation ISO image to install Windows without additional steps to browse to the path of PVSCSI driver, the disk drive can be recognized.