At ProAce we recently purchased some new development machines and needed to quickly get Windows installed with all of our development tools. For anyone that has ever set up a development machine, you know the process can be a full day’s work installing various editions of Visual Studio and SQL Server. Multiply that by the number of machines and we could have easily spent a week setting up the four machines that we purchased.
This is where imaging comes in handy. Imaging allows you to set up one computer and basically create a template for the rest of the machines. People familiar with corporate environments might often hear IT staff referring to re-imaging a machine, an easy way to revert a system back to a fresh status without having to reinstall all of it’s base software like Office. In our experience it was a simple way to cut deployment time to a single day of work, and because the tools are free from Microsoft, the process could not have been more satisfying.
Step 1: Build the Template Machine
The first step in the imaging process is to create the template machine. This is the machine that the image will be based on. There are a few different strategies for creating your base image. On one end we have a “thin” image, which consists of just Windows, and on the other end of the spectrum is a “thick” image, one that includes any and all software that one could possibly use. Most of the time you are going to be somewhere in the middle, and in our case we leaned toward the thin side for speed of deployment. Our goal was to install the most time-consuming (to install) applications so that the process would not have to be repeated needlessly. Our image included:
- SQL Server 2008
- Visual Studio 2005
- Visual Studio 2008
- Microsoft Office 2007
- Firefox 3.6
We felt that these applications, and specifically their updates were the most cumbersome to install. Visual Studio 2008 is an especially nasty install because for whatever reason installing Service Pack 1 takes forever.
Step 2: Create (”Capture”) the Image
After you have set up your template machine, the next step is to capture the image. This is done with a number of tools found in the Windows Automated Installation Kit. The first step is to create a bootable Windows Preinstallation Environment (Windows PE) disk. You can find instructions to do that on Microsoft Technet. Make sure to include the ImageX application in your image. The Windows PE environment is a “mini” operating system that allows us to use the rest of the tools without disturbing the image while it is being processed.
After you have created a Windows PE disk we are going to prepare your base machine to be templated. This is done using a tool called SysPrep. This application removes any user information associated with the windows installation. Navigate to C:\Windows\System32\sysprep and run sysprep.exe. You are going to want to make sure to select “Enter System Out-of-Box-Experience” and check the box to “Generalize.” The screen should look like this:

Click Okay and the machine will be prepared for image. Insert your Windows PE disk and restart the computer. Choose to boot from the CD (you may have to modify your BIOS settings) and let the environment load. Make sure you are familiar with the Windows Command Prompt before starting.
Capturing the image is the easy part. Find the letter that was mapped for your Windows hard drive (ours was D:) and run imagex to capture the image. The command we used is below, but there are some more flags that others may find useful.
ImageX.exe /capture d: d:\Images\win7dev.wim "Windows 7 Development" /verify
Notice that it doesn’t matter if you store the image outputted to the same drive you are imaging. ImageX will keep you updated on its progress and if all goes well the image will be created.
Step 3: Apply the Image to Target Machines
The final step is to apply your image to the rest of your computers. This requires that the other computers have access to the image we created in step 2. For our purposes we shared the C:\Images folder on the template machine over our network.
Boot into Windows PE on the target machine. Then make sure that the image is accessible from the Windows PE environment. To mount a shared location, utilize the “net use” command. Also make sure that your target hard drive is free of any other files. A quick reformat never hurts. You can use the diskpart tool to partition and format your drive.
Now for the fun part. Using ImageX again, we will now apply the image to the drive.
imagex /apply n:\Images\win7dev.wim 1 d: /verify
Like capture, there are some more advanced features you can use to customize how the apply happens. After the image gets applied you can reboot your machine and start using your new machine. We did need to run the Windows Boot Repair on the new machine since our image did not apply the master boot record information correctly, but after that ran we were able to boot just fine. The first boot will take you through a setup process as if it were just taken “out of the box.”
More information can be found at the following links:

Post a Comment