Windows Server containers: images, isolation and Docker
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Core administration and security
-
Phase 3: Enterprise infrastructure
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
More and more, developers hand over apps as container images rather than installers. Windows Server containers let you run those images on Server 2025, where each app gets its own isolated filesystem and processes, starts in seconds and behaves the same on a laptop, a server or a Kubernetes cluster.
You’ll install a container runtime on SRV01, pull a Nano Server image, run and inspect containers and build your own image from a Dockerfile. After that you’ll keep data safe with a mount and check which image versions a host can run.
| Time | You need | By the end you can |
|---|---|---|
| About 60 minutes, plus image downloads | SRV01 with internet access through LabNet and about 10 GB of space on C: | Install Docker on Windows Server, run, inspect and stop containers, build images, use mounts, and explain process and Hyper-V isolation |
What it is, in one line
Windows Server containers are lightweight, isolated environments that share the host’s Windows kernel but have their own files, registry and processes, created from images like Nano Server or Server Core.
In Simple Words
Lunch boxes in one fridge
An office fridge holds everyone’s lunch boxes, each one sealed, labelled and packed the way its owner likes. They all share the same fridge, cold air and power, yet nobody’s soup leaks into someone else’s salad. Containers are the lunch boxes and the host is the fridge, while a VM is more like giving everyone their own small fridge, which separates things better but is far heavier. An image is the recipe card used to pack a box, so if you follow the same card anywhere, you get the same lunch.
Engineer's View
Images, isolation, versions, runtimes
Images: Microsoft publishes base images on mcr.microsoft.com: Nano Server (small, meant for .NET and modern apps), Server Core (the most compatible, with PowerShell included) and Server (the full API set). A tag like ltsc2025 names the Long-Term Servicing Channel release, and your own images add layers on top through a Dockerfile.
Isolation: with process isolation, container processes run directly on the host kernel and show up in the host’s process list, so the image has to be a Windows release the host supports (on Server 2025 that means ltsc2025 and ltsc2022 images). Hyper-V isolation wraps each container in a tiny utility VM with its own kernel, which allows older images and gives stronger separation, but it needs virtualization support that a VirtualBox VM like SRV01 doesn’t have.
Runtimes: Windows Server doesn’t come with a container engine. You can choose Docker CE/Moby (installed with Microsoft’s script and community supported), Mirantis Container Runtime (commercial) or containerd, which is what Kubernetes uses on Windows nodes.
Data: a container’s writable layer disappears when the container is removed, so anything that has to survive goes in a volume or a bind mount from the host. Containers suit stateless app tiers, and domain controllers, DHCP and file servers stay as VMs.
How it works, step by step
Here’s how a container is put together from layers:
The base image layers are read-only and every container that uses them shares them, which is why the tenth container starts in seconds and hardly uses any extra disk. All each container adds is a thin writable layer.
Here’s what you’ll run on SRV01:
- Install the Containers feature and Docker CE with Microsoft’s script.
- Pull the Nano Server ltsc2025 image and run a one-off container.
- Run a long-lived container, look inside it, and find its process on the host.
- Build saatlab/hello:1.0 from a Dockerfile.
- Persist data with a bind mount to D:\Data.
Hands-on Lab: Windows Server containers on SRV01
Before you run any command, double-check it
Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.
Start DC01 and SRV01, take a snapshot of SRV01 called “Before containers” and work on SRV01 in PowerShell as administrator.
1Install the container runtime
On SRV01, download and run Microsoft’s install script:
Set-Location C:\Scripts
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1" -o install-docker-ce.ps1
.\install-docker-ce.ps1The script turns on the Containers feature and restarts SRV01 if it needs to. Sign in again after the restart and the script carries on and installs Docker as a service; if it doesn’t pick up by itself, run it once more.
Then check:
docker version --format "Client {{.Client.Version}} {{.Client.Os}}/{{.Client.Arch}} - Server {{.Server.Version}} {{.Server.Os}}/{{.Server.Arch}}"
Get-Service docker | Select-Object Status, StartTypeYou should see something like this:
Client 27.x.x windows/amd64 - Server 27.x.x windows/amd64
Status StartType
------ ---------
Running Automatic✅ Checkpoint: docker version shows a Windows client and server, and the docker service is Running.
2Pull an image and run a container
On SRV01:
docker pull mcr.microsoft.com/windows/nanoserver:ltsc2025
docker images
docker run --rm mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c "hostname & ver"You should see something like this:
REPOSITORY TAG IMAGE ID CREATED SIZE
mcr.microsoft.com/windows/nanoserver ltsc2025 4e2a1c8b9f03 2 weeks ago 300MB
7c3e9a21b4d6
Microsoft Windows [Version 10.0.26100.NNNN]The container got its own random hostname, and its Windows version matches SRV01’s build 26100. --rm deletes the container when it exits, but the image stays.
✅ Checkpoint: The Nano Server image is listed, and the container printed a random hostname and version 10.0.26100.
3Run a long-lived container and look inside
On SRV01:
docker run -d --name pinger mcr.microsoft.com/windows/nanoserver:ltsc2025 ping -t localhost
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Image}}"
docker exec pinger cmd /c "dir C:\ /b"
docker inspect --format "{{.HostConfig.Isolation}}" pinger
Get-Process -Name PING | Select-Object Id, ProcessName, SessionIdYou should see something like this:
NAMES STATUS IMAGE
pinger Up 8 seconds mcr.microsoft.com/windows/nanoserver:ltsc2025
License.txt
Program Files
ProgramData
Users
Windows
process
Id ProcessName SessionId
-- ----------- ---------
4812 PING 2The container has its own tiny C: drive. Isolation is “process”, so the container’s PING.EXE appears in SRV01’s own process list, in a session of its own. You’d never see a VM guest’s processes on the host like this, and that’s the big difference.
Stop and remove it:
docker logs pinger --tail 2
docker rm -f pinger✅ Checkpoint: You saw the container’s files, its “process” isolation, and its PING process on the host, then removed it.
4Build your own image
On SRV01, create the build folder and files:
New-Item -ItemType Directory C:\Build -Force | Out-Null
'Hello from the SaatLab container image, version 1.0' | Set-Content C:\Build\hello.txt
@'
FROM mcr.microsoft.com/windows/nanoserver:ltsc2025
COPY hello.txt C:/app/hello.txt
CMD ["cmd", "/c", "type C:\\app\\hello.txt"]
'@ | Set-Content C:\Build\Dockerfile
docker build -t saatlab/hello:1.0 C:\Build
docker run --rm saatlab/hello:1.0You should see this at the end:
Hello from the SaatLab container image, version 1.0The Dockerfile is the recipe: start from Nano Server, add a file and set the default command, and anyone with the same Dockerfile and files will build the same image. In real projects the images get pushed to a registry such as Azure Container Registry, and servers or Kubernetes nodes pull them from there.
✅ Checkpoint: docker run saatlab/hello:1.0 prints the hello line.

