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.

Print Friendly, PDF & Email

Related Posts

Subscribe
Notify of
8 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
October 21, 2012 7:37 pm

For ease of administration and maintenance, vmxnet3 and pvscsi can be separate subfolders of D:\Boot Drivers\64-Bit, and a single command “Dism /Image:D:\mount /Add-Driver “/Driver:D:\Boot Drivers\64-Bit” /Recurse” can be used to load both, plus any others that might be added in the future. Thanks. Jeff.

January 21, 2013 12:05 pm

Thanks for a great post. When I install VMware tools on a Windows Server Standard CORE the VMware tools are installed in this directory;

C:\Program Files\Common Files\VMware\Drivers\

No in the folder

C:\Program Files\VMware\VMware Tools\Drivers\xxx

as you mention in the post.

Cheers,
Joakim

Feng
February 13, 2014 12:27 am

why don't we convert tempate to a VM and install the drviers and convert it back to teplates for further deployment?

orionsune
May 11, 2017 7:20 am
Reply to  Feng

I need an ISO for a recovery environment,that's why.

tom
April 13, 2017 8:37 am

Would anyone be willing to provide the files for vSphere 6.5b?? Not all of us have the ability to spin up a separate vSphere cluster just to get these drivers. Thank you, TOm

April 22, 2018 11:40 pm

Can I inject VMware tools as well in install.wim?