Capturing Windows 7 machines and deploying using imageX
Recently I had to capture a mirror image of a ready Windows 7 machine. The machine was ready in the sense that Windows 7 was configured and up-to-date. In addition, all the primary software that we use at the college where I work was installed and updated. I will outline in this article the steps we used to deploy the captured and ready image to other machines.
The first step is to download and install Microsoft Window Automated Installation Kit (Waik) and create a WinPE Boot Disk.
Download the file here and be sure to select the right language.
Once you have WAIK installed click Start, All Programs, Windows AIK, and right click Deployment Tools Command Prompt and Run as administrator.
At the prompt we need to run the Copype.cmd script:
Choose the appropriate options for both: can be x86, amd64 or ia64. points to a local directory. I will be using x86 and copying to the C: drive.
Next you need to copy the Windows PE base image (winpe.wim) to the Winpe_x86\ISO\sources folder, renaming it to Boot.wim in the process. We do this by running the command seen in the screenshot.
Now that we have the base image ready we just need to add ImageX, which is the app that we will use for capturing our images.
We need to copy imagex.exe to our ISO folder:
copy “C:\program files\<version>\Tools\<architecture>\imagex.exe” C:\winpe_x86\ISO\
Again, choose the appropriate options for both. <version> is Windows AIK. <architecture> can be x86, amd64 or ia64.
Now that we have the base image (boot.wim) and our capture app (imagex.exe) added to the ISO folder its time to create the actual ISO file.
Run the following command where C:\winpe_x86\ISO is the location of the source files, and C:\winpe_x86\winpex86.iso is the destination .iso file.
Oscdimg -n -bC:\winpe_x86\Etfsboot.com C:\winpe_x86\ISO C:\winpe_x86\winpex86.iso
Now if you navigate to C:\winpe_x86 (or the destination specified in the previous step) you will see your Windows PE ISO waiting to be burned to a disk.
The second step is to capture the image from the machine that has been freshly setup using imageX
At this point you could perform a sysprep to ready your machine, this includes resetting user information and windows activation. You can get more information here http://technet.microsoft.com/en-us/library/dd744512(v=ws.10).aspx
You must start and boot your computer with the WinPE boot cd and determine which partition to capture
- At the Windows PE command prompt, type
diskpartto open the DiskPart tool.
- Select the hard disk with the
select diskcommand. For example,
DISKPART> select disk 0
- View the partitions with the
list partitioncommand. For exampleDISKPART> list partition
DISKPART> list partition
Partition ### Type Size Offset
————- —————- ——- ——-
Partition 1 Primary 300 MB 1024 KB Partition 2 Primary 200 GB 301 MB 4. Select the partition with the
select partitioncommand. For example,
DISKPART> select partition=1
assign lettercommand. For example,
exitto return to the Windows PE command prompt.
6. At the Windows PE command prompt, open the directory that contains the ImageX tool. For example
7. Capture images for each customized partition.
To capture the images, use the ImageX command with the /capture option. For example,
imagex /capture c:\ c:\my-windows-partition.wim "My Windows partition"
imagex /capture s:\ c:\my-system-partition.wim "My system partition"
The third step is to apply and restore the .wim to another computer using imageX
- Start the destination computer by using your Windows PE boot cd.
- At the Windows PE command prompt, type
diskpartto start the DiskPart tool.
- Create your partition structure using the diskpart commands.
select disk 0 clean create partition primary size=350 format quick fs=ntfs label="System" assign letter="S" active create partition primary size=75000 format quick fs=ntfs label="Windows" assign letter="W" create partition primary size=15000 format quick fs=ntfs label="Recovery image" assign letter="R" attributes volume set nodefaultdriveletter exit
For each partition that you apply an image to, run the ImageX/apply <image_file> <image_number | image_name> <image_path> command.
imagex /apply N:\Images\my-windows-partition.wim 1 W:\
**Lastly if you have any boot or startup issues, you can use the BCDboot tool to copy a simple set of system files to a system partition. These files include boot configuration data (BCD) information used to start Windows.
W:\Windows\System32\bcdboot W:\Windows /l en-US