08.02.2016 Views

how-to-create-a-wim-

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

How <strong>to</strong> Create a WIM System Image File with WindowsAIK and WindowsPE | Window...<br />

http://www.danscourses.com/Windows-7-and-8/<strong>how</strong>-<strong>to</strong>-<strong>create</strong>-a-<strong>wim</strong>-system-image-file-...<br />

Page 1 sur 9<br />

2015-02-25<br />

How <strong>to</strong> Create a WIM System Image File with WindowsAIK<br />

and WindowsPE<br />

► Windows 7 ► Windows com ► Windows USB<br />

► Wim<br />

Share<br />

Like<br />

6<br />

WIM System Image File Overview<br />

A system image is a single file that contains the entire operating system and all of the files, programs, and settings of an<br />

installed computer system. Network administra<strong>to</strong>rs use system images <strong>to</strong> deploy the Windows 7 operating system <strong>to</strong> many<br />

computers in a Windows network. Besides just deploying operating systems across a large network, a system image is also be<br />

a useful backup <strong>to</strong>ol for re-imaging corrupted systems.<br />

A Windows 7 system image file is called a WIM file, it has<br />

a .<strong>wim</strong> file extension. A WIM file can be <strong>create</strong>d in such a<br />

way (generalized) that it can be deployed <strong>to</strong> any computer<br />

independent of the particular hardware or drivers.<br />

In this tu<strong>to</strong>rial, I attempt <strong>to</strong> simplify the process of creating a<br />

Windows system image or WIM file, in<strong>to</strong> easy <strong>to</strong> understand,<br />

step-by-step instructions. I hope you find the tu<strong>to</strong>rial helpful<br />

and the process interesting! I have also added video<br />

tu<strong>to</strong>rials s<strong>how</strong>ing <strong>how</strong> <strong>to</strong> do the entire process using a<br />

VMware Windows 7 virtual machine as the reference<br />

computer.<br />

The <strong>to</strong>ols you will need:<br />

The Reference Computer - A computer with Windows 7<br />

installed. This is the source computer that the image file will<br />

be <strong>create</strong>d from. In my example, I used a fresh install of<br />

Windows 7 on an extra computer, then I ran updates,<br />

installed a couple programs, changed the desk<strong>to</strong>p and the homepage, and <strong>to</strong>ok a screenshot (see below). Important!<br />

The first time you do this, I do not recommend using the Windows 7 home computer that you use on a daily basis, as the<br />

reference computer. This process will involve a generalizing of the system (sysprep) which will strip it of drivers, as well<br />

as the System ID. Though everything will be put back <strong>to</strong> normal, I do not recommend using a machine that you rely on<br />

the first time you do this exercise. I am also in the process of s<strong>how</strong>ing <strong>how</strong> this entire lab can be done using virtual<br />

machines.


How <strong>to</strong> Create a WIM System Image File with WindowsAIK and WindowsPE | Window...<br />

http://www.danscourses.com/Windows-7-and-8/<strong>how</strong>-<strong>to</strong>-<strong>create</strong>-a-<strong>wim</strong>-system-image-file-...<br />

Page 2 sur 9<br />

2015-02-25<br />

This is a screenshot of the system I am going <strong>to</strong> image.<br />

The Technician Computer - In my case running Windows 7. This is the computer with Windows AIK installed.<br />

A USB flash drive or CD - To hold your bootable WinPE image.<br />

A USB external drive or flash drive - To s<strong>to</strong>re your WIM system image files (Note: a WIM file can be as large as the hard<br />

drive your imaging)<br />

Windows Au<strong>to</strong>mated Installation Kit (Windows AIK) -<br />

Used <strong>to</strong> <strong>create</strong> and maintain Windows system images<br />

or WIM files. Windows AIK is a free download from<br />

Microsoft that you will need <strong>to</strong> burn <strong>to</strong> DVD and then<br />

install. Windows AIK includes the following <strong>to</strong>ols:<br />

-40%<br />

-28%<br />

Windows PE - The Windows preinstallation<br />

environment is a thin version of Windows 7<br />

based on the Windows 7 kernel. Windows PE<br />

CAD $ 43.88<br />

is like a Windows 7 Boot Disk. It can be used<br />

CAD $ 26.32 6.2" Mo<strong>to</strong>rized Touch<br />

<strong>to</strong> fix Windows 7 installations.<br />

