Welcome to BLOGIT.NU
Login or Register Home  ·  Articles  ·  Downloads  ·  Your Account  ·  Forums  ·  About  

  Menu
· Home
· Articles
· Donations
· Downloads
· Forums
· Search
· Sitemap
· Statistics
· Stories Archive
· Submit News
· Top 10
· Topics
· Web Links
· Your Account

  Current users
Welcome, Anonymous
Nickname
Password
(Register)
Membership:
Latest: evaultbk
New Today: 1
New Yesterday: 23
Overall: 4797

People Online:
Visitors: 17
Members: 3
Total: 20

Online Now:
01 : Dindalik
02 : aapamokawa
03 : DingnelP

  Last articles
· About
· Track the growth of your SQL Databases
· Truncate SQL Transaction Logfiles
· Creating a customized WinPE for Vmware
· Programming the VMware SDK1.x using vbscript
· Cloning a VM using vbscript
· Explanation of Virtual Center's customization process

Creating a customized WinPE for Vmware
by Tom Arentsen




In managing a vmware environment I make extensively use of winPE, for the deployment of new VM's, shrinking and extending disk, P2V's and its my primary tool when troubleshooting.

This article is a step by step guide on how build a customized winPE for your vmware environment, it will also include the Vmware tools (and I will give you an example where I needed it) and I will also show how you can run vbscript from within your WinPE environment to programm the Virtual Center webservice (SDK).
Let's get started and build our customized winPE for our Vmware environment.
What you need is the following:


Note: The package includes the vmware tools, which you might have to update it with the correct version of your environment !!
I have choosen for a Windows 2003 source, but you can as well use a Windows XP, therefore I have included both the LSI Logic driver and VMware SCSI Buslogic driver as part of the package and so both will be loaded by WinPE.

Next you copy the content of the WinPE folder from your WinPE CD to C:\vmPE\WinPE and copy the contents of the Windows 2003 CD to C:\vmPE\W2K3.
Then replace the following four files in the C:\vmPE\WinPE folder WINPESFT.INF, WINPESYS.INF, WINPEOEM.SIF and CONFIG.INF with the customized files located in the folder C:\vmPE\WinPESupport.
These files are modified, to include the vmware tools, to load additional Mass Storage drivers and to load WinPE in RAM.
Now we are ready to start the building our customized winPE image, open a command prompt and perform the following steps:
> cd /d C:\vmPE\Winpe

> mkimg.cmd C:\vmPE\W2K3 C:\vmPE\CDImage (Builds the basic image)

Let's add the HTA, wSH and ADO components to our image

> cscript //nologo BuildOptionalComponents.vbs /S:"C:\vmPE\W2K3" /D:"C:\vmPE\CDImage" _
   /WSH /ADO /HTA /Q (This command adds WSH, ADO and HTA support to our winPE image)

We have to inject the vmxnet and mouse driver into our image

> drvinst.exe /q /inf:C:\vmPE\WinPESupport\Drivers\NET\vmxnet\oemsetup.inf  _
   "C:\vmPE\CDImage"
> drvinst.exe /q /oscd:c:\vmPE\W2K3 /inf:C:\vmPE\WinPESupport\Drivers\Mouse\vmmouse.inf _
   "C:\vmPE\CDImage"

If you want writable RAM drive in your WinPE Image do the following:

> XCopy "C:\vmPE\WinPESupport\RAMDrv\RAMDrv.sys" _
   "C:\vmPE\CDImage\i386\System32\Drivers\" /vcy
> XCopy "C:\vmPE\WinPESupport\RAMDrv\RAMDrv.inf" _
   "C:\vmPE\CDImage\i386\inf\" /vcy

In order to read and process XML files (and accessing the VC webservice from you winPE) 
add the following files two your image:

> XCopy "C:\vmPE\WinPESupport\MSXML\*.*" _
   "C:\vmPE\CDImage\i386\System32" /vcy

Copy your customized startnet.cmd file and favorite tools to WinPE Image 
(like: devcon.exe, vmdev.exe (VM Back))

> XCopy "C:\vmPE\WinPESupport\Scripts\*.*" _
   "C:\vmPE\CDImage\i386\System32" /vcy

Copy the Vmware tools folder to your image
	
> XCopy "C:\vmPE\WinPESupport\VMware\*.*" _
   "C:\vmPE\CDImage\Program Files\Vmware\" /evcy

Copy the Mass Storage Drivers to the WinPE Image:

> XCopy "C:\vmPE\WinPESupport\Drivers\MassStorage\*.*" _
   "C:\vmPE\CDImage\i386\System32" /evcy
So now that our customized WinPE Image is finished, lets create an ISO image that you can copy to your ESX servers:
> oscdimg.exe -betfsboot.com -n -lvmpe "C:\vmPE\CDImage" "C:\vmPE\vmpe.iso"
Assign the vmpe.iso to a VM and test it out, to learn more about programming the SDK using vbscript (which you can use now in your WinPE environment), click here

Booting WinPE with Static IP Addresses:

There is one more thing I would like to touch on, before finishing. A few weeks ago I was at client that didn't have DHCP enabled and therefore we had to work with Static IP Addresses in order to get network activity in our winPE. Now normally this is not so much of an issue as you insert a floppy with a winbom.ini containing the correct IP settings and factory -winpe will read and apply these settings.
But how are you going to boot WInPE with an ISO image and floppy assigned to a brand-new never booted VM ? You can't just modify boot-order of the VM bios (until now I haven't been able to find a tool that can do this (like you can with the HP bios)), also on the vmware forum I have seen statements that the very first time a VM boots it always boots from CD.! Now this would have solved my issue, but unfortunately this is not the case, if you assign a floppy and cd, even on your first boot it follows the boot order defined at the BIOS. (at least that's what I have experienced).

So what I had to do in order to get this working was the following: (ps. the process described was completely scripted)
When I scripted the creation of my VM, I assign a WinPE ISO Image to my CD-ROM, then I would start my VM, wait a few seconds and inject my floppy. Easy enough is it not... unfortunately my winPE image couldn't read from my floppy for some odd reason, I had to manually disconnect and connect my VM before WinPE could read from my floppy. Now this is the bit where I needed the Vmware Tools working in my WinPE Image, because there is no option to do this using the SDK1.x, so I had to use VM Back's vmdev.exe utility which communicates via the vmware tools to the devices of the VM.
When you download the package, you will find a script doflop.vbs, this is why !!?

Download the source files

Check out VM Back's utilities

If you want to customize your WinPE image even more, check this link out and customize your boot screen, when doing so don't forget to remove the /noguiboot option in your config.inf file before building your image...









Copyright © by BLOGIT.NU All Right Reserved.

Published on: 2006-11-04 (8124 reads)

[ Go Back ]
Content ©
You can syndicate our news using the file or ultramode.txt
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © 2006 by me.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.08 Seconds