While working on a bunch of provisioned servers(Citrix PVS), I needed to do some modifications on the cache drive. I made a small .VHD image which boots quickly and gives me access to some rudimentary tools. I also had to inject a couple of drivers for the VMWare components.
First of all, install the Microsoft Assessment and Deployment Kit (ADK) and get a copy of the VMWare-drivers(Program Files\Common Files\VMware\Drivers\) from a system with the VMWare Tools installed.
Right-click the shortcut to “Deployment and Imaging Tools Environment” and choose “Run As Administrator”. Use copype to build your own bootable WinPE environment. The syntax is “copype <architecture> <destination>”.
X86-architecture selected for the image and “X:\winpe_x86” used as work folder:
1 2 3 |
copype x86 X:\winpe_x86 |
Mount the image:
1 2 3 |
dism /mount-wim /wimfile:X:\winpe_x86\media\sources\boot.wim /index:1 /mountdir:X:\winpe_x86\mount |
Inject the needed VMWare drivers (\drivers is the source folder).
1 2 3 4 5 6 7 8 9 10 |
dism /image:X:\winpe_x86\mount /Add-Driver /driver:X:\winpe_x86\drivers /recurse Searching for driver packages to install... Found 3 driver package(s) to install. Installing 1 of 3 - X:\winpe_x86\drivers\pvscsi\pvscsi.inf: The driver package was successfully installed. Installing 2 of 3 - X:\winpe_x86\drivers\vmxnet\vmxnet.inf: The driver package was successfully installed. Installing 3 of 3 - X:\winpe_x86\drivers\vmxnet3\vmxnet3ndis6.inf: The driver package was successfully installed. The operation completed successfully. |
Copy any tools you need into the (mounted)image, for example into the folder X:\winpe_x86\mount\tools.
Unmount the image and commit your changes:
1 2 3 |
dism /unmount-wim /mountdir:X:\winpe_x86\mount /commit |
Create a boot-ISO (Optional):
1 2 3 |
MakeWinPEMedia /ISO X:\winpe_x86 X:\winpe_x86\winpe_x86.iso |
Create a virtual hard drive which will be used for provisioning:
1 2 3 4 5 6 7 8 9 |
diskpart create vdisk file="X:\WinPE.vhd" maximum=1000 attach vdisk create partition primary assign letter=Y format fs=ntfs quick exit |
Prepare the drive by using MakeWinPEMedia:
1 2 3 |
MakeWinPEMedia /UFD X:\WinPE_x86 Y: |
Detach the disk and move the .vhd into your PVS server.
1 2 3 4 5 6 |
diskpart select vdisk file="X:\WinPE.vhd" detach vdisk exit |