How can I increase the SMSTS.Log file size for PXE based OS Deployments using System Center 2012 R2 Configuration Manager ?

Introduction

I’ve seen a lot of questions about how you can increase the log file size for PXE based Operating System Deployments using System Center 2012 R2 Configuration Manager so hopefully the 2 different methods below will clear things up.

 

Note: The two methods below make changes which only impact logging during the WinPE Phase of OSD (which is usually where most problems occur). If you want to increase the log file size within the rest of the task sequence, i.e. the Windows portion, then depending on the installation type use the following methods. For a new computer scenario, to increase the log file size of all logs, add CCMLOGMAXSIZE=5242880 CCMLOGLEVEL=0 CCMLOGMAXHISTORY=3  to your Setup Windows and ConfigMgr step, whereas for a refresh (reinstallation) computer scenario, add the registry keys below. For more details see the What about the logs in Windows ? section at the end of this guide.

 

Problem
When PXE booting (network boot) the default log file size in WinPE is a rather pathetic 1MB or so as seen by the text highlighted in red from the SMSTS.log file below.

 

default size boot wim.png

 

As a direct result of this default size, the log file for OSD (primarily the SMSTS.log) will get overwritten if you have any large policy to download or if for example you have MDT integrated (because of all the files downloaded in the MDT Toolkit and associated steps), or if for example you  are downloading several files in one or more packages.

 

The knock on effect of rolling over the log file is you will most likely miss seeing  errors in the log file as they are overwritten by default. In other words, the log file is too small.

 

To cut a long story short, if you want to increase the size of your log file during Operating System Deployment then a file called SMSTS.INI must be present in the Windows directory of the boot image you are booting from and it should contain options to specify the new size of logfile you desire. You cannot set the logfile size using a prestart command as that process happens after the logfile size options are set.

 

Method #1. Inject SMSTS.ini into the boot wim file via dism.

 

Step 1. Download or create a SMSTS.INI file

 

Note: This guide assumes you have not yet added the SMSTS.ini file to your boot wim and that you want to add the file to the x86 boot wim. Making the change to the source boot wim file of one architecture (x86 or x64 boot wim) will make the change for all boot images based on that source boot wim however  these changes will not come into effect until they have been re-distributed to their distribution points.

 

You can create a new text file called SMSTS.ini in notepad with the following text, make sure it is not saved as SMSTS.ini.txt, if it is, rename it to SMSTS.INI. The settings below are what I use, you might want to change those values to suit your environment.

[Logging]
LOGLEVEL=0
LOGMAXSIZE=5242880
LOGMAXHISTORY=3
DEBUGLOGGING=1

or use the sample below.

 

Attached File  smsts.ini   76bytes   13 downloads

 

Save this file somewhere useful.

 

Step 2. Identify your current boot image

You can do this in a variety of ways, the easiest is to simply see which boot wim is used during PXE boot as long as another one is not staged after selecting your task sequence. To identify the boot wim look at the Package ID shown in the screenshot below

 

identify boot wim in use.png

 

Now that you’ve got the package ID of your boot image, locate it in the console, note that the Package ID is actually under the ImageID column in the Configuration Manager console under boot images.

 

boot wim identified by packageID.png

 

Step 3. Locate the boot wim file

 

Right click on the boot image and choose properties, select the Data Source tab to identify where the boot image source file wim is located, this is listed in the Image Path. Using Windows Explorer, browse to the data source listed in the properties and you’ll probably see a few wim files listed in there,however the file we are interested in is called boot.wim.

 

boot wim source.png

 

Every time your boot image is updated (for example by adding drivers or optional components), this file (boot.wim) is used as the source for all changes, so making changes to this file will insure that your boot image has that changed locked in place going forward.

 

We need to locate the local copy of the file shown above. By default this file will be present locally on our Configuration Manager primary server in the following path D:\Program Files\Microsoft Configuration Manager\OSD\boot\i386\boot.wim assuming Configuration Manager is installed on D:\ and assuming you are using an x86 boot image.

 

