Step-by-Step: Adding Hyper-V Integration Components to Windows PE using WAIK 2.0 Tools
February 28, 2009 at 12:55 pm | Posted in Hyper-V, WAIK, Windows Deployment Services (WDS) | 10 CommentsTags: Hyper-V, Injecting Drivers, Microsoft Deployment Toolkit (MDT) 2010, WAIK, Windows Deployment Services (WDS)
For those that have been using Windows Automated Installation Kit (WAIK) 2.0 released recently (download link here) or using Microsoft Deployment Toolkit 2010 Beta 1, that works only with WAIK 2.0 (check these articles of mine about MDT 2010: Post I, Post II and Post III); maybe you’ve noticed that the management tools that were included with WAIK 1.1 (and 1.0) disappeared in this new version.

These tools were consolidated by one command-line: DISM.exe (more info on Post I about MDT 2010). Meaning that the Windows PE management (like customizing, adding drivers or inserting Hyper-V integration components to those images) that you executed on previous versions of WAIK, has significant changes.
On this post we’ll be reviewing how to add the Hyper-V Integration Components to a Windows Preinstallation Environment (Windows PE) image, including the new Windows PE 3.0.
Why should I need to add the Hyper-V Integration Components to Windows PE?
The Integration Components of Hyper-V are a set of drivers that are a significant performance change that you can apply to virtual machines for them to be able to install synthetic devices instead of emulated devices.
Some of the drivers that are installed using the Integration Components are: Video driver, network driver (with this you avoid using Hyper-V’s Legacy Network adapter), storage driver, VMBUS (transport for synthetic devices), time sync (time synchronization with the host), etc.
Adding Hyper-V Integration Components
As I mentioned before, I prepared a set of MDT 2010 posts about LTI deployments with Windows 7, so I’m going to take the LiteTouch PE image created on that deployment instead of a common Windows PE image (boot.wim). But again, this process will work the same as using a Windows PE raw image.
Since I have already a LiteTouch image added to my Windows Deployment Services (WDS) as a boot image, I’m going to export it, mount the image to be able to apply all changes there, and then import it again to WDS.
1. Mounting Boot Image
1.1. Open the Windows Deployment Services Console and Export the image.

1.2. I’m going to place it on C:\Temp.

1.3. Create the folder where you are going to mount it. In my case C:\Temp\mount.
1.4. Run “cmd” as Administrator, place it in “cd C:\Program Files\Windows AIK\Tools\Servicing”.
1.5. Mount the image using this command line:
Dism.exe /mount-wim /wimfile:”C:\Temp\Lite Touch Windows PE.WIM” /index:1 /mountdir:”C:\Temp\mount”

/index:1 states that you want to use the first image inside the WIM file. A WIM file for operating systems, like Windows 7 for example, contain several images: Ultimate, Enterprise, Starter, etc.
2. Uncompressing Drivers from Integration Components
Now that the image is mounted and ready to be modified, we are going to uncompress the files we need from the Hyper-V Integration Components.
2.1. Since I’m using a virtual machine, I’m going to attach the Integration Components media and extract the files from there.

2.2. From the media of the IC, copy this two files to a local folder:
D:\support\amd64\Windows6.0-KB951634-x64.msu
D:\support\x86\Windows6.0-KB951634-x86.msu

We are going to use the Expand command line to extract the drivers within those updates. Place the cmd window in C:\Windows\System32\ and create a folder to store this temporary files. C:\Temp\source
2.3. Insert:
expand.exe –F:* “C:\Temp\Windows6.0-KB951634-x64.msu” “C:\Temp\source”.

Repeat the step for the x86 update.
Now we are going to also extract the drivers included in the .CAB files that we took from the MSU file.
2.4 Create another temporary folder for these drivers. C:\Temp\source\drivers.
2.5. Insert:
expand.exe -F:* "C:\Temp\source\Windows6.0-KB951634-x64.cab" "C:\Temp\source\drivers".

Inside C:\Temp\source\drivers are all the files we need to insert x64 environments. You can repeat the step 2.5 using the x86 update.
3. Injecting the drivers
You will notice that hundreds of files have been uncompressed, but we are not going to add them all, we are just going to inject the ones that we need.
Here are all the necessary drivers and the command lines to execute:
dism /image:"C:\Temp\mount" /add-driver /driver:"C:\Temp\source\drivers\amd64_wnetvsc.inf_31bf3856ad364e35_6.0.6001.18016_none_b337f91d87dbf1d0\wnetvsc.inf"
dism /image:"C:\Temp\mount" /add-driver /driver:"C:\Temp\source\drivers\amd64_ws3cap.inf_31bf3856ad364e35_6.0.6001.18016_none_f2e1ba67fcb48f61\ws3cap.inf" /forceunsigned
dism /image:"C:\Temp\mount" /add-driver /driver:"C:\Temp\source\drivers\amd64_wstorflt.inf_31bf3856ad364e35_6.0.6001.18016_none_1cadbbeed0ad55a3\wstorflt.inf" /forceunsigned
dism /image:"C:\Temp\mount" /add-driver /driver:"C:\Temp\source\drivers\amd64_wstorvsc.inf_31bf3856ad364e35_6.0.6001.18016_none_836399a4204c4863\wstorvsc.inf" /forceunsigned
dism /image:"C:\Temp\mount" /add-driver /driver:"C:\Temp\source\drivers\amd64_wvmbus.inf_31bf3856ad364e35_6.0.6001.18016_none_959a72f36267838a
\wvmbus.inf" /forceunsigneddism /image:"C:\Temp\mount" /add-driver /driver:"C:\Temp\source\drivers\amd64_wvmbushid.inf_31bf3856ad364e35_6.0.6001.18016_none_4ccff81064c7c78f
\wvmbushid.inf" /forceunsigneddism /image:"C:\Temp\mount" /add-driver /driver:"C:\Temp\source\drivers\amd64_wvmic.inf_31bf3856ad364e35_6.0.6001.18016_none_5dfb8c2804cc9e9a
\wvmic.inf" /forceunsigned
Injecting drivers

