Walkthrough: Deploy a Windows RE Image on Hard Drive
This walkthrough describes how to deploy a Windows Recovery Environment (Windows RE) image onto a hard drive. Windows RE is a solution that is based on Windows PE 2.0. In this example, you build a master computer that contains two partitions, one for Windows Vista and one for Windows RE. Once installed, you configure Windows Vista Boot Manager to automatically failover to Windows RE when Windows Vista is unable to boot.
Important
This walkthrough outlines how to build the Windows RE solution, not a complete Windows Vista image. You must still create a separate Windows Vista installation.
This walkthrough illustrates a hidden (type 0x27) Windows RE disk configuration. In the following illustration, the Windows RE partition is located in front of the Windows Vista partition.
Windows RE-only (hidden)
Windows RE Type 0x27 1 gigabyte (GB) |
Windows Vista Type 0x7 (active) |
There are other Windows RE disk configurations that coexist with Bitlocker Drive Encryption. For more information about disk configurations, see Preinstallation Design.
Prerequisites
To complete this walkthrough, you will need the following:
- A Windows RE image as described in Walkthrough: Create a Windows RE Image.
- A technician computer that provides all the tools and the source files. For more information, see Building a Technician Computer.
- An authorized copy of Windows Vista.
- A USB flash drive (UFD). In this example, the storage size must be 256 megabytes (MB) or bigger, depending on how many additional applications that you include in your Windows RE image.
- A master computer on which you will deploy Windows Vista and Windows RE.
Step 1: Create an answer file
In this step, you build a catalog file (.clg) and a new blank answer file. A .clg file is a binary file that contains the state of all the settings and the packages in a Windows image.
- On your technician computer, insert the Windows Vista product DVD into the local DVD drive.
- Navigate to the \Sources directory on the Windows Vista DVD. Copy the Install.wim file to your technician computer.
- Click Start, point to Programs, point to Microsoft Windows OPK (or Windows AIK), and then click Windows System Image Manager.
- On the File menu, click Select Windows Image.
- In the Select a Windows Image dialog box, navigate to the location where you saved the Install.wim file, and then click Open.
Note
A warning will appear that a catalog does not exist. Click OK to create a catalog. A catalog file (.clg) is a local file that contains all the available settings.
- On the File menu, click New Answer File.
Step 2: Define Windows RE settings
In this step, you define Windows RE partition requirements in your answer file. In addition, you will set a synchronous command to run a SetAutofailover.cmd script.
In Windows SIM, in the Windows Image pane, expand the Components node to display available settings.
In the expanded list of components, add the following components to your answer file by right-clicking the component and then by selecting the appropriate configuration pass.
Component | Configuration Pass |
---|---|
Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions\CreatePartition |
1 windowsPE |
Microsoft-Windows-Setup\DiskConfiguration\Disk\ModifyPartitions\ModifyPartition |
1 windowsPE |
Microsoft-Windows-Setup\ImageInstall\DataImage\InstallFrom |
1 windowsPE |
Microsoft-Windows-Setup\ImageInstall\DataImage\InstallTo |
1 windowsPE |
Note
Expand the component list until you see the lowest setting that is listed above, and then add that setting to your answer file. This shortcut will add the setting and all parent settings to your answer file in one step.
- All the settings that you added must appear in the Answer File window. Select and configure each setting as specified below.
Component | Value | ||
---|---|---|---|
Microsoft-Windows-Setup\DiskConfiguration |
|
||
Microsoft-Windows-Setup\DiskConfiguration\Disk |
|
||
Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions\CreatePartition |
|
||
Microsoft-Windows-Setup \DiskConfiguration\Disk\ModifyPartitions\ModifyPartition |
|
||
Microsoft-Windows-Setup\ImageInstall\DataImage |
|
||
Microsoft-Windows-Setup\ImageInstall\DataImage\InstallFrom |
For example, |
||
Microsoft-Windows-Setup\ImageInstall\DataImage\InstallTo |
Note The Credentials settings are not required for this walkthrough. You must delete the Credentials entry from your answer file to validate your answer file.
|
Validate the answer file, click Tools, and then click Validate Answer File.
If an error occurs, correct the error and revalidate the answer file.Save the answer file.
Step 3: Define Windows settings
By using the same answer file from Step 2, you define Windows Vista settings. The settings in this example will configure a single partition, will set the locale, and will boot the computer into Audit mode.
In Windows SIM, in the Windows Image pane, expand the Components node to display available settings.
In the expanded list of components, add the following components to your answer file.
Component | Configuration Pass |
---|---|
Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions\ CreatePartition |
1 windowsPE |
Microsoft-Windows-Setup\DiskConfiguration\Disk\ModifyPartitions\ ModifyPartition |
1 windowsPE |
Microsoft-Windows-Setup\ImageInstall\OSImage\InstallTo |
1 windowsPE |
Microsoft-Windows-Setup\UserData |
1 windowsPE |
Microsoft-Windows-Shell-Setup \OEMInformation |
4 specialize |
Microsoft-Windows-Shell-Setup \AutoLogon |
7 auditSystem |
Microsoft-Windows-Shell-Setup\OOBE |
7 oobeSystem |
Microsoft-Windows-International-Core-WinPE\SetupUILanguage |
1 windowsPE |
Microsoft-Windows-Deployment\Reseal |
7 oobeSystem |
Microsoft-Windows-PnpSysprep |
3 generalize |
- All the settings that you added must appear in the Answer File pane. Select and configure each setting as specified below.
Component | Value | ||
---|---|---|---|
Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions\CreatePartition |
|
||
Microsoft-Windows-Setup \DiskConfiguration\Disk\ModifyPartitions\ModifyPartition |
|
||
Microsoft-Windows-Setup\ImageInstall\OSImage\ |
|
||
Microsoft-Windows-Setup\ImageInstall\OSImage\InstallTo |
|
||
Microsoft-Windows-Setup \UserData |
|
||
Microsoft-Windows-Setup \UserData\ProductKey |
|
||
Microsoft-Windows-Shell-Setup \OEMInformation |
|
||
Microsoft-Windows-Shell-Setup \AutoLogon |
|
||
Microsoft-Windows-Shell-Setup \OOBE |
|
||
Microsoft-Windows-International-Core-WinPE |
|
||
Microsoft-Windows-International-Core-WinPE\SetupUILanguage |
|
||
Microsoft-Windows-Deployment\Reseal |
|
||
Microsoft-Windows-PnpSysprep |
|
Validate your answer. To do this, click Tools, and then click Validate Answer File.
If an error occurs, correct the error and revalidate.Save your answer file.
Step 4: Create a configuration set
In this step, you create a configuration set. The benefit of this method is that all the files that are necessary for the installation are contained in one location. In this example, you save the configuration set to a USB flash drive (UFD).
- In Windows SIM, on the Tools menu, select Create Configuration Set.
The Create Configuration Set window opens. - Specify a destination location where you intend to publish the configuration set (for example, directly to your UFD), and then click OK.
Important
This feature creates an answer file (Autounattend.xml) and a resource folder (\AutoUnattend_Files). In this example, both the file and the folder must be located at the root of your UFD.
Step 5: Add partition repair script
In this step, you create a partition repair script called WinREPartitionInfo.xml. The script helps repair hidden and customized partitions if disk corruption occurs.
Create an .xml file called WinREPartitionInfo.xml with the following content.
<WinREPartitionInfo> <NotActive/> <WinREHiddenPartition/> </WinREPartitionInfo>
<NotActive> instructs Windows RE not to set the first partition to active in the event you have multiple boot partitions. <WinREHiddenPartition> instructs Windows RE to set the Windows RE partition as type 0x27 with no drive letter assigned. This method does not support other hidden partition types.
By using your removable media, place a copy of the file at the root of each hidden or customized partition.
Step 6: Copy script to USB flash drive
In this step, you include the provided Setautofailover.cmd script, which configures Windows Vista to start Windows RE during a failover. You copy the script to your UFD.
Copy Setautofailover.cmd to the root of your UFD. For example,
copy c:\Program Files\<version>\recovery\setautofailover.cmd e:
where <version> can be Windows OPK or Windows AIK and e is the letter of the root of your UFD.
Step 7: Build your master installation
In this step, you build your master installation by using a Windows Vista product DVD and your configuration set. After setup completes, you manually run the Setautofailover.cmd script.
Turn on the master computer.
Insert both the removable media containing your configuration set and the Windows Vista product DVD into the new computer.
Restart the computer (CTRL+ALT+DEL).
Windows Setup (Setup.exe) begins automatically. By default, Windows Setup searches all removable media for an answer file called Autounattend.xml.After Setup completes, the computer starts in Audit mode. Verify that all your customizations were applied.
At a command prompt, run Setautofailover.cmd with the following parameters.
e:\Windows\setautofailover.cmd /target d: /mainos {default} /disk 0 /partition 1
where e is the letter of the root of your UFD device. When you are finished, reseal and shut down the computer. In the System Preparation Tool dialog box, select the appropriate options.
For Extensible Firmware Interface (EFI) systems, you must configure use for GUID Partition Table (GPT) disk. To configure for GPT, add the /gpt option. Here is an example of this command.e:\Windows\setautofailover.cmd /target d: /mainos {default} /disk 0 /partition 1 /gpt
Important
If you select the sysprep generalize option, the failover settings will be removed. To generalize the image for build-to-plan (BTO) environments, run Setautofailover.cmd during the oobeSystem pass. For example, copy the script to the root of the hard drive and specify a RunsynchronousCommand during oobeSystem pass in your answer file. To do this, select Insert, then Synchronous Command, and then Pass 7 oobesystem.
Alternate Configuration: Windows RE as a .wim File
Windows RE can also be installed directly as a .wim file instead of an expanded image on the hard disk partition. When you use this configuration:
The Windows RE .wim image file must be named Winre.wim.
The Windows RE .wim image file must be located at the root directory of the target partition.
When defining the Windows RE settings in the answer file, the following components should be used.
Component | Configuration Pass |
---|---|
Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions\CreatePartition |
1 windowsPE |
Microsoft-Windows-Setup\DiskConfiguration\Disk\ModifyPartitions\ModifyPartition |
1 windowsPE |
Microsoft-Windows-Setup\RunSynchronous\RunsynchronousCommand |
1 windowsPE |
- The settings should be configured as follows:
Component | Value | ||
---|---|---|---|
Microsoft-Windows-Setup\DiskConfiguration |
|
||
Microsoft-Windows-Setup\DiskConfiguration\Disk |
|
||
Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions\CreatePartition |
|
||
Microsoft-Windows-Setup \DiskConfiguration\Disk\ModifyPartitions\ModifyPartition |
|
||
Microsoft-Windows-Setup\RunSynchronous\RunsynchronousCommand (windowsPE Configuration Pass) |
Copies Windows RE image file.
Note You must create the CopyWinRE.cmd script to copy both your Windows RE image and the boot.sdi file to the destination partition. Boot.sdi can be found in your Windows PE build environment under the \ISO\Boot directory (for example, C:\Winre_x86\ISO\Boot).
|
To set the automatic failover mechanism by using the /wim option, run the following command:
setautofailover.cmd /wim /target d: /mainos {default} /disk 0 /partition 1
The /wim option in Setautofailover.cmd configures the computer to use Winre.wim from the root directory of the destination partition as the Windows RE image.
For Extensible Firmware Interface (EFI) systems, you must configure use for GUID Partition Table (GPT) disk. To configure for GPT, add the /gpt option. For example,
setautofailover.cmd /wim /target d: /mainos {default} /disk 0 /partition 1 /gpt
Next Step
You can also create Windows RE media. For more information, see Walkthrough: Create a Windows RE Recovery Media.