Screen 2-Din Car DVD Pl...<br />

Achetez<br />

Windows SIM - Windows System Image<br />

Manager <strong>create</strong>s 'answer files' that are used <strong>to</strong> au<strong>to</strong>mate the Windows installation (This is optional, I do<br />

not use this <strong>to</strong>ol in this tu<strong>to</strong>rial).<br />

SysPrep Tool - The System Preparation Tool is used <strong>to</strong> generalize the system image for installation by<br />

removing specific computer system information. (The SysPrep <strong>to</strong>ol is included in Windows 7)<br />

ImageX - Command line <strong>to</strong>ol that <strong>create</strong>s the image file. In this tu<strong>to</strong>rial, we will copy the ImageX.exe file<br />

<strong>to</strong> the root of the USB WindowsPE boot drive, for easy access.


How <strong>to</strong> Create a WIM System Image File with WindowsAIK and WindowsPE | Window...<br />

http://www.danscourses.com/Windows-7-and-8/<strong>how</strong>-<strong>to</strong>-<strong>create</strong>-a-<strong>wim</strong>-system-image-file-...<br />

Page 3 sur 9<br />

2015-02-25<br />

Initial Steps<br />

In this tu<strong>to</strong>rial you want <strong>to</strong> pay close attention <strong>to</strong> the syntax of the commands (eg. the spaces between words or<br />

characters)<br />

(WS.10).aspx<br />

1. Set up the 'Reference Computer' with Windows 7. This<br />

is the computer I will use <strong>to</strong> <strong>create</strong> my "golden image. (see<br />

above recommendations)<br />

2. Download the Windows Au<strong>to</strong>mated Installation Kit for<br />

Windows 7 iso file. You can download it here:<br />

http://www.microsoft.com/downloads/en/details.aspx?<br />

FamilyID=696dd665-9f76-4177-a811-<br />

39c26d3b3b34&displaylang=en. Once you have it<br />

downloaded you will need <strong>to</strong> burn it <strong>to</strong> a DVD. Now install<br />

WindowAIK from the DVD (If it does not start by itself run<br />

the StartCD.exe file located on the DVD)<br />

3. For good online instructions I recommend going <strong>to</strong><br />

TechNet.Microsoft.com. This is my starting point for this<br />

tu<strong>to</strong>rial: http://technet.microsoft.com/en-us/library/dd349343<br />

Create a Windows PE Boot Disk (USB Flash Drive or CD)<br />

1. Next, you need <strong>to</strong> make a Windows pre-installation environment, Windows PE boot disk. You can do this on a CD-<br />

ROM or a USB flash drive, I s<strong>how</strong> both ways in the steps below . You can also find more information on <strong>how</strong> <strong>to</strong> <strong>create</strong><br />

WindowsPE boot disks at the Microsoft TechNet website: http://technet.microsoft.com/en-us/library/dd744530<br />

(WS.10).aspx. I have also included a video tu<strong>to</strong>rial on <strong>how</strong> <strong>to</strong> <strong>create</strong> a WindowsPE boot CD below.<br />

2. On your technician computer (computer with AIK installed), click:<br />

Start > All Programs > Microsoft Windows AIK, right-click Deployment Tools Command Prompt, and then select Run as<br />

administra<strong>to</strong>r.<br />

3. At the command prompt, run the Copype.cmd script. The script requires two additional parameters: hardware<br />

architecture and destination location.<br />

copype.cmd <br />

can be x86, amd64, or ia64 and is a path <strong>to</strong> local direc<strong>to</strong>ry. For example, I typed in the following<br />

command:<br />

copype.cmd x86 c:\winpe_x86<br />

command)<br />