Note: Make a backup copy of the file before making any changes to it. Give the backup file a name that is useful like boot.wim.bak.

 

backup boot wim.png

 

Step 4. Create some temp storage for mounting

 

To mount the boot wim we need some temporary storage so create some folders on C:\ like so

 

C:\WinPEMount

C:\WinPEMount\X86

C:\WinPEMount\X64

 

as shown in the screenshot below

 

WinPEMount folders.png

 

Step 5. Mount the boot wim

 

We will modify the  boot wim file in the local path. To inject files we first need to mount the file with DISM. Use the version of DISM that comes with System Center 2012 R2 Configuration Manager, the correct version is included in ADK 8.1 and the correct version of DISM is 6.3.9600.16384. To start the correct version of DISM locate it in your start menu and right click on the Deployment Imaging Tools and Environment cmd prompt, choose Run as Administrator as shown below

 

run as administrator.png

 

and change directory to the directory that has your boot wim file. You can check the contents of the directory to verify that the boot wim file is present by issuing a DIR command.

 

dism boot wim.png

 

Use the following command to mount your boot wim file (you may need to adjust the path to match your boot wim architecture and source path).

dism.exe /mount-wim /wimfile:"D:\Program Files\Microsoft Configuration Manager\OSD\boot\i386\boot.wim"/index:1/mountdir:c:\WinPEMount\X86

It should mount the boot wim successfully as shown below

 

boot wim mounted ok.png

 

Step 6. Copy the SMSTS.INI file to the Windows directory

 

Copy the SMSTS.INI file created above to the Windows folder in your temporary storage mount directory as shown below

copy smsts.ini c:\WinPEMount\x86\Windows

and here’s the copy taking place in our DISM cmd prompt

 

copy smsts ini file.png

 

Step 7. Commit the changes

 

Now that the file is in place, we need to instruct DISM to commit our changes (save the changes) to the boot wim file.

dism.exe /unmount-wim /mountdir:c:\WinPEMount\x86/commit

as shown in the screenshot below

 

commit changes.png

 

Step 8.Update Distribution Points

 

right click on your boot image in the Configuration Manager console, and choose Update Distribution Points

 

update distribution points.png

 

continue through that wizard until completion.

 

update dp wizsard complete.png

 

Tip: All boot images that use this boot wim file as the source can now make use of this change in logging ability, however that will not be present until they are also updated to their respective distribution points.

 

Step 9. Test the updated boot image

 

Boot a computer using PXE. Assuming that the task sequence containing this boot image was deployed as the last task sequence to a collection that our computer is a member of, then even before the PXE password box is used you can check for the presence of the smsts.ini file, by pressing F8. If the SMSTS.ini file is present in the Windows directory then the new log file size ability should be in affect for that boot image.

 

smsts ini is present in the boot wim.png

 

After entering the PXE password and before selecting a task sequence, the increased log file size is registered in the SMSTS.log file as shown below:

 

Increased Log Size Registered.png

 

 

Success !

 

Method #2. Copy SMSTS.ini into MDT boot images using Extrafiles.

 

Note: in Method #1 above, we’ve already modified the boot.wim source for i386 architecture. As a result it already contains the smsts.ini file, so for the purpose of this guide I’ll revert that boot wim to it’s backed up state (no smsts.ini file injected) before completing this guide.

 

If you are using MDT boot images you can avail of the ExtraFiles ability to do the same thing. Here’s how it’s done.

 

Step 1. Create an Extrafiles folder

 

On your Configuration Manager sources structure (eg: \\sccm\sources\), create a folder called Extrafiles

 

Next, within the Extrafiles folder, create another folder called Windows, and copy the SMSTS.ini file from above into the Windows folder so that it looks like so

 

Extrafiles Windows.png

 

 

Step 2. Create a MDT boot image

 