5Keep data with a bind mount
On SRV01:
New-Item -ItemType Directory D:\Data\app -Force | Out-Null
docker run --rm -v D:\Data\app:C:\data mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c "echo written by a container> C:\data\out.txt"
Get-Content D:\Data\app\out.txtYou should see this:
written by a containerThe container is gone (thanks to --rm), but the file it wrote is still there in D:\Data\app on SRV01. Logs, uploads and databases should always go in volumes or mounts like this.
✅ Checkpoint: D:\Data\app\out.txt exists on SRV01 after the container was removed.
Break It, Then Fix It
Every Windows admin gets caught by these two container surprises once: an image built for an older Windows version, and data that vanishes.
1Break it: an image for an older Windows version
On SRV01, run a Server 2019 image:
docker run --rm mcr.microsoft.com/windows/nanoserver:1809 cmd /c verYou’ll get an error like this (after the pull):
docker: Error response from daemon: container 3f1d... encountered an error during CreateContainer: failure in a Windows system call: The operating system of the container does not match the operating system of the host. (0xc0370101)With process isolation the container uses SRV01’s kernel, so the image has to be a release the host supports. Server 2025 runs its own ltsc2025 images, and because of a stable kernel interface added in 2023 it runs ltsc2022 images as well, but it won’t run 2019 (1809) images.
Hyper-V isolation (--isolation=hyperv) would run the old image in a utility VM with its own kernel, but SRV01 is a VirtualBox VM without nested Hyper-V, so that fails here as well.
Fix it: use an image the host supports:
docker run --rm mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c ver
docker rmi mcr.microsoft.com/windows/nanoserver:1809Whenever hosts move to a new Windows Server version, check every image against Microsoft’s compatibility table and rebuild the old ones on a newer base before you upgrade.
✅ Checkpoint: The 1809 image failed with “does not match the operating system of the host” and ltsc2025 works.

