Inject VMware Drivers into Windows Server 2012 ISO Image

A while back I wrote a blog article on how to inject VMware drivers (PVSCSI and VMXNET3) into a Windows Server 2008 R2 and Windows 7 image. You can check out that article here. But given those are now legacy operating systems, I’m refreshing the procedures for Windows Server 2012 (they’d work on Windows 8 too).

One of the performance optimizations that I always include in our Windows VM templates is the VMware paravirtual SCSI driver. This is a high performance mass storage driver that is optimized for virtual environments and gives you the best disk I/O performance. Unfortunately Microsoft does not include it out of the box on any OS install disk. Plus, I like to include the VMXNET3 driver, so that the VM can use the high performance virtual NIC that VMware provides, without first having to install VMware tools.

The process below injects the required drivers into the Windows Server 2012 installation boot files, and the actual Window Server operating system, for a fully VMware aware image. Unlike Windows Server 2008 R2 and Windows 7, there is no separate Windows Recovery Environment WIM to modify.

1. Download the Windows 8 ADK (Assessment and Deployment Kit) from here. Never mind that it says Windows 8, as it will work with Windows Server 2012 since they are the same code base.

2. Start the installation process and after a long download select the two options below (Deployment Tools and Windows Preinstallation Environment (Windows PE)). WinPE is optional, but in case you need it in the future, I’d install it anyway.

3. Mount the Windows Server 2012 ISO. Navigate to the Sources directory and copy boot.wim and install.wim to your computer, say on the D: drive.

4. VMware provides both 32-bit and 64-bit PVSCSI/VMXNET3 drivers, and you must use the right one depending on what CPU architecture you are injecting the drivers into. Since Windows Server 2012 is 64-bit only, find a 64-bit VM for this exercise and go into the C:\Program Files\VMware\VMware Tools\Drivers\pvscsi folder.

Copy those files to D:\Boot Drivers\64-bit. Do the same for the VMXNET3 drivers, putting them in the same folder. The result should look something like this:

If you need the 32-bit drivers for Windows 8, then find a 32-bit VM running on vSphere and do the same copy process, but put those drivers into a Boot Drivers32-bit folder. To verify the supported architecture of the drivers, open the pvscsi.inf file and scroll down to the [Manufacturer] section. If you see NTamd64, you have 64-bit drivers. If you see NTx86, you have 32-bit drivers. The 64-bit pvscsi.sys file is also larger than the 32-bit version.

5. Create a folder on the D: drive called Mount.

6. To modify the boot.wim file type the following commands in the Deployment Tools Command prompt:


dism /Mount-Wim /WimFile:D:\boot.wim /Index:2 /MountDir:D:\mount
dism /image:D:\mount /Add-Driver "/driver:d:\boot drivers\64-Bit\pvscsi.inf"
dism /image:D:\mount /Add-Driver "/driver:d:\boot drivers\64-Bit\vmxnet3ndis6.inf"
dism /unmount-wim /mountdir:d:\mount /commit

7. Depending on your Windows Server 2012 ISO image, it may have varying amounts of images included. The VL ISO I have contains four indexes, or images. You can list the indexes with the following command:

dism /get-wiminfo /wimfile:d:\install.wim

9. Just to be safe, I want to modify all of the images just in case down the road I want to use another image, such as Windows Server Core.


dism /Mount-Wim /WimFile:D:\install.wim /Index:1 /MountDir:D:\mount
dism /image:D:\mount /Add-Driver "/driver:d:\boot drivers\64-Bit\pvscsi.inf"
dism /image:D:\mount /Add-Driver "/driver:d:\boot drivers\64-Bit\vmxnet3ndis6.inf"
dism /unmount-wim /mountdir:d:\mount /commit

dism /Mount-Wim /WimFile:D:\install.wim /Index:2 /MountDir:D:\mount
dism /image:D:\mount /Add-Driver "/driver:d:\boot drivers\64-Bit\pvscsi.inf"
dism /image:D:\mount /Add-Driver "/driver:d:\boot drivers\64-Bit\vmxnet3ndis6.inf"
dism /unmount-wim /mountdir:d:\mount /commit

dism /Mount-Wim /WimFile:D:\install.wim /Index:3 /MountDir:D:\mount
dism /image:D:\mount /Add-Driver "/driver:d:\boot drivers64-Bit\pvscsi.inf"
dism /image:D:\mount /Add-Driver "/driver:d:\boot drivers64-Bit\vmxnet3ndis6.inf"
dism /unmount-wim /mountdir:d:\mount /commit

dism /Mount-Wim /WimFile:D:\install.wim /Index:4 /MountDir:D:\mount
dism /image:D:\mount /Add-Driver "/driver:d:\boot drivers\64-Bit\pvscsi.inf"
dism /image:D:\mount /Add-Driver "/driver:d:\boot drivers\64-Bit\vmxnet3ndis6.inf"
dism /unmount-wim /mountdir:d:\mount /commit

13. Create a backup of your OS ISO file, and then use your favorite ISO editing tool (such as UltraISO) and replace the boot.wim and install.wim files in the Sources directory. Now you can use the new ISO image to create a VM which uses the pvscsi controller for the boot drive and the VMXNET3 NIC driver.

Speak Your Mind

*

© 2017 - Sitemap