virtualboy blog

Matt McSpirit on Virtualisation, Management and Core Infrastructure

The Search for YOUR Golden Image...

The Search for YOUR Golden Image...

  • Comments 6
  • Likes
My Golden Image

Do you rebuild your machine regularly?  Well, you shouldn't need to, becuase Vista looks after itself, however, when the need does arise, it's a bit of a pain.  Not the actual Vista install process, oh no, the pain in the backside arises once you've finished installing it.

For me, with my Sony Vaio, once Vista is installed, I then have to pull down all the latest updates from Windows Update, which will result in 1 reboot, maybe 2.  I then have to install the other device drivers that aren't on Windows Update yet (There are only 3 for my machine, so not too bad) and then the Vaio Utilities.  These Vaio utilities are obviously still in their infancy, as the first 4 you install need a reboot straight after each one.  Potentially I'm up to 5 or 6 reboots already.  Once my OS and hardware are working nicely, it's then the turn of installing all my applications that I regularly use.  Office 2007 being one, but also the others such as FoxIT PDF Reader, Windows Live Writer, Windows Live Messenger and so on.  Again, some of these may require a reboot, but regardless of this, the time taken to install all of these, one by one, can be quite long.

So, I go through the whole process.  My machine is up to date and running well, my applications are installed, along with my machine utilities.  All is good.  And relax.

What happens next time?  Next time I want to rebuild my machine?  Do I have to do the whole process all over again?  No, and there are a couple of ways to save yourself the time and effort for the future.  One of these would be to perform a Complete PC Backup of your machine, as is, right now, and simply restore from that at the future date.  Easy Peasy - but what about an image that you would like to distribute within your organisation, or your team at work.  This was the problem our team faced.  We all have Sony Vaio's, and I thought, why not save everyone time rebuilding their machines and create this golden image, that we, as a team can deploy quickly and be back up and running after a rebuild within an hour.  Make sense?  Here's how I did it.

Before I go on, it's important to talk about BDD, or Business Desktop Deployment.  The workbench is a piece of software you can download free, and use to create these golden images.  Once installed, along with the Windows Automated Installation Kit, it allows you to pull Vista WIM files from the original Vista DVD, add applications and installation commands, drivers, language packs, services packs, updates and so on, and then once your 'Distribution Share' is populated, create 'Builds' which you can subsequently deploy from DVD, USB, WDS Server etc.  The BDD really is your one stop shop in terms of deployment, and it's free, so you can get going in no time.  Get it here.

I however, chose to take the manual approach. :-)  The BDD harnesses the same technology that I will detail - you just don't need to script anything!

So, what do you need before we start?  Well, you need to get to your 'Golden State'.  Install all your applications, drivers, updates and so on, so that you are happy with that masterpiece that you've just slaved over.  Next, you'll need the Windows Automated Installation Kit, and the User Guide is always useful too.  What is it?  Well, it's "designed to help original equipment manufacturers (OEMs), system builders, and corporate IT professionals deploy Windows onto new hardware. The Windows AIK is a set of deployment tools supporting the latest release of Windows. This guide describes the methods, tools, and requirements for deploying Windows".  Read more here.

The reason we need the WAIK is because it contains WinPE 2.0, or Windows Pre Installation Environment and a couple of other tools.  This hasn't been free to download before, but with Vista, it is, and we need it.  In fact, every single deployment of Vista uses WinPE in some shape or form.  Yes, even the original DVD.  Anyway, we need to boot into WinPE 2.0 in order to capture our masterpiece Golden Image.  Before we do this however, we need to create our WinPE media.

Josh has got a great post on how to do this for a USB stick, here.  It's important to note the key tool you need to copy across in 'Step 4' is ImageX.  This is the tool that does the capturing magic.  More on this later.  James has also got a great post on customising WinPE and creating an ISO, if you'd prefer to go down the CD route, rather than USB.  If you just want the instructions on creating a WinPE 2.0 CD, here they are:

  1. Open an administrative command prompt
  2. cd Program Files\Windows AIK\Tools\PETools\
  3. copype.cmd x86 c:\temp\winpe_x86
  4. copy “c:\program files\Windows AIK\Tools\x86\imagex.exe” c:\temp\winpe_x86\iso\
  5. copy wimscript.ini (sample attached to this post) to c:\temp\winpe_x86\iso\
  6. oscdimg -n –bc:\winpe_x86\etfsboot.com c:\temp\winpe_x86\ISO c:\temp\winpe_x86.iso
  7. Burn this ISO to a CD (use your favorite CD burning software)

