Here are some rough notes describing how to inject drivers into a Windows 2008 ISO.
There are two separate images (WIM files) included with a Windows ISO.
boot.wim - a boot image used to boot a system in order to begin the process of installing Windows onto the system. This is also known as Windows PE.
install.wim - the actual install image for the Windows operating system that includes all setup files.
I needed to inject drivers into both WIM images, as I needed network connectivity using injected drivers throughout the install process. In this post I am using a Windows 2008 environment to inject drivers into a Windows 2008 R2 ISO.
First make some working directories.
mkdir c:\drivers mkdir c:\mount mkdir c:\iso
Copy all of the drivers you want to add into the c:\drivers directory.
Insert Windows 2008 CDROM/ISO and manually copy all files into c:\iso directory.
Copy boot.wim and install.wim from Windows 2008 CDROM/ISO to root of c:\ directory.
List wim file indexes and figure out correct one to edit.
dism /get-wiminfo /wimfile:c:\boot.wim dism /get-wiminfo /wimfile:c:\install.wim
Edit boot.wim and add drivers. In this case, I am adding VMware drivers (Paravirtual SCSI driver and VMXNET3 network driver) to index 2 which is the WindowsPE image that needs to be updated.
dism /Mount-Wim /WimFile:C:\boot.wim /Index:2 /MountDir:c:\mount dism /image:c:\mount /Add-Driver /driver:c:\drivers\pvscsi.inf dism /image:c:\mount /Add-Driver /driver:c:\drivers\vmxnet3ndis6.inf dism /unmount-wim /mountdir:c:\mount /commit
Edit install.wim and add drivers. In this case, it’s only being added to index 5 which is ‘Datacenter Full’ edition (since this is the only one I needed at the time).
dism /Mount-Wim /WimFile:C:\install.wim /Index:5 /MountDir:c:\mount dism /image:c:\mount /Add-Driver /driver:c:\drivers\pvscsi.inf dism /image:c:\mount /Add-Driver /driver:c:\drivers\vmxnet3ndis6.inf dism /unmount-wim /mountdir:c:\mount /commit
Copy the updated WIM files and overwrite the ones in c:\iso directory.
copy c:\boot.wim c:\iso\sources\boot.wim copy c:\install.wim c:\iso\sources\install.wim
Create a new ISO with the updated WIM files.
oscdimg.exe -lGRMSXVOL_EN_DVD -m -u2 -bC:\iso\boot\etfsboot.com C:\iso C:\Windows_2008_R2_With_VMware_Drivers.ISO