Creating WinPE 2.0 and later image files using the BMC Server Automation script
You can run the CreateWinPE2_x.vbs script to create a WinPE 2.0 and later x86 or x64 image file.
Before you begin
- Prepare the machine on which boot images are created.
- If you plan to create image files for booting from media local to the target server, create a network.ini file.
To create the image file with the script:
Create the input file containing image creation parameters.
Click here for more information on creating the input_parameters.ini fileYou create the input parameters file to provide the CreateWinPE2_x.vbs script with parameters for the boot image: architecture, location of image creation tools, location of the files to be included in the image, and image type.
To create the input parameters file:
- In a text editor, create a new file with the name filename.ini.
Use the following syntax to specify parameters in the input file.
Parameter
Description
Arch
(Required) Specifies the architecture of the server for which you are creating the boot image (x86 or x64).
BLDir
(Required) Specifies the full path to the \provisioning\winpe subdirectory.
For example: C:\BMC_BL\provisioning\winpeDestDir
(Required) Specifies the path to the temporary local directory to hold the image files you are about to create. For example: C:\BMC_BL\tmp
This directory must already exist before you run the CreateWinPE2_x.vbs script.BootDir
(Required) Specifies the boot image name, for example: boot_2_0_x86 or boot_2_0_x64. This name is also the name of the directory containing the image files.
Note that names containing spaces are not supported.
In general, you can set BootDir to:
boot_2_0
so that you can use the default placeholders in provisioning.
When you run CreateWinPE2_x.vbs, it creates a directory in the path specified by DestDir. This new directory has the name specified by BootDir and contains the image files.CustomScript
(Optional) Specifies the path to an optional external script that you want to run when the image is mounted. Specify the script's full path and name.
OverwriteFlag
(Optional) If DestDir already exists and you want to overwrite it, specify OverwriteFlag=Y
RSCDDir
(Local boot image only) Specifies the path to the directory that contains the RSCD agent installer. For example: C:\Installers\RSCD
The directory should contain the rscd.msi file.OSDrvDir
(Local boot image only) Specifies the path to the directory that contains the driver files required for the operating system installation. For example: C:\Installers\Drivers
BMIWinExe
(Local boot image only) Specifies the path to the bmiwin.exe file you want to copy the local media. Specify a path name that includes the file name. For example: D:\DataStore\bmiwin.exe
CopyToISO
(Local boot image only) Specifies whether the script copies the configuration components (RSCD agent installer files, operating system driver files, and bmiwin.exe) to the WinPE ISO or to the LDS directory inside the WinPE image.
Specify CopyToISO=Y to copy these files to the root of the WinPE ISO. This is the default.
Specify CopyToISO=N to copy these files to the LDS directory.NetDetailsFile
(Local boot image only) Specifies the path to the network.ini file.
This file provides network details for each target server (static IP address, subnet mask, default gateway, WINS server) in provisioning environments where there is no DHCP server or where you want to map MAC addresses to static IPs.
Specify a path name that includes the file name. For example: D:\Scripts\network.ini
This file must already exist.AppServer
(Local boot image only) Specifies the IP address of the Application Server that the target server contacts. Specify this parameter when a DHCP server is not present in the provisioning environment or if the DHCP server is not configured to provide the address.
If you specify this parameter, the script includes the IP address in the WinPE image.AppServerPort
(Local boot image only) Specifies the port number for the target server to use in contacting the Application Server. Specify this parameter when a DHCP server is not present in the provisioning environment or if the DHCP server is not configured to provide the address.
If you specify this parameter, the script includes the port number in the WinPE image.CreatePXEFlag
Specifies whether to generate PXE boot files for the image.
Specify CreatePXEFlag=Y to generate the files. (This is the default.) The script creates the image files and puts them in a PXE bootable directory with the name you specified for BootDir. For example: boot_2_0_x86
Specify CreatePXEFlag=N to suppress generation of the files.CreateISOFlag
(Local boot image only) Specifies whether to generate ISO boot files for the image.
Specify CreateISOFlag=Y to generate the files. The script creates the ISO file with the name you specified for BootDir, plus the .iso extension. For example: boot_2_0_x86.iso
Specify CreateISOFlag=N to suppress generation of the files. (This is the default.)CreateUFDFilesFlag
(Local boot image only) Specifies whether to create UFD image files for booting from a USB flash drive.
Specify CreateUFDFilesFlag=Y to generate the files. The script creates a directory with the name BootDir_UFD and puts in it the files for booting from a USB flash drive. For example: boot_2_0_x86_UFD
Specify CreateUFDFilesFlag=N to suppress generation of UFD files. (This is the default.)WAIKRootDir
Specifies a path to the Microsoft Windows Automated Installation Kit (WAIK).
Specify a value if you want to overwrite the default path. The default path is: C:\Program Files\Windows AIKDebug
Specifies whether the script displays output messages as it runs.
Specify Debug=Y to display this information.
Specify Debug=N to suppress the display of this information. (This is the default.)
Example
This example creates a WinPE x86 boot image for booting from the PXE server only.
Arch=x86 BLDir=D:\BladeExtract\winpe DestDir=D:\WinPEImg\x86 BootDir=boot_2_0_x86 CustomScript=D:\Scripts\addADP.bat CreatePXEFlag=Y OverwriteFlag=Y WAIKRootDir=C:\Program Files\WinAIK Debug=N
This example creates two WinPE x86 boot images for booting from local media:
- boot_2_0_x86.iso — An ISO image for booting from CD/DVD
- boot_2_0_x86_UFD — A UFD image for booting from USB flash drive
Arch=x86 BLDir=D:\BladeExtract\winpe DestDir=D:\WinPEImg\x86 BootDir=boot_2_0_x86 RSCDDir=D:\DataStore\RSCD\rscd_76_x86 OSDrvDir=D:\DataStore\Drivers BMIWinExe=D:\DataStore\bmiwin.exe CopyToISO=Y CustomScript=D:\Scripts\addADP.bat NetDetailsFile=D:\Scripts\network.ini AppServer=190.165.33.1 AppServerPort=9831 CreatePXEFlag=N CreateISOFlag=Y CreateUFDFilesFlag=Y OverwriteFlag=Y WAIKRootDir=C:\Program Files\WinAIK Debug=Y
Run the CreateWinPE_2_0.vbs script to create the image files.
Click here for more information on running the CreateWinPE2_x.vbs scriptRun the CreateWinPE2_x.vbs script to create a WinPE 2.0 and later x86 or x64 image file.
Before you begin
- On the machine where you are creating the image files, create a temporary local directory to hold the image files. For example: C:\BMC_BL\tmp.
- Create the input parameters file used by the script. See Creating the input parameters .ini file.
To run the script
At the command prompt, enter the cscript command with the following arguments:
cscript //nologo "createWinPEScriptPath>" <inputFilePath>
Where:
cscript
— Calls the Visual Basic (.vbs) script without displaying a message box type of user interface.
//nologo
— (Optional) Hides the MicroSoft copyright information.
<createWinPEScriptPath>
— Specifies the path to the CreateWinPE2_x.vbs script. Enclose this path in double quotation marks (").
<inputFilePath>
— Specifies the path to the input file containing the image creation parameters.
For example:cscript //nologo "C:\Program Files\WinAIK\Tools CreateWinPE2_x.vbs" C:\winpe_x86.ini
Unknown macro: {multi-excerpt}
Copy the image files to the TFTP server for booting from the PXE server (PXE image type) or to the media you want to use for booting the target server locally (ISO or UFD image types).
Click here for more information on copying image files to a location for provisioning.You copy the WinPE 2.0 and later image files to a location so the provisioning process can use them. The location to which you copy files depends on the image type of the WinPE image you created (PXE, ISO, or UFD).
To copy image files of the PXE image type
Copy the image file to the TFTP server. Perform this step only if you created the image with the CreateWinPE2_x.vbs script. (If you created the image with the image creation wizard, the image creation process copies the image to the TFTP server.)
Click here for more information on copying image files to the TFTP server.You copy the WinPE 2.0 and later boot image to the TFTP server so that the provisioning process can use it with the PXE provisioning technology.
The "image file" is actually a directory containing several separate files. When you run CreateWinPE2_x.vbs, it creates this directory in the path specified by DestDir. This new directory has the name specified by BootDir and contains the image files.
For example if you specified a BootDir name of_
boot_2_0
(the recommended name for the directory), the script creates the boot_2_0 image in DestDir:C:\BMC_BL\tmp\boot_2_0 BCD boot.sdi WinPE.wim
To copy boot image files to the TFTP server
To place the image files on the TFTP server, copy BootDir and its contents to the tftproot directory on the TFTP server. For example:
C:\tftproot\boot_2_0 BCD boot.sdi WinPE.wim
Note
The BLAdmin role must be granted Read and Write access to the TFTP root directory and its contents, including boot image folders and all image files in the folders.
Extract the boot files and copy them to the TFTP server.
Click here for more information on extracting boot files for WinPE 2.0 and later images.After creating the images with CreateWinPE2_x.vbs, you extract the pxeboot.0 and bootmgr.exe files and copy them to the TFTP server.
To extract boot files
- Create a temporary local directory to store the files you are about to extract.
For example: C:\BMC_BL\tmpboot - Open a command window and change directories to the \Tools\PETools subdirectory of the Microsoft Windows Automated Installation Kit (WAIK) installation directory.
For example: C:\Program Files\WinAIK\Tools\PETools - Navigate to the provisioning files that you extracted from provision-files.zip into a temporary directory. In the \provisioning\winpe\ directory, locate the extractpxeboot.vbs script, and copy this file into the \Tools\PETools subdirectory.
- Start the WinPE command prompt by typing:
pesetenv.cmd
Run the extractpxeboot.vbs script to extract pxeboot.0 and bootmgr.exe. Use the following syntax:
extractpxeboot <DestDir> <WAIK_dir>
where <DestDir> is the temporary local storage directory that you created at the beginning of this procedure and <WAIK_dir> is the WAIK installation directory.Example
extractpxeboot C:\BMC_BL\tmpboot C:\Program Files\WinAIK
- Look at the contents of C:\BMC_BL\tmpboot. You should see pxeboot.0 and bootmgr.exe.
Copy these files to the following locations on the TFTP server:- Copy pxeboot.0 into <tftproot>\x86pc\pxelinux.
For example: C:\tftproot\x86\pxelinux\pxeboot.0 - Copy bootmgr.exe into <tftproot>.
For example: C:\tftproot\bootmgr.exe
- Copy pxeboot.0 into <tftproot>\x86pc\pxelinux.
- Create a temporary local directory to store the files you are about to extract.
If the server that contains your data store does not support the NTLMv2 Level 3 setting for Microsoft NT Lan Manager, change the NTLM settings for the WinPE image on the TFTP server.
Click here for more information on configuring WinPE security settings.If the server that contains your data store does not support the Microsoft NT Lan Manager (NTLM) settings for NTLMv2 Level 3, you must change the NTLM settings for the WinPE image on the TFTP server.
Before you begin
The TFTP server must have the Microsoft Windows Automated Installation Kit (WAIK) installed.
To change the NTLM settings
The ImageX command-line tool is deprecated in Windows 8. Use the DISM command-line tool.
For more information, see the following articles:
Use the imagex utility to mount the WinPE image to any empty directory. (The imagex utility comes with WAIK.)
Example
- Create an empty directory, for example C:\new. Copy the WinPE image file WinPE.wim to this new directory.
- Create a mount directory under C:\new.
For example: C:\new\mount - Open a command window and change directories to the \Tools\PETools subdirectory of the Windows AIK installation directory.
For example: C:\Program Files\WinAIK\Tools\PETools - Start the WinPE command prompt by typing
pesetenv.cmd
. - On the WinPE command line enter:
imagex /mountrw C:\new\WinPE.wim 1 C:\new\mount
- Open the registry editor (regedit).
- Click HKEY_LOCAL_MACHINE.
- Choose File > Load Hive.
- Select the file:
%Mounted WinPE Image folder in step1%\Windows\System32\config\SYSTEM - Enter the following key name:
WinPE_Image_SYSTEM
- Browse to: HKEY_LOCAL_MACHINE\WinPE_Image_SYSTEM\ControlSet001\Control\Lsa
- This step describes how to add an entry if the LMCompatibilityLevel value does not currently exist. If an LMCompatibilityLevel value already exists, you can edit the existing entry to match these values.
Select Edit > New> DWORD Value, and then add the following registry values:
Value Name: LMCompatibilityLevel
Data Type: REG_DWORD
Value: 3
Valid Range: 0,3 - Click HKEY_LOCAL_MACHINE\WinPE_Image_SYSTEM.
- Choose File > Unload Hive.
- Use imagex to unmount the mounted WinPE image:
imagex /unmount /commit MountFolder
To copy image files of the ISO image type
Click here to view the steps to copy image files of the ISO image type.Copy the bootImageName.iso file to the CD or DVD. You can also copy the image to a location for use directly through iLO, virtual CD-ROM, or network mapped driver.
To copy image files of the UFD image type
Click here to view the steps to copy image files of the UFD image type.- Format a USB drive for the FAT32 file system.
Copy the all of the files and folders in the bootImageName_UFD directory to the root of the USB drive.
Comments
Log in or register to comment.