In a MDT Integrated Configuration Manager console, right click on boot images and choose Create boot image using MDT as shown below:

 

Create Boot Image using MDT.png

 

enter the package source path (create the necessary empty folder structure before clicking next, eg: create \\sccm\sources\os\boot\mdt2013\i386)

 

Pacakage source path.png

 

fill in some useful info about the boot image

 

MDT boot image.png

 

select the appropriate options (x86 versus x64) and scratch space…

 

x86 platform.png

 

select any additional Optional Components

 

optional components.png

 

enter the path to the Extrafiles folder and also make sure F8 support is enabled as shown below

 

path to extrafiles and enable F8.png

 

continue through that wizard until completion. The AppData temp folder it refers to is where it does the ExtraFiles copying (amongst other things).

 

mdt boot image created.png

 

Step 3. Enable the new MDT boot image for PXE

 

Right click your newly created MDT boot image, make sure it’s enabled for PXE as shown below

 

by enabling the deploy this boot image from the PXE enabled distribution point option on the Data Source tab

 

 

deploy this boot image from the PXE enabled distribution point.png

 

Step 4. Distribute the MDT boot image

 

Right click the MDT boot image and choose Distribute content.

 

distribute content.png

 

Select whatever distribution points you want it distributed to, continue through that wizard.

 

distributed mdt boot image.png

 

Step 5. Update Distribution Points for the boot image

 

Nearly done, right click the MDT boot image again, and choose Update Distribution points, continue through that wizard.

 

 

update distribution points mdt.png

 

Step 6. PXE boot and test the new MDT boot image

 

Now that you’ve made the changes you’ll want to see the results, make sure the new MDT boot image is attached to a live task sequence that is deployed to a collection your computer is a member of.

 

Notice that the package id of the MDT boot wim  while PXE booting is different to the boot wim used in Method 1 above.

 

PXE boot with a different Package id for the MDT boot wim.png

 

Once WinPE has loaded, enter the PXE password and then check the SMSTS.log file, as you can see the change is logged here also

 

log file size changed.png

 

Success !

 

What about the logs in Windows ?

 

Finally, you have bigger log files while in WinPE but what about the rest of the task sequence (i.e. while in Windows). Well to increase the log files in Windows you first need to identify if you are doing a New  Computer installation or a Refresh (a reinstallation). Once you know which you are doing follow the advice below.

 

  • New Computer Scenario

 

For the New computer scenario, you need to edit the Setup Windows and ConfigMgr step as shown below

CCMLOGMAXSIZE=5242880 CCMLOGLEVEL=0 CCMLOGMAXHISTORY=3

This will affect more than your SMSTS.log file however, but more detail is always good especially for troubleshooting, and you can adjust the values above to suit your needs.

 

Installation Properties.png

 

  • Refresh Computer Scenario

 

For the Refresh Computer Scenario, apply the following registry keys via a REG.exe command line.

 

Attached File  Global CCM logging options CM12.reg.txt   524bytes   0 downloads

 

The registry keys are shown below and attached here. Download the file and remove the .txt extension before use.

 

registry keys for refresh.png

 

To set these registry keys, create a run command line step in the refresh part of the task sequence, which includes the following statement

cmd /c REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL"/v LogLevel/t REG_DWORD /d 0/f & cmd /c REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL"/v LogMaxHistory/t REG_DWORD /d 3/f & cmd /c REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL"/v LogMaxSize/t REG_DWORD /d 5242880/f

as shown below

 

cm12 logging options refresh.png

 

 

Summary

Changing the size of the smsts.log file for PXE based OSD deployments isn’t exactly straightforward but hopefully this guide brings some clarity to the process.

 

Related Reading

 

Downloads

You can download a Microsoft Word copy of this guide here. Attached File  How can I increase the size of the SMSTS log file in PXE based OSD deployments using System Center 2012 R2 Configuration Manager.zip   2.48MB

This entry was posted in ConfigMgr 2012, MDT 2013. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.