
Published on 10.12.2025
When working with Amazon EC2 instances, provisioning an image can sometimes take longer than expected, especially when using Windows AMIs. One often-overlooked culprit behind slow instance provisioning is the size of the Administrator profile. In this post, we’ll explore how a large Administrator user directory can slow down the Sysprepprocess during image creation and how you can mitigate these issues to speed up your EC2 provisioning.
When you create a custom AMI from a Windows instance, the Sysprep tool is used to generalize the instance. Part of this process involves copying the contents of the Administrator profile to the default profile using the CopyProfile directive. This ensures that any settings or configurations made under the Administrator account are applied to new user accounts created on instances launched from the AMI.
However, if the Administrator profile is large—either due to the number of files, installed applications, or custom configurations—this can significantly slow down the CopyProfile step, leading to long delays during the specializepass of the Sysprep process.
Recently, we encountered a scenario where the provisioning of a new EC2 instance was taking over 30 minutes to complete. Upon investigation, we discovered that the Administrator profile was approximately 2.7 GB in size and contained numerous files and applications, including Visual Studio Code, Python, and various browsers.
The CopyProfile step, which runs during the Sysprep process, was taking an unusually long time—about 12 minutes—to complete. This was due to the sheer number of files in the Administrator profile that needed to be copied. Each small file and application configuration adds to the time it takes for Sysprep to complete its work, drastically increasing the time required to provision the AMI.
The CopyProfile directive in Sysprep is designed to copy all user settings, application data, and configurations from the Administrator profile to the default profile. While this is a useful feature when you need to replicate the same environment across new instances, the size and complexity of the profile can greatly affect the time it takes.
Here’s why a large profile can slow down provisioning:
To understand how many files were in the Administrator profile, we used PowerShell to get a count of files in the directory:
Get-ChildItem -Recurse "C:\Users\Administrator" | Where-Object { -not $_.PSIsContainer } | Measure-ObjectThis command gave us the total file count, which turned out to be in the tens of thousands. Each of these files was being copied during the CopyProfile operation, contributing to the slow image creation.
If you encounter a similar situation where your EC2 instance is taking too long to provision, here are a few ways you can mitigate the problem:
1. Move Applications to a System-Wide Installation
Instead of installing applications like Visual Studio Code, Python, or browsers under the Administrator account, install them system-wide. This moves application files from C:\Users\Administrator\AppData to C:\Program Files, reducing the size of the profile and speeding up the copying process.
2. Clean Up the Administrator Profile
Regularly clean the Administrator profile by:
3. Disable CopyProfile if Not Needed
If you don’t need to preserve the Administrator profile’s custom settings for new users, you can simply disable the CopyProfile directive in the unattend.xml file. This will eliminate the profile copying step altogether, resulting in much faster provisioning times.
4. Optimize Your AMI
Consider creating a lean AMI where only the necessary applications and settings are included. After instance launch, use AWS Systems Manager (SSM) or other automation tools to install additional software and configurations as needed. This minimizes the size of the base AMI and speeds up the Sysprep process.
A large Administrator profile can severely impact the time it takes to provision an EC2 instance from an AMI, particularly due to the CopyProfile step during the Sysprep process. By cleaning up the profile, moving applications to a system-wide installation, or disabling CopyProfile if unnecessary, you can significantly reduce the time it takes to create new instances.
By following these steps, you can ensure that your EC2 instances provision quickly and efficiently, without being bogged down by excessive profile copying.