原文地址:[url]http://blogs.technet.com/mniehaus/archive/2008/09/13/using-the-hyper-v-integration-components-with-mdt-2008-update-1-lite-touch.aspx[/url]
 
把家里的三台机器重新整理了一下,配上了x64的windows2008,就为了试一下hyperv的威力
 
不过hpyerv毕竟不是vmware,使用上还是有些区别,其中一点就是虚拟机的驱动并不像vmware那样容易获得,而是打包放在一个msu包里,直接安装使用的.
 
我当然不需要这个安装包,因为这样没法供pe使用,所以需要把包里的驱动提取出来
 

Step #1: Obtaining the drivers

First you need the Hyper-V integration components from the "VMGUEST.ISO".  The easiest way to do this is from inside a virtual machine: mount the ISO and extract the needed Windows6.0-KB951634-x86.msu file into a new, empty directory.  (See the other blog entries for details.)  Then you need to first extract the x86 drivers:
首先你需要从"vmguest.iso",他存放在windows\system32下,解压文件找到Windows6.0-KB951634-x86.msu,写一个批处理包含下面部分:
MD MSU
expand  Windows6.0-KB951634-x86.msu -F:*.CAB MSU
MD Files
expand  MSU\Windows6.0-KB951634-x86.cab -F:* Files
(I skipped David's steps that rearranged the files and cleaned up the temporary working directories.  You can choose to do those if you like.)  Here's what it would look like (except for the output of the final command):
x86
Repeat the steps for the x64 drivers too, using a different new, empty directory because some of the file and directory names will be the same:
重复上面的步骤,提取x64的驱动
MD MSU
expand  Windows6.0-KB951634-x64.msu -F:*.CAB MSU
MD Files
expand  MSU\Windows6.0-KB951634-x64.cab -F:* Files
Not surprisingly it will look it looks just like the x86 output, just with different directory and file names:
x64
The final EXPAND command for both x86 and x64 should show 305 files extracted (at least if you are using the Hyper-V RTM integration components; the number may change in the future):
最终大概是305个文件,当然这个是rc1的,如果rtm的话可能有变化
305Files 
One important note:  If you try this on Windows Server 2003 or Windows XP, it may not work properly because these operating systems contain earlier versions of EXPAND.EXE and related DLLs.  You won't see any errors or any other indication that the process didn't work; the resulting file count will be much smaller.  Ideally, use Windows Vista or Windows Server 2008 to do the extraction.  (If you are desperate, you could copy the EXPAND.EXE, DPX.DLL, and MSDELTA.DLL files from a Windows Server 2008 OS or p_w_picpath.  Place these files into the empty directories you create above, then make sure you run them by specifying ".\EXPAND.EXE" so that Windows doesn't find them in the system path first.)
一个非常需要注意的事情,你最好不要在windows 2003或windowsxp下来做这件事情,因为那样会有些不正常,因为expand命令的版本太旧.如果这么做了,你不会收到任何错误信息,但得到的文件会非常小.最好的办法就是用vista或者2008来做.

Step #2: Adding the drivers to Workbench

This sounds like it should be really easy, and it almost is.  First, import the x86 integration component drivers , pointing to the directory "files" directory you created above (in my case, "C:\x86\Files").  Create a new driver group called "Windows PE Drivers" and be sure to import the drivers into that group:
Import
Now look at the results of that import:
Imported
Notice that some of the drivers say that they are for both x86 and x64 platforms.  Well, that's not actually true, as these are only x86 drivers.  So we'll take advantage of a new MDT 2008 Update 1 feature to de-select the x64 platform for each of these drivers.  Right click on each of the drivers and choose "Properties," then uncheck the "x64" checkbox:
注意的是,有些驱动标注x64和x86通用,但事实却不是这样的,所以我们要用mdt2008 update1的功能把x64的驱动排除在外,选中那些驱动,检查属性,并选择所能支持的系统架构.
Uncheck
Now we need to repeat this same process for x64 drivers, this time selecting the "c:\x64\Files" directory and the "Windows PE Drivers" group created previous.  But there's one other important item:  You need to check the "Import drivers even if they are duplicates of an existing driver" box:
添加64位驱动时,注意钩选"Import drivers even if they are duplicates of an existing driver"
Import
If you didn't do this, Deployment Workbench will think the drivers are already present and won't import them again.  It checks for duplicates based on the class, manufacturer, and version.  In this case, all of those values are the same so we wouldn't import the drivers again.  By checking the box, they'll all get imported anyway.
如果不这么做,mdt会认为这些驱动已经存在而不会再次引进他们.
You'll notice now that there are again some that say they are for x86 and x64.  Uncheck the "x86" checkbox for these newly-imported drivers since they are all x64 drivers.
You should now have this full list of drivers:
同样,去掉那些x86的选项
Full
Notice the paths for each of the drivers: The ones with the "_(1)" suffix wouldn't have been imported if you didn't check the "import duplicates" box.  (This also points out another change in MDT 2008 Update 1: We no longer create driver directories containing spaces in them.  This is related to a problem with the processing of [SysprepMassStorage] sections by sysprep.exe on Windows XP or Server 2003.  More on that some other time.)
 

Step #3: Creating new Windows PE p_w_picpaths

With all the needed drivers in place, we just need to tell Deployment Workbench to use them.  Open the properties of the lab deployment point and specify the "Windows PE Drivers" group you created previously.  (Be sure to check the "x64" box on the General tab if you want x64 p_w_picpaths.)  Also specify to "Include all drivers from the selected driver group":制作pe时,你需要选中所有的驱动
Deploy 
This "include all drivers" checkbox is another new feature in MDT 2008 Update 1.  Without this checkbox, we could only inject mass storage, network, video, and system-class drivers.  With this, we'll inject all the drivers in the specified group.  Why does this matter?  Well, in this case we want to be sure to inject the HIDClass drivers you can see in the above list.  HID stands for "human interface device."  This is the driver that enables mouse integration so that you no longer need to press Control-Shift-Left Arrow all the time you are working in Windows PE.
"include all drivers" 是mdt2008 update 1里的一个新变化,如果不这样,我们只能加入部分驱动,但加入所有驱动有什么好处呢?因为可以加入hidclass类的驱动,这样就可以直接在虚机移动鼠标自动切换
Also make sure that you have added all the existing drivers, at least for networking and mass storage, into the same "Windows PE Drivers" group, otherwise your Windows PE boot p_w_picpaths will work on Hyper-V but not on any machine requiring other out-of-box drivers.
Now, you can "Update" the deployment point to generate the new p_w_picpaths containing the drivers that were imported in the previous step and selected in this one.  Want to see the proof that they were all injected?  Check the %TEMP%\DeployUpdates_x86.log (or %TEMP%\DeployUpdates_x64.log for the x64 boot p_w_picpath) to see each of them being imported.  (Search for "/inf=" to find the right lines.)
查看%TEMP%\DeployUpdates_x86.log (或者%TEMP%\DeployUpdates_x64.log)可以看到每一个添加的东西
In David's blog he mentioned that you would need to create the Windows PE p_w_picpaths in separate steps.  He was talking about using two different driver groups, one for x86 containing the x86 drivers and one for x64 containing the x64 drivers.  This was necessary for two reasons:
  1. There's no way to specify different driver groups for x86 and x64.
  2. There was no way to alter drivers that didn't specify the right platforms.
The first reason is really needed because of the second.  But now since MDT 2008 Update 1 allows you to override the platform on each driver, you can again get back to a single driver group - both problems solved.
因为驱动无法自动判断自己的架构,所以之前我们只能分别添加不同的驱动组,现在有了update 1,就没有这个问题了

Step #4: Exclude the Hyper-V drivers from from the full OS

Now that there are Hyper-V drivers included in Deployment Workbench, they will also be injected into the full OS.  That's less than desirable because we really want the Hyper-V drivers to be installed in the full OS using the integration components.  So if you want to prevent this, you can create a new driver group containing all the non-Hyper-V drivers.  (Yes, if you have lots of drivers this is a fairly painful process as you need to select the new group by opening the properties of each driver individually.)
Once you've created this group, e.g. "Full OS Drivers", you need to tell the MDT scripts to only use this group.  There's no user interface in the task sequence editor to specify this, but you can add it to CustomSettings.ini (on the Rules tab of the deployment point):
Rules
If you skipped this step, it probably wouldn't hurt anything, but you do want to make sure the integration components are installed afterwards.

Step #5: Install the Hyper-V integration components

Now we need to install the integration components themselves.  (Yes, this isn't related to Windows PE, but hey, go back and read the title: it's not all about Windows PE).  The easiest way to do this is to set them up as an application.  In Deployment Workbench, create a new application with source files (so we don't need to worry about mounting the VMGUEST.ISO), pointing to the "e:\support\x86" directory (where E: is my DVD drive in the VM) that contains all the needed files.  For the command line, specify "setup.exe /quiet /norestart".  After the application has been added, modify the properties to specify "Reboot the computer after installing this application".  (If you want, you can also modify the platform restrictions so this application is only seen on supported OSes.)
Repeat the same process for the x64 integration components, pointing to the "e:\support\amd64" directory.
With these applications created, you can now select them in the Lite Touch deployment wizard.  If you want to automate this by adding the application into the task sequence, you can certainly do that instead (hiding the applications from the wizard at the same time).

Finally!

With these pieces in place, it should be that much easier to work with MDT 2008 Update 1 and Hyper-V.  When I started writing this up (a long time ago, before MDT 2008 Update 1 was even released) I didn't think it would take so long.  And I'm sure I didn't need to be quite so verbose...
Published Saturday, September 13, 2008 1:40 AM by mniehaus