2Break it: data written inside a container
On SRV01, write a file inside a named container, then replace the container:
docker run --name app1 mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c "echo important> C:\report.txt"
docker rm app1
docker run --name app1 mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c "type C:\report.txt"You’ll see something like this:
The system cannot find the file specified.The new container started from the clean image, and the old writable layer, report.txt included, was deleted along with the old container. In production this is how logs and uploads go missing the first time someone updates a container.
Fix it: write to a mount instead, so the file outlives any container:
docker rm app1
docker run --rm -v D:\Data\app:C:\data mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c "echo important> C:\data\report.txt"
docker run --rm -v D:\Data\app:C:\data mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c "type C:\data\report.txt"You should see this:
important✅ Checkpoint: report.txt was lost with the container, and survives when written to the D:\Data\app mount.
This happened at work
The host upgrade that stopped every container
A team ran 40 internal services as Windows containers built on Server Core ltsc2019. Their hosts were due for replacement, so the new servers went in with Windows Server 2022 and the containers were moved across on a Saturday. Not a single one started. Every attempt failed with “The operating system of the container does not match the operating system of the host.” The new hosts were VMs on a platform without nested virtualization, so Hyper-V isolation wasn’t an option either. The team moved everything back to the old hosts and spent the next two weeks rebuilding all 40 images on the ltsc2022 base and testing them.
The fix: images are now built in a pipeline that can target several base versions, and every host upgrade starts with a compatibility test of all the images.
The lesson: Windows containers are tied to the Windows versions the host supports, so treat a host upgrade as an image upgrade as well.
Common mistakes and troubleshooting
| Mistake or symptom | What happens | What to do instead |
|---|---|---|
| “operating system of the container does not match the operating system of the host” | Image built for a release the host can’t run | Use a supported ltsc tag or Hyper-V isolation |
| Writing data inside the container | Data lost when the container is replaced | Volumes or bind mounts |
| Using Server Core when Nano Server would do | Huge images, slow pulls | Smallest base that runs the app |
| Running containers as a way to avoid patching | Old, vulnerable images | Rebuild images on the latest monthly base |
| Expecting Hyper-V isolation inside a VirtualBox VM | It fails | Process isolation, or a host with nested Hyper-V |
| Floating tags like latest in production | Unexpected changes on rebuild | Pin versions; update deliberately |
| Putting DCs or file servers in containers | Unsupported and fragile | Keep infrastructure roles in VMs |
| Forgetting the container runtime isn’t built in | “docker” not recognised | Install Docker CE, Mirantis or containerd |
| No registry or build process | Images built by hand differ | Dockerfiles in source control, built by a pipeline |
Interview questions
Click a question to open it. Each one is phrased the way an interviewer would ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.
Fresher level
1. How would you explain a container to a friend who only knows virtual machines?
Why they ask this: They’re checking you understand what makes a container different from a VM.
How you might answer: I’d say a container packs an app with everything it needs into its own isolated space, but unlike a VM it shares the host’s kernel instead of running a whole OS of its own. That’s why it starts so much faster and uses far less than a VM.
2. Which Windows base images does Microsoft provide for containers, and how would you pick one?
Why they ask this: They want to know you’re aware of the options and that a smaller image is usually better.
How you might answer: There’s Nano Server, Server Core and Server on mcr.microsoft.com, with tags like ltsc2025. I’d pick the smallest one my app can run on, so the image is lighter and there’s less to patch.
3. A developer says their container lost all its data after it was removed. What would you tell them?
Why they ask this: They want to see that you understand container storage is temporary by default.
How you might answer: I’d explain that the container’s own writable layer gets deleted when the container is removed, so to keep data they need a volume or a bind mount that lives outside the container.
2–5 years experience
4. What’s the difference between process isolation and Hyper-V isolation for Windows containers, and when would you use each?
Why they ask this: They’re checking you know the Windows-specific isolation modes and their trade-offs.
How you might answer: Process isolation shares the host kernel, so the image has to be a release the host supports, and you can see the container’s processes on the host. Hyper-V isolation runs each container in a lightweight VM with its own kernel, and I’d use it for older images or when I need stronger separation.
5. After you upgrade a container host, some Windows containers won’t start anymore. What’s the likely cause?
Why they ask this: They want to see you can diagnose Windows container version problems, which surprise a lot of teams.
How you might answer: Most likely the new host doesn’t support the image’s OS version for process isolation. I’d rebuild the image on a newer base, or run it with Hyper-V isolation for the time being.
6. You need to set up Windows Server 2025 to run containers. How would you install a container runtime?
Why they ask this: They want to know whether you’ve done it and which runtime fits which situation.
How you might answer: For Docker CE I’d run Microsoft’s install-docker-ce.ps1 script, and if the company wants commercial support I’d look at Mirantis Container Runtime. On Kubernetes nodes I’d use containerd.
Senior level
7. An app team wants to move everything into containers. Which Windows workloads would you containerise, and which would you keep on VMs?
Why they ask this: They want to see you think about fit and don’t just follow a trend.
How you might answer: Containers make sense for stateless, modern or modernised app tiers that benefit from fast deployment and orchestration. Infrastructure roles, stateful legacy apps and anything that needs full OS features I’d keep on VMs.
8. Your company wants to run hundreds of Windows containers. How would you run them at that scale?
Why they ask this: They’re checking you know orchestration and the build and patching work that comes with it.
How you might answer: I’d run Kubernetes with Windows node pools, on AKS or on-premises with containerd, and keep the images in a registry, built by CI pipelines for each OS version. The nodes themselves would be monitored and kept patched.
9. How would you keep your company’s container images secure over time?
Why they ask this: They want to see that you think about the supply chain, not only about the running container.
How you might answer: I’d rebuild images every month on patched base images, scan them and pin versions, use minimal base images and run apps as a non-admin user like ContainerUser. On top of that I’d sign the images and allow only trusted registries.
Quick quiz
Q1. What do containers share with the host in process isolation?
- Nothing
- The kernel
- Their own kernel
Show answer
B — That’s why image versions matter.
Q2. Which image is the smallest Windows base?
- Server
- Server Core
- Nano Server
Show answer
C — Use the smallest that runs your app.
Q3. Why did the 1809 (Server 2019) image fail on SRV01?
- No internet
- Server 2025 can’t run 2019 images with process isolation
- Docker was stopped
Show answer
B — Use ltsc2025 or ltsc2022, or Hyper-V isolation.
Q4. Where should a container write data that must survive?
- C:\ inside the container
- A volume or bind mount
- The image
Show answer
B — The writable layer is deleted with the container.
Q5. In the work story, what had to be done?
- Reinstall Docker
- Rebuild 40 images on the new base
- Buy new hardware
Show answer
B — Host upgrades are image upgrades too.
Quick recap
- Windows Server containers share the host kernel but have their own files and processes.
- Windows doesn’t include a container runtime, so install one (the Docker CE script, Mirantis or containerd).
- Server 2025 runs ltsc2025 and ltsc2022 images with process isolation; older ones need Hyper-V isolation.
- Build images with Dockerfiles; the base layers are read-only and shared.
- Keep data in volumes or bind mounts.
- Infrastructure roles stay in VMs.
Next lesson
Lesson 31: AD sites and replication → Next you’ll create a second AD site, move DC02 into it, set up site links and subnets, force and monitor replication with repadmin and look at RODCs for branch offices.
Further reading: Windows Server containers
Want to go deeper into Windows Server containers? Microsoft’s container environment setup guide covers runtimes, and the version compatibility page explains which images run on which hosts. You can also see the full plan for this course on the Windows Server Administration course page.
