设为首页 收藏本站
查看: 739|回复: 0

[经验分享] Injecting VMware drivers into your Windows 7/2008R2 Install Discs

[复制链接]

尚未签到

发表于 2018-6-7 08:08:43 | 显示全部楼层 |阅读模式
  I like to perform unattended installations of my operating systems, like  Windows Server 2008 R2 or Windows 7 using autounattend.xml so that  requires that the image have the required drivers to recognize critical  devices like mass storage hardware. 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.

So you have two options:

1) Extract boot floppies from an ESXi update. I posted a blog  on this a while back. Then you need to mount the virtual floppy image  during the Windows install process and manually load the driver. This  does not work for an unattended installation as Windows doesn't  automatically look for mass storage drivers.  

2) Inject the mass storage drivers directly into the boot.wim file,  so it is 'baked in' and then you can use an automated Windows install  process all while using the high performance SCSI driver. I also inject  the drivers into the main OS image (install.wim) so they are available  to the operating system after installation.

Since option #2 is more automated, that is of course the option that I  want to use. It's a bit of a complicated process, but in the end in  makes life easier. This process can work for other drivers as well, if  you also want to use the ISO image on a physical server that has a  unique mass storage controller, for instance.

Here is the basic process:

1) You will need to download and install the Windows Automated Installation Kit  (WAIK). I used the latest version for Windows 7. Best practices is to  install it on a x64 computer, so you can manipulate x64 images should  you need to do that.

2) Perform a fully default installation of the WAIK. After the  installation is complete, launch the Deployment Tools command prompt.

3) Mount the ISO image of your operating system. Navigate to the Sources directory and copy boot.wim to your computer, say on the D:\ drive.

4) Create a folder on your D:\ drive called Drivers.  VMware provides both 32-bit and 64-bit pvscsi drivers, and you must use  the right one depending on what CPU architecture you are injecting the  drivers into. The easiest solution is to leverage an existing 32-bit or  64-bit VM running on vSphere and go into the C:\Program Files\VMware\VMware Tools\Drivers\pvscsi and copy the files in there to D:\drivers.

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 (40K vs  35K for vSphere 4.1).

Do not inject both drivers into your image; only use the matching driver  for the OS you are modifying. Server 2008 R2 is 64-bit only, whereas  you have a choice with Windows 7.

5) Create a folder on the D:\ drive called Mount.

6) In the deployment tool command prompt type:

dism /get-wiminfo /wimfile:d:\boot.wim

And look at the index numbers. This is key!  You must select index 2,  the Windows setup image. If you inject the drivers into index 1, the  Windows setup routine will NOT see them and you will be banging your  head against the wall.
DSC0000.jpg

  
7) In the deployment tool command prompt type:

dism /Mount-Wim /WimFile:D:\boot.wim /Index:2 /MountDir:D:\mount

8) You should see an operation successful if the image mounted properly.

9) In the deployment tool command prompt type:

dism /image:D:\mount /Add-Driver /driver:d:\drivers\pvscsi.inf

10) You should see an operation successful if the driver was injected properly.

11) Commit the changes and unmount the image with this command:

dism /unmount-wim /mountdir:d:\mount /commit

12) At this point I also inject the same drivers into the  sources\install.wim file, so the drivers are present before VMware tools  gets installed. You follow the same procedure of mounting the WIM,  adding the drivers, and then committing the changes. Most install.wim  files have multiple images in them, so execute step #6 to list all of  the images in the WIM and select the right one(s) to inject the drivers  into.

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 you won't need to manually mount a  virtual floppy drive to use a pvscsi boot disk.

If you also want to inject the VMware vmxnet3 drivers, you can use the  same procedures. But where do you find the drivers? On a VM running on  vSphere navigate to C:\Program Files\VMware\VMware Tools\Drivers\vmxnet3. Copy all of the driver files to the same driver folder from above, and run step #9 a second time, but specifying the vmxnet3ndis6.inf file. Unlike the pvscsi driver, the VMXNET3 driver supports both 32-bit and 64-bit versions with the same set of files.

I would not recommend including the VMware mouse driver (vmmouse.inf) as  it's an unsigned driver and you will get an “Error 50 The request is  not supported” when you try and commit the image changes, unless you use  the /forceunsigned switch when adding the driver. VMware tools will of  course install the mouse driver, so just leave this driver out.

Update: I wrote a blog about incorporating these  drivers into the Windows Recovery environment. This can be very useful  if a server goes belly up and you want to try and repair it. You can  check that out here.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-520015-1-1.html 上篇帖子: vmware workstation 克隆后网卡eth0不能正常工作 下篇帖子: VMware Resource Pool Recommendations
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表