Inject vSphere Drivers into Windows Server 2012 ISO Image
A while back I wrote a blog article on injecting the VMware PVSCSI andVMXNET3 drivers into a Windows Server 2008 R2 and Windows 7 image. Youcan check out that article here.But given those are now legacy operating systems, I'm refreshing theprocedures for Windows Server 2012 (they'd work on Windows 8 too).One of the performance optimizations that I always include in ourWindows VM templates is the VMware paravirtual SCSI driver. This is ahighperformance mass storage driver that is optimized for virtualenvironments andgives you the best disk I/O performance. Unfortunately Microsoft doesnotinclude it out of the box on any OS install disk. Plus, I like toinclude the VMXNET3 driver, so that the VM can use the high performancevirtual NIC that VMware provides, without first having to install VMwaretools.
The process below injects the required drivers into the Windows Server2012 installation boot files, and the actual Window Server operatingsystem, for a fully VMware aware image. Unlike Windows Server 2008 R2and Windows 7, there is no separate Windows Recovery Environment WIM tomodify.
1. Download the Windows 8 ADK (Assessment and Deployment Kit) from here. Never mind that it says Windows 8, as it will workwith Windows Server 2012 since they are the same code base.
2. Start the installation process and after a long download select the two optionsbelow (Deployment Tools and Windows Preinstallation Environment (Windows PE)).WinPE is optional, but in case you need it in the future, I'dinstall it anyway.
3. Mount the Windows Server 2012 ISO. Navigate to the Sources directory and copyboot.wim and install.wim to your computer, say on the D:\ drive.
4. VMwareprovides both 32-bit and 64-bit PVSCSI/VMXNET3 drivers, and you must usethe right onedepending on what CPU architecture you are injecting the drivers into.Since Windows Server 2012 is 64-bit only, find a 64-bit VM for thisexercise and go into the C:\Program Files\VMware\VMwareTools\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 VMrunning on vSphere and do the same copy process, but put those driversinto a \Boot Drivers\32-bit\ folder. To verify the supportedarchitecture of the drivers, open the pvscsi.inffile and scroll down to the section. If you see NTamd64,you have64-bit drivers. If you see NTx86, you have 32-bit drivers. The 64-bitpvscsi.sysfile is also larger than the 32-bit version.
5. Create a folder on the D:\ drive calledMount.
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 varyingamounts of images included. The VL ISO I have contains four indexes, orimages. You can list the indexes with the following command:
dism /get-wiminfo /wimfile:d:\install.wim
8. Just to be safe, I want to modify all of the images just in case downthe 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 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: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
9. Create a backup of your OS ISO file, and then use your favoriteISO editing tool (such as UltraISO) and replace the boot.wimand install.wim files in the Sourcesdirectory. Now you can use the new ISO image to create a VM which usesthe pvscsi controller for the boot drive and the VMXNET3 NIC driver.
页:
[1]