So, for this scenario, say you've created the bootable WinPE 2.0 USB Stick.  From within Windows, do a search from the start menu, for Sysprep.  The result should be displayed in the Start Menu.  Click on the folder and then, double click the 'sysprep' application.

imageEnsure that your dialog box looks like the one on the left before continuing.  I've chosen shutdown, because it gives you that little bit more time to get ready before booting into WinPE - last thing you want is a reboot but forget to put your WinPE disc in!

So, when you are happy, click OK and wait for your system to shut down.

When it's all shut down, give yourself a pat on the back and get a cup of tea (brew).  The next bit involves a tiny bit of scripting :-)

Make sure you have your WinPE media inserted, and that you know how to boot from that particular device.  Switch on and boot into WinPE.

When you are at the X:\Windows\System32 in WinPE (or something like that, it's off the top of my head!), you need to change the drive letter to your WinPE Media.  Once you are on the right drive, execute the following:

imagex.exe /flags “Ultimate” /compress fast /capture c: z:\MyGoldenImageName.wim "ULTIMATE Golden Image" /verify

  • ImageX is the image capture tool, which pops out the WIM file at the end of the process.
  • /flags is very important - do not forget this one, the process won't work without it.  My version of Vista is "Ultimate" but if you are building an image for a different version, you can find a list of the flags here.
  • fast compression is the default - if you leave this out, it will still compress in fast mode.
  • z: in this case is a drive on your system with enough space to hold the wim file.  It can be the same drive you are capturing.
  • "Ultimate Golden Image" is just the name of the image.
  • /verify enables file resource verification by checking for errors and file duplication.  The /verify option will affect the overall capture time. During a capture operation, the progress bar indicates the status of the capture operation only, not the verify operation. When the capture is complete, the verify process begins. This process takes time even though the progress bar shows 100 percent.
  • My WIM file was around 4.3gb (for a 13gb drive!) when the process finished.  I'd pick an drive with plenty of space, just to be sure the WIM file fits on, and the process doesn't result in an error.

Once it's all done, type exit and you'll need to boot back into Windows as normal, however, seeing as the machine has been sysprepped, you'll need to go through answering the questions about time zone, username etc.

So, you now have your Golden Image, in the shape of your WIM File.  How do you deploy it?  Well, one option is to use WDS, and deploy from a Windows Server, 2003 or 2008.  You could make a bootable USB key, but mine wouldn't fit on the ones I have - I chose DVD.

So, once you are back into Vista, you need to do the following:

  1. Copy the entire contents of your original Vista DVD to a directory (i.e. c:\Vista)
  2. Delete install.wim from the 'sources' folder in c:\Vista
  3. Rename z:\MyGoldenImageName.wim to install.wim and move it to c:\Vista\sources
  4. Open an administrative command prompt
  5. Type cd Program Files\Windows AIK\Tools\PETools\
  6. Type oscdimg -n –m –lMyGoldDiscName –h –b”\x86\boot\etfsboot.com c:\Vista c:\MyGoldDiscName.iso
    1. Alternatively, if you have another piece of software to create bootable ISO files, you can use this instead of Step 6.
  7. Your ISO shouldn't take too long to build, and once complete, burn to a DVD with your DVD writing software!

That's it!  Process complete!  You are now ready to deploy that image into your organisation.  Now, my image has the Sony Vaio utilities within it, but, because the image was sysprepped, I could still deploy it onto a Toshiba machine, I'd just have to uninstall the utilities when it booted up!  That is the beauty of the WIM format!

The installation from your custom DVD will take a little longer than the usual Vista install, but when all is complete, you are ready to go, with all your application sitting waiting for you.  The great thing about this is, you can do it, with free tools available for download.  Have a go and save yourself time in the future.  Like I said at the top, you could use BDD to create your builds and deployment media, i.e. your ISO file - it's executing the same kind of commands that I wrote above, but in a more user friendly fashion.  Using either method, you are definitely on to a winner.

Useful time saver?  I'd say so.  Enjoy.


Comments
  • Matt McSpirit IM'd me a couple of days ago to ask if I'd built a custom Windows Vista installation DVD.

  • This means that everyone who uses this image has apps & an OS with the same Product Key, right?  Will MS' licensing policy support this?

  • This is a great explanation.  But in looking at the BDD requirements there is a need for a Windows Server with Windows Deployment running.  Does your installation require that this server exists?  Thanks.

  • Tim,

    Good questions – thanks for these.  Firstly, let me start by saying that the method I’ve described isn’t aimed at you creating a Golden Image, and giving it out to your friends and family etc – in a non-business sense, it’s aimed at saving you time in the future – it’s a convenience thing.  I know, now, that in future, it will only take me an hour to rebuild my machine, completely, from scratch, whereas before, to get to the same point, it would have taken more like 2 to 3.  In a business sense, the Golden Image is used differently.

    With regards to the image having the apps – yes, you are correct – hence, why you couldn’t just give it out to family and friends.  However, when you Sysprep the physical machine before you capture the image, it removes all the machine specifics, such as the product key for the OS, machine specific information and so on, so that alone, minus the applications would not be a problem from a licensing standpoint.

    Think about this scenario.  Company X has 100 machines, they want to make them all identical.  They have a volume licence for Vista Enterprise, and for Office 2007 Enterprise, and they also have a custom accounting package which they have written, and a messenger package.  They also want a French language pack to be available, and all the latest security updates, so they don’t have to download them individually when they boot for the first time.  All users should have identical software, regardless of the hardware.  The quickest way to deploy now, and for the future?  Create their Golden Image on a single machine, Sysprep the box to capture the image (using the BDD would be the easiest way) and create an unattend file for the image, within which, you would include the Volume Licence key for Vista, Office, and the accounting package if appropriate.  This means, that when all those 100 machines are booted for the first time, they will correctly have the Volume Licence keys for the products, and all that is left to do is activate with the KMS Server.

    The main point to make around licensing is the placement of product keys within the unattend file.  If I gave my Golden Image that I created, to one of my friends, fine, they would need to get a product key for Vista (due to it being sysprepped, and my key being removed), but they would have a copy of Office 2007 Enterprise on there too – with Microsoft’s internal Volume Licence Key – this would essentially be piracy.

    Does this make sense?  Let me know if I’ve confused things!

    With regards to your second question - you don't necessarily need a server - when you are creating the deployment point in BDD, you can select 'Media' which allows you to create ISO's to burn to DVD, or create the structure for a USB stick.  Obviously, it would be great if you can combine this with a Windows Server and the WDS role - but it's not essential.

    Ping me a mail if you need any more info.

    Cheers,

    Matt

  • I don't know if this is still alive given the two year hiatus... Thanks so much for this info. I have a small issue and wonder if you can assist me. I put the Vista install disk on a USB drive and replaced install.wim with a golden image. It installed perfectly, but left some files on my root drive:

    $DRVLTRS

    WinPEpge.sys

    $bootdrive$

    $installdrive$

    $lsdrive$

    \$WINDOWS.~BT

    \$WINDOWS.~LS

    and a few more in \Windows

    It looks like I somehow broke a cleanup process. Any thoughts? Know that I am not that sophisticated of a user. Also, this is not that big of a deal, but it is just shy of being perfect!

  • It looks like WinPE (involved in the capture/deployment of the image) is putting those files where they are - in all honesty, I wouldn't worry too much - WinPEpge.sys for example, is the page file for WinPE, and it should have been deleted after the process has completed.  If there are no files/folders within the folders you've specified above, you should be able to delete them, but as they aren't actually doing anything as such, maybe leave them as they are.  They won't be taking up much room.

    Thanks!

    Matt

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment