If you have been deploying Windows for longer than 4 seconds, you know that the MDT log files are written in a format designed for the CMTrace utility. Here are two quick guides on how to add it to the MDT boot images (the supported way, and the cool/fun way 🙂 ).
CMTrace licensing
CMTrace is a public download from Microsoft, part of the various ConfigMgr Toolkits, but because of some utterly stupid legal terms, it's license terms states that you actually need have a license for ConfigMgr in order to use it. To be able to read a text file, duh! But don't worry, there is a way: According to the answer by Cathy Moya (Microsoft) in this forum thread, you can use the ConfigMgr evaluation media, on which CMTrace is available, and use it for the duration of the evaluation period 🙂
Note: The x86 version of CMTrace.exe is located in the SMSSETUP\OSD\bin\i386 folder on the ConfigMgr Evaluation Media, and the x64 version of CMTrace.exe version is found in the SMSSETUP\OSD\bin\x64 folder.
Adding CMTrace to MDT Lite Touch Boot Images
Once you have the x86 and x64 versions of CMTrace, copied from the ConfigMgr evaluation media, adding them to MDT Lite Touch boot images can be done in a number of ways. The two ways I like the best are the following:
- Option 1 (The supported option). Using the Extra Directory feature in MDY to add feature in the Deployment Share
- Option 2 (The cool option). Create (or steal) a WinPE 10 Plugin of CMTrace and add CMTrace as a "driver" to the boot image.
Creds: I've been writing plugins for WinPE since WinPE version 2.0 (my most popular one is still the ADSI support for WinPE) but it was actually David Segura who gave me the idea to write one for CMTrace to WinPE 10 (David used to have one for WinPE 4.0 that is long gone from the web). Also, if you haven't checked out David's blog, please do that. Good stuff.
Option 1 – Using the Extra Directory to add feature in the Deployment Share
Adding CMTrace via the Extra Directory option in MDT is super-easy:
1. Create a folder named C:ExtraFiles, in which you create the following folder structure
C:\ExtraFiles
C:\ExtraFiles\x86\Windows\System32
C:\ExtraFiles\x64\Windows\System32
2. Copy the x86 version of CMTrace.exe to C:\ExtraFiles\x86\Windows\System32 and the x64 version of CMTrace.exe to C:\ExtraFiles\x64\Windows\System32
The x64 version of CMTrace.exe copied from the ConfigMgr evaluation media to C:\ExtraFiles\x64\Windows\System32.
3. Configure the MDT Deployment Share, by right-clicking the deployment share (MDT Production in my example) and select Properties.
4. In the Windows PE tab, in the Platform dropdown list, make sure x86 is selected, and in the Lite Touch Boot Image Settings area, set the Extra directory to add: to C:\ExtraFiles\x86.
5. Repeat for the x64 version. E.g. in the Windows PE tab, in the Platform dropdown list, make sure x64 is selected, and in the Lite Touch Boot Image Settings area, set the Extra directory to add: to C:\ExtraFiles\x64.
6. Click OK, and then update the MDT Deployment Share to generate new boot images, now containing CMTrace.
The MDT deployment share configured to add the x64 version of CMTrace.exe to the x64 boot image.
Option 2 – Create a WinPE Plugin of CMTrace (adding it as a driver to the boot image).
While the Extra Directory feature in the Deployment Workbench is nice, if you want to join the cool kids on the block, authoring a WinPE plugin for CMTrace and have MDT add it as a driver to the boot image is of course the way to go 🙂
1. Download the CMTrace plugin for WinPE 10, and extract to the C: drive.
2. From the ConfigMgr evaluation media, copy the x86 version of CMTrace.exe to C:\CMTrace WinPE 10 Plugin\CMTracex86 and the x64 version of CMTrace.exe to C:\CMTrace WinPE 10 Plugin\CMTracex64.
The x64 version of CMTrace.exe copied from the ConfigMgr evaluation media to C:CMTrace WinPE 10 PluginCMTracex64.
3. In Deployment Workbench, in your MDT deployment share, in Out-Of-Box Drivers, create the following folder structure:
WinPE x64
WinPE x64Drivers
WinPE x64Plugins
WinPE x86
WinPE x86Drivers
WinPE x86Plugins
4. In the Advanced Configuration / Selection Profiles node, create two selection profiles. The first named WinPE x64, in which you select the Out-Of-Box Drivers WinPE x64 folder. And then the second one, named WinPE x86, in which you select the Out-Of-Box Drivers WinPE x86 folder.
WinPE x64 selection profile created.
5. Using Deployment Workbench, in the Out-Of-Box Drivers / WinPE x64 / Plugins node, import the "drivers" from C:\CMTrace WinPE 10 Plugin\CMTracex64.
6. Repeat for the x86 version. E.g. using Deployment Workbench, in the Out-Of-Box Drivers / WinPE x86 Plugins node, import the "drivers" from C:\CMTrace WinPE 10 Plugin\CMTracex86
The CMTrace x64 plugin imported to Deployment Workbench.
7 Configure the MDT Deployment Share, by right-clicking the deployment share (MDT Production in my example) and select Properties.
8. In the Windows PE tab, in the Platform dropdown list, make sure x64 is selected.
9. In the Drivers and Patches sub tab, select the WinPE x64 selection profile and select the Include all drivers from the selection profile option.
10. Repeat for the x86 boot image. E.g. In the Windows PE tab, in the Platform dropdown list, make sure x86 is selected, and in the Drivers and Patches sub tab, select the WinPE x86 selection profile and select the Include all drivers from the selection profile option.
11. Click OK, and then update the MDT Deployment Share to generate new boot images, now containing CMTrace.
The WinPE x64 MDT boot image configured to use the WinPE x64 selection profile.
CMTrace available in the MDT boot image.
Happy Deployment, Johan
The cmtrace.exe location is not correct. When I copy this cmtrace.exe to the MDT iso I get an error saying that this is not the right type of exe for that version of Windows.
Hi Haider,
For x64 boot images, you need to add the dedicated x64 version of cmtrace.exe. Should be around 300-400 kb in size. The combined x86/x64 version, which is about 700 kb in size, will not work in WinPE x64.