Building reference images like a boss!

It’s a great week here at TechEd 2014 in Houston, later this afternoon I will present the never-dying “Creating the perfect reference image” with my partner in crime (and good friend), Mikael Nystrom. If you ever attended one of my deployment sessions before, you know I recommend using MDT Lite Touch for most scenarios, but what if you want to speed up the process?

All in all, by following these tips you can speed up the image capturing process by about 400 percent 🙂

 

Tablet pc with text Like a Boss with beach background 

 

Free Resources

If you haven’t created reference images with MDT before, check these Microsoft resources:

Microsoft TechNet guide: Create a Windows 8.1 Reference Image
http://technet.microsoft.com/en-us/library/dn744290.aspx

Microsoft TechNet Virtual Lab: Creating a Windows 8.1 reference image
http://go.microsoft.com/?linkid=9845755

TechEd 2014 video: Building the Perfect Windows 8.1 Image
http://channel9.msdn.com/Events/TechEd/NorthAmerica/2014/WIN-B346 

 

Make the image smaller by deleting setup files for already installed updates

Mikael Nystrom (deploymentbunny.com) has created a nice VBScript for some cleanup operations, including running the DISM.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase command – Effectively shaving of about 1 GB of the image size. Simply add the script as an application, and configure your task sequence to run it before sysprep. You can download the script from his post: http://deploymentbunny.com/2014/06/05/nice-to-know-get-rid-of-all-junk-before-sysprep-and-capture-when-creating-a-reference-image-in-mdt

image 
A Windows Server 2012 R2 reference image, fully patched, with and without cleanup.

Make sure ALL updates are installed into the reference image

Because of an issue with the ZTIWindowsUpdate.wsf script, not all updates will be installed during build and capture. There reason is that some updates actually have to be reinstalled, and the script logic prevents that. The workaround is simply to reset the updates list in between the two Windows Update actions. Alexey Semibratov and Keith Garner came up with a simple workaround back in the MDT 2010 days that still is valid for MDT 2012/2013.

ZTIWindowsUpdate.WSF does not install all patches
http://blogs.msdn.com/b/alex_semi/archive/2010/03/17/ztiwindowsupdate-wsf-does-not-install-all-patches.aspx

image
The script from Alex and Keith added to a Windows 7 task sequence.

Note: Mikael Nystrom also posted an updated version of the script that includes logging here: http://anothermike2.wordpress.com/2015/03/30/nice-to-know-reset-the-wsus-update-count-during-osd-allows-automatic-reinstallation-of-patches-that-failed/

Bump up the speed using a VM with multiple vCPUs

Capturing a 4 GB image with MDT typically takes 40 minutes on a virtual machine with 1 vCPU, but only 25 minutes when assigning 2 vCPU’s.

image

 

Bump up the memory to at least 4 GB

Windows 7 currently has quite many updates (almost 200) that needs to be deployed, so many in fact you may run out of memory. Settings the VM memory to 4GB solves that problem.

Update the Windows Update agent

Make sure that the latest Windows Update agent (currently July 2015) is installed by the task sequence before the Windows Update action. Here is the link: http://support.microsoft.com/en-us/kb/3065987 

Bump up the speed using DISM instead of ImageX

Of the above numbers, when using MDT with the default scripts to capture Windows 8.1 and Windows 10, about 15 minutes is used just scanning the file system (bug in ImageX which MDT is using). You can use DISM instead, which is much faster, see be below post by Mikael. This is not needed for build and capture of Windows 7, but since DISM works for Windows 7 and Windows 8.1/10, it makes sense to make the change anyway.

Nice to Know – Switch from ImageX to DISM in MDT
http://deploymentbunny.com/2014/05/19/nice-to-know-switch-from-imagex-to-dism-in-mdt/

Bump up the speed using a RAM disk

If you already have SSD’s in your Hyper-V or VMware Hosts, you won’t gain to much speed from this tip, but if you have SAN disks, or local 10k/15k disks, you can shorten the build and capture time quite a bit by deploying the VM to a RAM disk instead. Pretty good number of IOPS, and transfer rates 🙂