(the direc<strong>to</strong>ry winpe_x86 will be <strong>create</strong>d by the<br />

4. Next, run the following command <strong>to</strong> copy and rename the winpe.<strong>wim</strong> file:<br />

copy c:\winpe_x86\winpe.<strong>wim</strong> c:\winpe_x86<br />

\ISO\sources\boot.<strong>wim</strong><br />

5. Add ImageX.exe <strong>to</strong> your WinPE image (optional but recommended). Type the following command:<br />

copy c:\\<strong>to</strong>ols\x86\imagex.exe<br />

c:\winpe_x86\iso\<br />

On my computer, I installed AIK directly <strong>to</strong> the c: drive in a folder named "WindowsAIK" instead of the "Program Files"


How <strong>to</strong> Create a WIM System Image File with WindowsAIK and WindowsPE | Window...<br />

http://www.danscourses.com/Windows-7-and-8/<strong>how</strong>-<strong>to</strong>-<strong>create</strong>-a-<strong>wim</strong>-system-image-file-...<br />

Page 4 sur 9<br />

2015-02-25<br />

folder so my command looked like this:<br />

copy c:\WindowsAIK\<strong>to</strong>ols\x86\imagex.exe c:\winpe_x86<br />

\iso\<br />

6. Now you need <strong>to</strong> decide if you want <strong>to</strong> prepare a USB flash drive or a CD for accepting WindowsPE. If you want <strong>to</strong><br />

prepare for burning a CD, you can skip <strong>to</strong> step 9, otherwise continue on. Now you need <strong>to</strong> prepare your USB Flash<br />

Drive. Insert your flash drive. Open a command prompt and type in the following command:<br />

diskpart (opens the diskpartition command line utility)<br />

When you see the prompt "DISKPART>" type in the following command <strong>to</strong> verify which disk is your USB Flash Drive:<br />

list disk (you should see a listing of disks based on size)<br />

Type in the following commands (Important: this assumes your USB drive was listed as "Disk 1" you don't want <strong>to</strong><br />

format the wrong disk)<br />

select disk 1<br />

clean<br />

<strong>create</strong> partition primary<br />

select partition 1<br />

active<br />

format quick fs=fat32<br />

assign<br />

exit<br />

Now your USB flash drive should be formatted with fat32.<br />

7. Copy the iso direc<strong>to</strong>ry in your c:\winpe_x86 folder <strong>to</strong> your Flash drive. Type in the following commands:<br />

xcopy C:\winpe_x86\iso\*.* /e F:\<br />

the above command assumes your f: drive is your USB drive, else adjust accordingly<br />

8. Congratulations! You just <strong>create</strong>d your Windows PE Boot Flash Drive. Now you need <strong>to</strong> capture a generalized<br />

image for deployment.<br />

9. If you would like <strong>to</strong> burn WindowsPE <strong>to</strong> a CD instead of a USB thumb drive. The following command will copy all of<br />

the files necessary <strong>to</strong> <strong>create</strong> a WindowsPE boot disc in<strong>to</strong> an ISO image file. Then you can burn the image file <strong>to</strong> a CD <strong>to</strong><br />

<strong>create</strong> a bootable WindowsPE CD. In the command below the ISO image file that you will want <strong>to</strong> burn is winpex86.iso<br />

Oscdimg -n -bC:\winpe_x86\Etfsboot.com C:\winpe_x86\ISO<br />

C:\winpe_x86\winpex86.iso<br />

10. Now burn the ISO image file winpex86.iso <strong>to</strong> a CD as a bootable image disc and you are finished! You can find<br />

more information on <strong>how</strong> <strong>to</strong> do it from the Microsoft Technet site here: http://technet.microsoft.com/enus/library/dd799303%28v=ws.10%29.aspx<br />

.<br />

11. Congratulations! You just <strong>create</strong>d your Windows PE Boot CD. Now you need <strong>to</strong> capture a generalized image for<br />

deployment.<br />

Video Tu<strong>to</strong>rial<br />

How <strong>to</strong> Create a WindowsPE boot cd using Windows AIK


How <strong>to</strong> Create a WIM System Image File with WindowsAIK and WindowsPE | Window...<br />

http://www.danscourses.com/Windows-7-and-8/<strong>how</strong>-<strong>to</strong>-<strong>create</strong>-a-<strong>wim</strong>-system-image-file-...<br />

Page 5 sur 9<br />

2015-02-25<br />

Generalize your Windows 7 Reference Computer with SysPrep<br />

1. Generalize your image with the SysPrep utility.<br />

2. On the reference computer. Click Start > All Programs > Accessories > Right Click the Command Prompt. Opens<br />

the command prompt in administrative mode. Type in the following command <strong>to</strong> run sysprep:<br />

c:\windows\system32\sysprep\sysprep.exe<br />

3. In the sysprep dialogue box choose the OOBE, generalize, and shutdown options and click "ok".<br />

4. Sysprep will prepare your system for imaging by stripping it of hardware specific settings and will then shutdown.<br />

Video Tu<strong>to</strong>rial<br />

► Windows USB ► Wim ► Image Drive ► Image Burn<br />

Generalize the reference system using the SysPrep utility


How <strong>to</strong> Create a WIM System Image File with WindowsAIK and WindowsPE | Window...<br />

http://www.danscourses.com/Windows-7-and-8/<strong>how</strong>-<strong>to</strong>-<strong>create</strong>-a-<strong>wim</strong>-system-image-file-...<br />

Page 6 sur 9<br />

2015-02-25<br />

► Image Drive ► Image Burn ► Boot CD ISO<br />

► Boot Disk<br />

Capture an Image for Deployment (Generalized Golden Image) with ImageX<br />

1. Now that you have generalized your Windows 7 Reference System you need <strong>to</strong> boot the reference computer <strong>to</strong><br />

your WindowsPE Boot Disk (USB or CD). If you are doing the lab on a VMware virtual machine you can configure the<br />

virtual CD/DVD drive <strong>to</strong> boot directly <strong>to</strong> the WindowsPE .iso file. You will still need <strong>to</strong> tell the virtual machine <strong>to</strong> boot the<br />

CD/DVD drive by quickly clicking inside the VM as it boots and hitting the escape key on the keyboard in order <strong>to</strong> get <strong>to</strong><br />

the boot menu. Working from a physical computer, you need <strong>to</strong> press the F12 key while starting the computer in order <strong>to</strong><br />

bring up a one-time boot menu, and set the computer <strong>to</strong> boot <strong>to</strong> the CD/DVD or USB flash drive instead of the hard<br />

drive.<br />

Note: If you boot <strong>to</strong> the hard drive instead of your WindowsPE USB then your computer will begin the Windows setup<br />

procedure and load pnp drivers, and you will need <strong>to</strong> do sysprep all over again <strong>to</strong> generalize your system.<br />

2. In the WinPE command prompt run diskpartition by typing in the command: diskpart (and hitting enter)<br />

3. Type in the following command: list disk (<strong>to</strong> see your recognized disks)<br />

I s<strong>how</strong>ed 3 hard disk drives listed:<br />

disk0 = my hard drive<br />

disk1 = my USB flash drive<br />

disk2 = my larger external USB drive where I plan on saving my image file<br />

4. Type in the command: exit <strong>to</strong> exit disk partition<br />

5. Now I recommend figuring out which disks are under which drive letters. You can do this by executing the following<br />

commands:<br />

c:\ (switching <strong>to</strong> the c drive I found "Volume in drive C is System reserved")<br />

d:\ (switching <strong>to</strong> the d drive I found the files and folders of a WindowsOS, i.e Program Files, Users, Windows,<br />

au<strong>to</strong>exec.bat, etc.)<br />

e:\ (depending on whether you are using a WindowsPE CD or a USB boot drive, switching <strong>to</strong> the e:\ drive you may


How <strong>to</strong> Create a WIM System Image File with WindowsAIK and WindowsPE | Window...<br />

http://www.danscourses.com/Windows-7-and-8/<strong>how</strong>-<strong>to</strong>-<strong>create</strong>-a-<strong>wim</strong>-system-image-file-...<br />

Page 7 sur 9<br />

2015-02-25<br />

find the contents of the WindowsPE drive or a "The device is not ready" message)<br />

f:\ (under the f drive I found the WindowsPE drive and the imagex.exe file)<br />

g:\ (under the g drive I found my USB external hard drive where I am going <strong>to</strong> s<strong>to</strong>re my image file)<br />

6. Once you know where imagex.exe is located (USB WinPE drive) you can run it on your generalized Win7 drive and<br />

save the image an external s<strong>to</strong>rage device. My final command <strong>to</strong> <strong>create</strong> the image and save it <strong>to</strong> an external hard drive<br />

was:<br />

f:\imagex /capture d:\ g:\my-windows-image.<strong>wim</strong><br />

"myImage" (make sure you put the quotation marks)<br />

Explanation of command above: after using the cd and dir commands <strong>to</strong> search around the disks and directiories I<br />

found the imagex.exe file in the F:\ drive. The separate pieces of the command are as follows:<br />

f:\imagex (is where imagex.exe was located)<br />

/capture (the argument that tells imagex <strong>to</strong> capture the image)<br />

d:\ (location of the drive with the generalized Windows 7 OS)<br />

g:\my-windows-image.<strong>wim</strong> "myImage" (location of drive <strong>to</strong> save the image file (in this<br />

case an external USB drive), the file name <strong>to</strong> give it, and a label name)<br />

7. Now check <strong>to</strong> see if the image successfully copied <strong>to</strong> your external USB drive. You should see a .<strong>wim</strong> file. If you did,<br />

congratulations, you now have an image file of your entire Window 7 operating system, which includes installed<br />

programs, documents, and configurations! You can now install that image on a different computer, the same computer,<br />

or you could open that image file with the Windows AIK program and mount the image like an external hard drive. A<br />

mounted <strong>wim</strong> file can be browsed, edited or added <strong>to</strong>.<br />

Video Tu<strong>to</strong>rial<br />

Capture the WIM from WindowsPE, using ImageX


How <strong>to</strong> Create a WIM System Image File with WindowsAIK and WindowsPE | Window...<br />

http://www.danscourses.com/Windows-7-and-8/<strong>how</strong>-<strong>to</strong>-<strong>create</strong>-a-<strong>wim</strong>-system-image-file-...<br />

Page 8 sur 9<br />

2015-02-25<br />

Devenez<br />

éducatrice de CPE<br />

Formation d'éducatrice à<br />

l'enfance Cours de jour et de<br />

soir offerts.<br />

Installing/Deploying your WIM Image <strong>to</strong> a Computer or Network with ImageX<br />

1. Now that you have your image file you can install it <strong>to</strong> another computer using ImageX!<br />

2. Boot a computer <strong>to</strong> your USB WindowsPE boot drive.<br />

3. Attach the USB external drive with your <strong>wim</strong> file.<br />

4. Format the drive using Diskpartition. After typing diskpart you will need <strong>to</strong> search the drives <strong>to</strong> verify which letters<br />

correspond with which drives. Here are the commands:<br />

diskpart (starts Disk Partition)<br />

list disk (lists the mounted disks, note which one is which by comparing sizes)<br />

select disk 0 (select the disk that corresponds with your hard drive where you want <strong>to</strong> install your<br />

image)<br />

clean<br />

<strong>create</strong> partition primary<br />

select partition 1<br />

active<br />

format quick fs=ntfs label=OS (Important: NTFS not fat32, label is optional)<br />

assign letter=C (Important: you want it <strong>to</strong> be the C drive)<br />

exit<br />

Now run the command <strong>to</strong> apply the image <strong>to</strong> the hard drive:<br />

f:\imagex.exe /apply e:\my-windows-image.<strong>wim</strong> 1 c:\<br />

Explanation:<br />

/apply (apply instead of capture)<br />

e:\my-windows-image.<strong>wim</strong> 1 (Important: the 1 is the index of the first <strong>wim</strong>. Each <strong>wim</strong> can<br />

have multiple versions)<br />

c:\ (where you will install the <strong>wim</strong>)<br />

Once the image is done you can try restarting and seeing if the system boots normally. If it doesn't you will need <strong>to</strong> set<br />

up the boot configuration location. In WindowsPE type the following commands:<br />

c: (<strong>to</strong> switch <strong>to</strong> the c drive)<br />

cd windows\system32<br />

dir bcd* (list all the files beginning with bcd)


How <strong>to</strong> Create a WIM System Image File with WindowsAIK and WindowsPE | Window...<br />

http://www.danscourses.com/Windows-7-and-8/<strong>how</strong>-<strong>to</strong>-<strong>create</strong>-a-<strong>wim</strong>-system-image-file-...<br />

Page 9 sur 9<br />

2015-02-25<br />

bcdedit.exe (looks for boot files)<br />

bcdboot c:\windows /s c: (sets the system boot boot direc<strong>to</strong>ry)<br />

5. Restart your computer and go <strong>to</strong> Windows setup mode. You will need <strong>to</strong> add a new user in setup mode which you<br />

can delete later. Log off and log back in<strong>to</strong> your original user account and you should see all your programs, documents<br />

and settings! Image is res<strong>to</strong>red!<br />

If you have any clarifications or something you could add <strong>to</strong> this tu<strong>to</strong>rial please post it <strong>to</strong> a comment below. Thank you! -Dan<br />

Last Updated on Thursday, 26 September 2013 17:59<br />

< Prev Next >

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!