MDT 2010 and deployment from a USB key
Note that the content in this guide has been updated to include deployment over a network, and some other tips/tricks. After reading this, you might want to take a look at the updated guides here:
http://www.cluberti.com/blog/2011/06/23/mdt-for-the-smaller-guys-part-1/
http://www.cluberti.com/blog/2011/06/23/mdt-for-the-smaller-guys-part-2/
http://www.cluberti.com/blog/2011/06/28/mdt-for-the-smaller-guys-part-3/
Have you ever wanted to put every version of Vista, Server 2008, Windows 7, Server 2008 R2, and perhaps a version of XP or two on a single USB key? No? Then you’re probably normal. If you’re like me, however, the thought has crossed your mind. However, the daunting task of configuring said USB key to boot to some multiboot Linux distro or hacking a bit at bcdedit to boot a WinPE to handle it also made it something to avoid, at least for me, because, well, I tend to be lazy about these things.
However, after playing with the Microsoft Deployment Toolkit for a bit, I realized I could probably make my USB key bend to my will and be said multi-bootable Windows OS installer, without a whole lot of work. I set about to put all of those versions of Windows one one key, along with some unattended applications (for this blog post, I’m just adding Office 2007 to keep it short).
You’re going to need a few things to start, most notably you’ll need a Windows machine that can install the latest Windows Automated Installation Kit (WAIK) for Windows 7 (that’d be Server 2003 SP1 or newer, Vista SP1 / Server 2008 or newer, or Win7 / Server 2008 R2 – sorry, no XP support, it seems). You’ll also need the MDT 2010 bits and the version(s) of Windows and any applications you would like to install from MDT.
Adding Operating Systems
Once you’ve got a machine with the WAIK and MDT 2010 installed, the first thing to do is open the Deployment Workbench from the Microsoft Deployment Toolkit folder in your start menu. Since you’ve already got the prerequisites needed to do a basic MDT deployment (namely, the WAIK), just right-click on the “Deployment Shares” folder and select “New Deployment Share” from the drop-down:
This will open a wizard that will help you create the Deployment folder and share – note that you will have to create this folder, as the current version (beta2) does not do this. The wizard will look like the following:
Again, use the “Browse” button to create the folder as necessary, and make sure this is on a drive with ample space, as all of your OS files and applications will be stored here.
Once you’ve gotten yourself a deployment share, it will show up as a subfolder of the “Deployment Shares” tree, and the first thing you’ll want to do is add the version(s) of Windows you want to use MDT to install. To do this, right-click on the “Operating Systems” subfolder in your deployment share, and select “Import Operating System”:
This will bring up the “Import Operating System” wizard. For this example, I’m going to be using the full Windows installations as my source, and since I’ve copied the contents of the Windows DVDs / CDs to the hard disk on this machine already, I select “Full set of source files” and point the wizard to the folder that contains the Windows source that I’m using (in this example, I’ve extracted the Windows 7 RTM to a folder on the D: drive):
The wizard will go through copying the files from the source directory into the distribution share, and add each OS choice to the Operating Systems list in the Deployment Workbench – after adding Vista, Server 2008, Win7, and Server 2008 R2 via this method, my Operating Systems list looks like this:
Adding Applications (optional)
If you want to have your installation media install applications along with Windows, you’ll need to add them to the deployment share and the task sequence – in this example, I’m adding Office 2007. To add an application, you’ll need to right-click the “Applications” subfolder in your deployment share, and select “New Application” from the drop-down:
Once the wizard comes up, you’ll have to enter the Application Name – the Publisher, Version, and Language are optional (but recommended):
Again, I’ve copied the contents of the Office 2007 DVD to the hard disk, so I’m going to point the wizard to this source, but if you have the files you need for the application you’re adding to the deployment share in another location (say, on a DVD or a network share), point the wizard to that source directory, and click “Next”:
This will place the Office 2007 entry into the “Applications” list in the deployment share, and you will need to edit the properties of the application before the application will install properly. To do so, right-click the application from the Applications list and select “Properties”:
From here, you will need to click the “Details” tab and configure the installation command (the Working directory will already be configured) to run the application’s setup, including any switches required by the application. You can also enable or disable the application from the deployment share, cause the application to reboot the computer it’s being installed onto once it has completed installation, as well as a host of other options that may be of interest to you. You may also note that MDT recognizes that this is an Office application, and adds an “Office Products” tab where you can configure the unattended parameters of Office (if your version supports it – for example, Office 2007 Enterprise):
Once you’re comfortable with the application settings, click “OK” to complete adding the application.
Adding Drivers (optional)
If you want to inject drivers into your installation, you will need to use the “Out-of-Box Drivers” subfolder in your distribution share. Note that there is a requirement here – you will need to have the driver package extracted that you want to use, and it must not be a driver package that requires an .exe to install. For this portion of the deployment, you will have to direct the MDT wizard to the folder that contains the .inf, .sys, and any .cat files the driver requires, hence why .exe driver installers will not work. You may be able to add these types of drivers as application packages, however, but that’s a bit outside my scope here.
For this example, I’m adding the drivers for a 3ware 9550SX controller that I’ve already extracted:
To add the driver to the deployment share, simply right-click on the “Out-of-Box Drivers” folder and select “Import Drivers” from the drop-down:
Point the wizard to the folder that contains the drivers you want to import, and click “Next” (in my example, I’m going to import both x64 and x86 drivers, so I’m running the wizard twice) – note that if you do import the x86 and x64 versions of the same driver, make certain that the “Import drivers even if they are duplicates of an existing driver” box is checked before clicking “Next”:
If you have imported both x64 and x86 versions of the same driver, make sure to right-click on each driver in the listing of Out-of-Box drivers and select the proper architecture – the wizard will add a number at the end of the driver’s name for each iteration of the same driver you import (in this case, (1) was added to the x86 driver I imported), and the wizard will tell you at the end what display name it gave to the driver added. In this case, I’ll make sure that the “AMCC System 3wManage.inf” is configured to be used only for x64 platforms:
Make certain to do this for each x64 and x86 driver you add, if you do add multiple architecture versions of the same driver.
Creating the Task Sequence
To get MDT to actually *do* something with the operating system(s) you’ve imported, you’ll have to create what is called a “Task Sequence”. In MDT parlance, this is the “logic” that drives MDT – it’ll tell MDT what drives to format, what version of Windows to install, and any applications, hot fixes/updates, and drivers you configure in MDT. To create your first task sequence, right-click on the “Task Sequences” subfolder in your deployment share, and select “New Task Sequence” from the dropdown:
Once the wizard comes up, you’ll need to give the Task Sequence a unique ID number in the “Task sequence ID” box, as well as a name (this is the name that will show up in the list of operating systems to deploy, so consider using the name of the version of Windows the task sequence will install). Enter any comments in the comment box, and click “Next”:
Choose the “Standard Client Task Sequence” from the drop-down list (or “Standard Server Task Sequence”, if this is a server OS), and click “Next”:
Select the version of Windows you want the Task Sequence to install from the list, and click “Next”:
At this point in the wizard, you can enter a product key (or not), set the registered Name and Organization, set the IE homepage, and configure the Administrator Password (or not). Once you’ve done all this and finished the wizard, the task sequence will now show up in the Task Sequence list, but it’s not complete just yet if you want to edit the unattended file and change some of the advanced options (like the default time zone, in my example). If you want to leave everything as-is, skip to the next section. However, if you do want to edit the file, you’ll need to right-click the Task Sequence and select “Properties” from the drop-down:
Once the properties of the Task Sequence opens up, click on the “OS Info” tab, and click the “Edit Unattend.xml” button to open the unattended file in the Windows System Image Manager (WSIM) for editing:
Again, for this example, I want to edit the Time Zone. To do this, once WSIM has the unattend.xml file open, expand the 4 specialize component and select “Microsoft-Windows-Shell-Setup_neutral” from the list (note that this says amd64 at the beginning because this is an x64 image – if you’re editing an x86 image, it will say x86 at the beginning). From here, you can edit the default (Pacific Standard Time) with the full name of the Time Zone you want (I’ve entered “Eastern Standard Time”):
Once you’re done editing the unattend file, close the WSIM window and save the file when prompted.
Putting it all together
The last steps involve updating the deployment share with the changes made, and building the media we’re going to use to copy to the USB key. First, you will need to update the deployment share, by right-clicking on the deployment share root folder, and selecting “Update Deployment Share” from the drop-down:
This will cause the deployment share to update, and you will see progress indicated in a wizard window that will look like the image below, and when it’s done, click the “Finish” button:
Next, you’ll need to actually create the media. To do this, expand the “Advanced Configuration” folder in the deployment share, and right-click the “Media” folder and select “New Media” from the drop-down:
Once the wizard opens, you’ll need to point the Media path to a folder that will contain the exported media – note that you will have to create this folder as well, as the current version (beta2) does not do this. Also note that it appears (from some comments and my own testing) that the media share path cannot contain spaces (again, this is beta2, so we’ll wait to see if this problem continues in the RCs), or the creation wizard will fail. I’m currently investigating this to see why this is, although it does seem fairly repeatable. Use underscores or dashes if you want to name it something that would otherwise contain a space. The New Media Wizard will look like the following:
Again, use the “Browse” button to create the folder as necessary, and make sure this is also on a drive with ample space, as all of your OS files and applications will be stored here, as well as an .ISO file that can be burned to a DVD (if it’s small enough). Once you’ve selected a folder, click “Next” to create the share.
Once the creation of the media share is complete, you’ll see it in the list of Media available to be created. Right-click on the new media and select “Properties”:
Click the “Rules” tab, and add one field at the end, called “_SMSTSORGNAME” and set it equal to what you want the Unattended progress bar to call your deployment (you’ll see later what I mean by this) – I’ve named mine “cluberti’s imaging stick” for this example:
Next, click the “Edit Bootstrap.ini button, and add the same field with the same name. Once you’re done, save the file, and then click OK:
Lastly, right-click the new media entry and select “Update Media Content” from the drop-down. This will actually create the content folder and the .ISO in the media share, and it WILL take a long time the first time you do this, so be patient:
Once the wizard completes successfully and you click “Finish”, your media is now ready to be copied to your USB key – just put your USB key into the machine, and use Windows Explorer to copy the contents of the “Content” folder in the media share to your USB key:
Seeing it in action
I’m going to show you what this looks like from my deployment media in a Hyper-V VM, so you can see what the end-product will look like. Note that basically ALL of this can be automated via entries into the “Rules” tab and Bootstrap.ini of the media share (or even the Deployment Share folder – the same settings can be seen in the properties of this folder) and entries into the Task Sequence (which I’m leaving for another post.
Without further ado, see the task sequence in action:
Hi there, excellent guide! I never knew this software could be so useful. Unfortunately i’m having an issue on the final stage when Updating the Media Content. The last 4 lines of the log are
Copied standard folders.
Boot images updated.
Setting up x64 boot image.
BcdEdit returned an error.
Then it says process completed with 1 error.
I don’t suppose you came across this when you were playing with it?
Cheers,
Dan.
I did not, although it does appear to be a bcd-specific error. You might be able to delete the media from MDT, manually remove the folder structure from your disk, and recreate it.
All working now! It appears the Deployment & Media shares cannot have spaces in the folder names. They were previously Deployment Share and Media Export, after changing this to DeploymentShare & Media, it gets further whilst updating Media Content.
Interesting. I’ll have to investigate further why that is, if it is the case. Good catch!
I bugged it, and it’s been fixed. Looks like the RTM version should have a fix allowing path names with spaces, if the connect bug I filed (and is fixed) is to be believed.
Will you need to create a bootable USB flash drive so the USB could boot ? If you need to create that how do you do that ?
You should be able to simply copy it over and have the USB key boot, but if it does not you can make it bootable with the bootsect.exe utility installed with the WAIK:
For an x86 system:
“C:\Program Files\Windows AIK\Tools\PETools\x86\bootsect.exe /nt60 /mbr X:”
For an x64 system:
“C:\Program Files\Windows AIK\Tools\PETools\amd64\bootsect.exe /nt60 /mbr X:”
Make sure to substitute the drive letter of your USB key for X: in the command above on your system.
Thank you for the excellent guide, i do everything you mention in this guide but i can’t fint the unattended.xml file ( just for checking if the time zone is correct ) i’m asking this because
he ask me to chose the time zone.
Thank’s again
Great blog, reading it through RSS feed as well
@Dan:\Path\to\\Control\\ folder structure as unattend.xml.
The unattend file itself will be in the
Thank you for reply, can i add a MUI to the operating system like in Office 2007?
i figure it out, you can add MUI, service pack, Update under Packages.
Sorry for the double post, just wanted to let you know that i think something is wrong with the RSS feed of your blog and you might want to check it out, thanks
@Forex Forum
Seems to be working fine here – not sure what you’re seeing.
@Dan
Correct – I usually take the weekends off, but I saw your post this morning.
Hi,
Can you advise how I can add other apps e.g. Norton AV to the share so that it will auto install?
Do I have to create an msi file for install?
I am trying to create an image for mass deployment that has multiple applications pre installed.
@Steve
The application doesn’t need to be an MSI, and unless you want an automated install of the app it doesn’t need anything but to be added to the applications container. However, if you want to automate it, you’ll have to find out what unattended switches the setup engine they use take. You might find what you need by asking around or looking around on the MSFN forums in the Application Installation section. Search there first, and if you don’t find what you’re looking for, you can ask there to perhaps get some help.
Is it possible to add a theme into the unattend.xml file ? If so how do you do that ?
@Mike
It can be done using the CustomDefaultThemeFile parameter in Microsoft-Windows-Shell-Setup. Unless you are auditing, you can set it in specialize or oobeSystem (and oobeSystem is probably preferable).
I keep getting a Windows Boot Manager error which I have annotated below
I used the bootsect cmd to ensure that the USB disk is bootable.
Any ideas, I had no errors while creating the media?
Windows failed to start. A recent hardware or software change might be the cause.
File: \Boot\BCD
Status: 0xc0000225
Info: An error occurred while attempting to read the boot configuration data.
@David
If you’ve got a virtual machine you can test the ISO in, I would do so – does it repro there?
it works fine just using the iso.
I have had other MBR records on this USB drive which may be causing the problem but I did a low level delete and ran the bootsect tool..
Do you know a way to ensure the MBR record is correct or delete it?
Is there a special folder I would need to add the files to. Im using the MDT 2010 along with Windows AIK 2.0 to create the unattended build of Windows 7. Do the themes have to be a .theme file or a msstyle file ? I want to add a theme to the install that I will be using on Windows 7. Can you give me an example on I could go about doing that . Please
@David
If you can find it, HP’s USB format utility does a very good job (in fact I use it to format all of my USB sticks once I get them just in case).
@Mike.theme).
I believe they are .theme files, and I would suggest creating the theme with a Win7 test machine, saving it, and then putting it in your .WIM file with the rest of the themes (%windir%\resources\themes) and pointing the CustomDefaultThemeFile path to your theme (C:\Windows\Resources\Themes\
How would you go about creating a .WIM file ? I’m using the WINDOWS AIK 2.0 along with MDT 2010. I have a unattend.xml file that was created by MDT 2010 which I modified with AIK 2.0 with partitions and other info . Which I see AIK 2.0 having a place for THEMES , I do see this CustomDefaultThemeFile in there. This is my first tiime using AIK and MDT 2010.
@Mike
If you’ve got the WAIK installed, you can mount an image index from the Win7 install.wim you copied to your deployment share using DISM. Mounting a WIM will “mount” it to a folder on your machine, from which you can copy files to and from that WIM file by simply copying to the “mount” folder and subfolder location, and then you can unmount and commit the .WIM file to save the changes to install.wim. This is quite a bit deeper than I’m going to go into in a reply here, but you can read all about DISM and image management (including mounting and unmounting WIM files, etc) on Technet and in the WAIK help files.
Hello from Russia!
Can I quote a post in your blog with the link to you?
@Cluberti
I have a Distribution that was created using MDT2010. It did create a folder called $OEM$. Is this were I add my theme files into to and add the source into CustomDefaultThemeFile that I created inside AIK 2.0? My goal is to have the install of WINDOWS 7 and my applications install unattended along with the theme that I had custom made.
@Polprav
As long as it tracks back, of course.
@Mike
If you don’t want to add it to the WIM file directly, yes, you can use the $OEM$ folder structure to handle this. Note that this is considered “Legacy” behavior, and there are certain limitations to what you can do with it. They are documented here:
http://technet.microsoft.com/en-us/library/dd744265(WS.10).aspx
Will it install the theme during the Windows installation without me patching the theme files ? That’s my goal is to install the theme during installation and have the theme on when I get into the desktop. Im having some people create me a theme and hopefully they will make it a ” .theme ” file . New this whole unattended builds with windows AIK and MDT 2010. Just trying to see if this will work. I apologize for the daily questions.
If i want to create different driver folders and task sequence folders,How do use the unattend.xml to make it work.
Inside Windows AIK under modify the partitions I see ” TYPE ID ” what do I put in there ? I created my partitions as so C:\ os ( 50 GB ) , D:\apps (60 GB) , and E:\files(the rest) . Would I need to add something to the TYPE ID ?
Hello from Russia!
Can I quote a post “No teme” in your blog with the link to you?
Indeed.
I’m in the process of integrating Office 2007 into my multiboot USB and after adding the sources I’m being prompted for a command line. I’m not able to proceed beyond this stage without it. Any ideas what command I should use?
Also, given Office requires a product key in order to install, will I be prompted for one during the OS installation?
If so is can I embed my product key onto the installation?
Thanks for the wonderful tutorial!
The command to install Office is setup.exe. Once that application has been installed, you can right click on the Office application, and go to properties. One tab will be where you change the product key, set it to silent mode, etc.
Nice tutorial. I have not used MDT yet though. Looking at the screenshot, it appears that the installation still requires a lot of interaction. I would like to be able to plug in my usb key and walk away. Can the whole thing be done with an unattend.txt answer file?
@astrouga
Certainly, you could create an autounattend.xml file and automate the install. MDT is for those of us who either don’t want or need a fully automated install, or for those of us who like having an easy UI for creating unattended installations. I’ll admit MDT is geared towards organization-wide distribution and/or testing, but it works well for home-use and small-scale scenarios as well. If you want to do fully unattended, consider reading up in the WAIK on unattended install – you’ll also find quite a few good unattended guides elsewhere on the internet as well that are more unattended.
Hi. Thanks for creating this great guide. I need a bit of assistance though. When I am trying to add Office2007 to my deploymentshare, I am asked to fill a command line in command details section. It says: “Specify the quite install command line and working directory needed to install this application.” It looks like the working directory gets filled in automatically, but the command line is empty and has red exclamation point next to it. Without this step, I cannot complete the process. Please any help is very much appreciated.
@winvision
It’s actually so simple you’ll kick yourself – enter “setup.exe” (minus the quotes, of course).
@cluberti
Yes, it is indeed. I am new to this and would like to apologize for asking this kind of questions.
I am done with applications, now I am adding drivers and noticed that some of them have .exe installers only. So I wonder if there is a way toadd this type of drivers. Thanks again for your help!!!
@cluberti
I had the disk error message when trying to boot from USB. To sole it I did the following
insert usb thumb drive.
Open a Command Prompt as administrator
type:
diskpart
list disk
select disk 1 (or whatever the disk number is of the usb stick you wish to configure)
clean
create partition primary
select partition 1
active
format fs=ntfs quick
assign
exit
Then copy the files to the usb drive
Hi i followed the guide and everything went well i added windows 7 32bit and 64bit then added vista and windows xp. Windows 7 installed without a problem but then tried to install XP and kept getting Invalid Key. The key is valid it’s my Bought copy of XP pro (personal single comp license). Can this version of XP be used or does it need to be a OEM version for it to work?
@Brent Jones
Depends on the source you used – you can’t use an OEM key with a retail version, or vice-versa. If the XP source you have in your deployment share isn’t a retail source, and the product key is, you’ll have to replace the XP source with a retail one before it’ll work.
Great guide , but is it possible to retain user settings via USMT when booting from USB/ISO image. Using the boot from usb/iso i am no longer presented with the option to save the user state data, only “this is a new machine”. Any ideas?
If you used my guide and edited the rules, it is forced into a NEWCOMPUTER default. If you look closely at the rules on a clean install, this is not set – removal of this (and a few other things) should bring the options back.
@winvision
Adding .exe drivers can be a pain, and you’re probably best served doing it after the OS is installed using the task sequence. There are other alternatives, of course, and this script looks like it might be useful. I’ve never tried it, but it does look like it would work if you know certain things about the .exe installer.
Do you have to install the MDT 2010 x86 version if you are going to do a Media Deployment of both Win7 and XP?