In my environment I use the free RAM disk from StarWind (http://www.starwindsoftware.com ). Simply create a 20 GB RAM disk, and then create your VM on it.

Note: Don’t let the StarWind app format the disk, do it yourself from disk manager or server manager after the RAM disk is created. I run into weird issues when StarWind was allowed to format the disk.

image
The 20 GB RAM Disk created.

image
The RAM disk in File Explorer.

About the author

Johan Arwidmark

0 0 votes
Article Rating
Subscribe
Notify of
guest
18 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Admin
Admin
6 years ago

Hi haris2887,

You should not use a UEFI-based VM for your reference image, use a normal (BIOS) one, since that can be used to deploy both BIOS-based and UEFI-based machines.

/ Johan

haris2887
haris2887
6 years ago

Hey Johan. RE: building reference images on VM's. I choose VMware Workstation 11 as my platform to build the images. Should I be running uefi bios on my VM ? The reason I am asking is I Built an image on a VM (Legacy Bios Default VMware option) and captured it. This image I am able to deploy to to CSM laptops, When I try to deploy it to UEFI laptops I get BSOD upon reboot with error 0xc0000001. Same thing happens when I try to deploy this image to a UEFI VM.

Admin
Admin
6 years ago

sundby: In general I start with default media. Especially for Windows 8.1 and Windows Server 2012 R2 since Microsoft now provides updated ISO's for download

/ Johan

Admin
Admin
6 years ago

pcarnella: Then something is not as it should…

Admin
Admin
6 years ago

ITguyCharlie: The AUTO is used for having the WIM file stored locally in a computer refresh.

/ Johan

Admin
Admin
6 years ago

mrdowntown: By adding the Install Roles and Features action from the "Add" menu.

/ Johan

sundby
sundby
6 years ago

When you update your reference image with new patches, do you generally do a full new build from scratch, or would you just do a "re-build" based on your latest image?

Admin
Admin
6 years ago

Don't know, I use MDT 2013 for reference builds, and always set a temporary password for my ref-builds. You set a new password when deploying the image anyway…

/ Johan

pcarnella
pcarnella
6 years ago

I have built reference images for Windows 8, 8.1 and server 2012 without issues using the same process, but when doing 2012 R2 I am getting prompted at first login to create admin password during the build/capture process. I have not been setting admin password in task sequence or unattend. To work around it I added a generic password to the 2012 R2 unattend, but I really didn't want to make any unique customization to the reference image, just features and patches. Its probably not a big deal since sysprep should wipe the passwords, but I just want to understand… Read more »

Admin
Admin
6 years ago

ITguyCharlie, nope, no point, the file needs to go to the server anyway…

/ Johan

ITguyCharlie
ITguyCharlie
6 years ago

Johan, you think its worth a test to set ComputerBackupLocation=auto and not to UNC path, then once capture is complete mount VHD and pull the WIM file off? Im kinda curious how much time is spent simply traversing the network stack even if on VM i believe still limited by physical NIC.. correct?… hmm..

Admin
Admin
6 years ago

In the Add menu, there is a Install Roles and Features action you can add.

/ Johan

mrdowntown
mrdowntown
6 years ago

Johan,

I've seen in your training videos how you installed runtime applications like Visual C++. But when you included dotnet framework 3.5, you showed that within your Task Sequence as you clicked on Install Roles and Features. How did it get there in order for you to make that selection?

Admin
Admin
6 years ago

Add .NET Framework to your reference image… Which you in general should build in MDT 2013 Lite Touch, even if you deploy it later with ConfigMgr.

But yes, you can also run dism to install it.

/ Johan

Lopan
Lopan
6 years ago

Actually that didn't work with SCCM deployments.
I guess it only works for MDT because the %deployroot% is specific to MDT.

Here's the Configuration Manager solution I've come up with.

This works when using "Apply Operating System from original install source"
Use a "Run command line" Task sequence step with the below command just as is… don't replace anything

DISM.exe /online /enable-feature /featurename:NetFX3 /All /Source:%_SMSTSMDataPath%Packages%_OSDInstallPackageID%sourcessxs /LimitAccess

If anyone has a better solution please let me know.

Lopan
Lopan
6 years ago

Thank you,

Yes that helps.
I had previously resorted to injecting .NET via DISM in our install source's Install.wim.
Though the purists among my group, of which I am at some times didn't like the idea of yet another workaround.
But, I think your suggestion should satisfy us all.

Thank you again.

InfiniteQ
InfiniteQ
6 years ago

@Lopan,

It seems there's some info on your issue here:
blogs.technet.com/b/deploymentguys/archive/2012/11/13/windows-8-automating-the-installation-of-net-framework-3-5-with-mdt.aspx

Here they recommend to just install it on the base image, but down in the comments, people have provided ways to handle this task. Best one seems to be creating a run command line task, then putting this in it: DISM.exe /online /enable-feature /featurename:NetFX3 /All /Source:%deployroot%Operating SystemsYourWindows8 FolderNameInMDTSourcesSXS /LimitAccess

Hope that helps!

Lopan
Lopan
6 years ago

Referencing your link above "Creating a Windows 8.1 reference image" and other demo videos of yours. Great presentation at TechEd 2014 by the way. I cannot get .Net Framework 3.5 installed via SCCM 2012 R2 with MDT 2013 integration to work. I created a "MDT Task Sequence",using the full Windows 8.1 Update 1 "Operating System Installer" files imported from the Evaluation ISOusing the "Install Roles and Features" TS Step immediately after the default "Tatoo" TS step, selecting "Windows 8.1" from the "Select the operating system for which roles are to be installed" drop down list, and only selecting ".NET Framework… Read more »


>