Surendra Sharma

Surendra Sharma

Search This Blog

Saturday, September 6, 2025

Fixing Sitecore XM Cloud Local Installation Issues with Docker and BitLocker

When setting up Sitecore XM Cloud locally, many developers face errors with Docker Desktop on Windows. The root cause is often the latest Docker versions (e.g., 4.45) conflicting with BitLocker encryption and storage drivers.

In this blog, I’ll walk you through the actual problem, the errors you may encounter, and the fixes that finally worked for me.

The Problem: Docker Desktop + BitLocker

After updating Docker Desktop to the latest version, I started facing issues running Sitecore XM Cloud containers. Even a simple container test like:

docker run --isolation=hyperv mcr.microsoft.com/windows/nanoserver:ltsc2022 cmd /c echo hello

failed with errors such as:

FSCTL_EXTEND_VOLUME \\?\Volume{GUID}: The media is write protected.

and later:

hcsshim::ExpandScratchSize failed in Win32: The system cannot find the file specified. (0x2)

This turned out to be a conflict between Docker’s Windows storage driver and BitLocker encryption.

Solution 1: Downgrade Docker Desktop


The easiest fix is to downgrade Docker Desktop to a stable version without this bug. Version 4.37.1 works perfectly.

Steps:
1. Uninstall Docker Desktop (latest version).
2. Download and install Docker Desktop 4.37.1 (https://docs.docker.com/desktop/release-notes/).
3. Restart your machine.

Solution : Update Docker Engine Settings

Another issue you may face is the buildkit warning when building containers:

Docker Compose is configured to build using Bake, but buildkit isn't enabled

To fix this, update your Docker Engine configuration:

{
  "dns": [
    "8.8.8.8"
  ],
  "experimental": false,
  "features": {
    "buildkit": false
  }
}

After saving the file, restart Docker Desktop for changes to take effect.

Solution : Fixing the hcsshim::ExpandScratchSize Error

If you see this error:

hcsshim::ExpandScratchSize failed in Win32: The system cannot find the file specified. (0x2)

it means your Docker Windows storage layers are corrupted.

Fix: Clean Docker’s Windows storage

Run this PowerShell as Administrator:

Stop-Service com.docker.service
Stop-Service docker

# Remove Windows container layers
Remove-Item -Recurse -Force "C:\ProgramData\Docker\windowsfilter" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "C:\ProgramData\Docker\containers" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "C:\ProgramData\Docker\image\windowsfilter" -ErrorAction SilentlyContinue

Start-Service com.docker.service
Start-Service docker

Now, test with a clean Windows container:

docker pull mcr.microsoft.com/windows/servercore:ltsc2022
docker run --rm --isolation=hyperv mcr.microsoft.com/windows/servercore:ltsc2022 cmd /c echo hello


✅ You should now see: hello

Final Thoughts

If you’re running Sitecore XM Cloud locally on Windows, here’s the checklist that worked for me:
- Downgrade Docker Desktop to 4.37.1
- Add correct Docker Engine settings to disable buildkit
- Clean up corrupted windowsfilter storage if you hit hcsshim::ExpandScratchSize errors

With these steps, I was finally able to get Sitecore XM Cloud running smoothly on my local machine without Docker crashes.