Note that on most of them, the /forceunsigned parameter was necessary. If you don’t use it, this error will appear: “Error 50 The request is not supported”

4. Committing and Unmounting the Boot Image
Now we have are image ready to use it, so we are going to commit the changes and unmount it.
4.1. From cmd:
Dism /unmount-wim /Mountdir:"C:\Temp\mount" /commit

5. Deploying the Image
On C:\Temp you’ll find the WIM file modified and ready to be added to WDS.

5.1. Open the WDS Console, select “Add Boot Image” and complete the wizard.

On the new boot image, I’m adding the Integration Components description

5.2. Boot the new virtual machine from the network and select the image you just added.

And the new virtual machine should be fully functional with the Hyper-V Integration Components included.
How you can you test it? In my case, I’m connecting with RDP to the Hyper-V host and the mouse from inside the virtual machine is working perfectly; if the IC components are not present a message will appear saying that the “Mouse session could not be captured”.

Adding Drivers Using WAIK 1.1 Tools
If you were wondering how to execute the procedure using the WAIK 1.0 or 1.1 tools, here it is:
1. Mount the WIM file using imagex tool:
imagex /mountrw “C:\Temp\Lite Touch Windows PE.WIM” 2 “C:\Temp\mount”
2. Inject drivers using peimg tool:
peimg /inf=C:\Temp\source\drivers\*.inf /image=”C:\Temp\mount”
*.inf is representing all the previous drivers that we added above. Repeat the command line for each file.
3. Commit changes:
imagex /unmount /commit C:\Temp\mount
4. Add the new “Lite Touch Windows PE.WIM” on WDS as a “Boot Image”
Enjoy!
Cheers!
WIM2VHD: Converting WIM files to VHD files
February 9, 2009 at 10:12 am | Posted in WAIK | Leave a commentTags: Image Deployment, WIM2VHD
MSDN Code Gallery just released a first version for a very promising tool: WIM2VHD. With this you can take a raw WIM file (like the ones included inside any Windows 7 or Windows 2008 R2) or a custom WIM (like a captured and customized image) and converted directly to a VHD that you can boot directly using Virtual PC, Virtual Server or Hyper-V.
Take a look at this link: Windows(R) Image to Virtual Hard Disk (WIM2VHD) Converter
Introduction
The Windows(R) Image to Virtual Hard Disk (WIM2VHD) command-line tool allows you to create sysprepped VHD images from any Windows 7 installation source. VHDs created by WIM2VHD will boot directly to the Out Of Box Experience, ready for your first-use customizations. You can also automate the OOBE by supplying your own unattend.xml file, making the possibilities limitless.
Fresh squeezed, organically grown, free-range VHDs – just like Mom used to make – that work with Virtual PC, Virtual Server, Microsoft Hyper-V, and Windows 7′s new Native VHD-Boot functionality!
Requirements
- A computer running one of the following Windows operating systems:
- Windows 7
- Windows Server 2008 R2
- Windows Server 2008 with Hyper-V RTM enabled (x64 only) - The Windows 7 Beta Automated Installation Kit (AIK) or Windows OEM Pre-Installation Kit (OPK) installed.
- A Windows 7 or Windows Server 2008 R2 installation source, or another Windows image captured to a .WIM file.
How to Use It
Create a Windows Server 2008 R2 Server Standard Core VHD, named foo.vhd
CSCRIPT WIM2VHD.WSF /WIM:X:sourcesinstall.wim /SKU:SERVERSTANDARDCORE /VHD:C:foo.vhd
Create a Windows Server 2008 R2 Server Standard VHD with an automatically generated name
CSCRIPT WIM2VHD.WSF /WIM:X:sourcesinstall.wim /SKU:SERVERSTANDARD
Create a Windows 7 Home Premium VHD with an automated setup answer file
CSCRIPT WIM2VHD.WSF /WIM:X:sourcesinstall.wim /SKU:HOMEPREMIUM /UNATTEND:C:stuffunattend.xml
Apply the first image in a custom WIM to a VHD named custom.vhd
CSCRIPT WIM2VHD.WSF /WIM:C:stuffcustom.wim /SKU:1 /VHD:C:custom.vhd
Cheers!
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.




Computer geek, totally fan of the latest's IT platform solutions. Since 2006 I've been mentioned as Microsoft Student Partner, I continue working with them, collaborating on different academic and technological events. On this blog, you'll find most of the experience I have evaluating, designing, implementing and managing those technologies.


