WSL Containers: A Game Changer for Linux on Windows

At Microsoft Build 2026, Microsoft introduced WSL containers — a major evolution in Linux container development directly on Windows through the Windows Subsystem for Linux (WSL). Containers have become a cornerstone of modern development, from cloud-native applications and AI workloads to testing and deployment pipelines. WSL containers simplify this experience by providing a built-in, enterprise-ready way to create, run, and manage Linux containers on Windows, without requiring additional third-party tooling.

You can access the WSL container feature in the latest pre-release of WSL right away by running wsl --update --pre-release, or by downloading and installing it directly from GitHub.

Overview

WSL container adds two major new features to WSL:

  • A built-in Linux container CLI (wslc.exe)
  • An API for Windows applications to run Linux containers as part of their app logic

WSL Container CLI – wslc.exe

When you update to the latest WSL version, you get a new binary on your path: wslc.exe. This CLI tool supports full Linux container development workflows — running, debugging, testing, and more — with a familiar format that respects your existing muscle memory.

For example, you can run a full Linux desktop in a container:

wslc run -d --name=webtop -e PUID=1000 -e PGID=1000 -e TZ=Etc/UTC -p 3000:3000 -p 3001:3001 lscr.io/linuxserver/webtop:ubuntu-kde

Or check GPU access with a CUDA script:

wslc run --rm --gpus all pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime python -c "import torch; print(torch.cuda.is_available()); print(torch.cuda.get_device_name(0))"

There is also a built-in alias container.exe that maps to wslc.exe, so you can use either command interchangeably.

WSL Container API

Windows applications can now directly use containers as part of their application logic. WSL ships a NuGet package (available on nuget.org and the WSL releases page) with support for C, C++, and C#.

This API integrates with MSBuild and CMake, meaning you can add a few lines to your project files and have container build and deploy steps become part of your application’s build process — no manual steps required. You can git clone and try a sample or check out the full API reference.

Integration with Enterprise Tools

Monitor Security Events with Microsoft Defender for Endpoint (MDE)

WSL’s existing MDE plugin has been updated to be aware of Linux container events, providing the same security coverage whether you are using a WSL distro or containers. This feature is currently available as part of a private preview which you can sign up for here.

Manage WSL Container Settings with Intune

New management settings for WSL container are being added, allowing organizations to:

  • Control whether users can use WSL distros or containers
  • Specify an allowlist of container registries for pulling images

This addresses the top customer ask: “How can I control which distros/Linux images are allowed in my organization?” Currently available via GPO and an ADMX policy, with official Intune dashboard support coming within a few weeks.

VS Code Dev Containers

WSLc support has been added to VS Code Dev Containers in version 0.462.0-pre-release. To set it up, open the VS Code Dev Container settings, find the “Docker Path” setting, and change it to wslc. This is currently in pre-release and will soon move to general availability.

Further WSL Improvements

Alongside the container feature, Microsoft is making significant improvements to the underlying technology powering both WSL and WSL container:

  • New default file system (virtiofs): Makes Windows file access 2x faster
  • New default networking mode (Consomme): Relays Linux network traffic through Windows, allowing Linux applications to benefit from the same networking environment, security policies, and enterprise integrations available to Windows applications
  • Improved memory reclaim techniques: Gradually and consistently releases memory back to the Windows host when not in use

These lower-level platform changes will also benefit other container tools built on WSL, such as Docker Desktop, Podman Desktop, and Rancher Desktop.

Learn More

You can view the presentation from Build 2026 to learn more about the use cases and see demos. Additionally, visit the WSL container docs page for in-depth guides and sample code.

Feedback and What’s Next

This feature is currently in the pre-release version of WSL as a public preview. Microsoft aims to make WSL containers generally available in fall 2026. Install it, try it out, and file issues and feedback at the WSL GitHub page.

Source: Microsoft Dev Blogs – WSL container is now available for public preview by Craig Loewen, Senior Product Manager

Oracle Database in Docker Container

visit the below url
https://container-registry.oracle.com/ords/ocr/ba/database/free

pull the latest image
docker pull container-registry.oracle.com/database/free:latest

Run the container using the image
docker run –name oracleexpressdev -p 1521:1521 -p 5500:5500 -e ORACLE_PWD=oracle@1234 -v D:\LocalDB\OracleExpress\Datafiles:/opt/oracle/oradata container-registry.oracle.com/database/free:latest
The following is the explanation of the parameters
docker run: This is the Docker command to create and start a new container.
–name oracleexpressdev: This sets the name of the container to oracleexpressdev.
p 1521:1521 -p 5500:5500: These parameters map ports on your host machine to ports in the container.
p 5500:5500 maps port 5500 on the host to port 5500 in the container. This port is used for Oracle Enterprise Manager.
e ORACLE_PWD=oracle1234: This sets an environment variable inside the container. ORACLE_PWD is the the Oracle Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated)
v D:\LocalDB\OracleExpress\Datafiles:/opt/oracle/oradata: This mounts a volume from your host machine to the container.
/opt/oracle/oradata is the path inside the container.
This allows the Oracle database to persist data on your host machine.
container-registry.oracle.com/database/free:latest: This specifies the Docker image to use for the container.
In this case, it’s the latest version of the free Oracle database image from Oracle’s container registry.

after the command is run , i got an error , Password cannot be null .

This implies there is an issue with the password that we provided to run the container .In my case , i provided oracle@1234 . so the issue here was @ symbol seems it is not accepting the special character .

so i changed password
docker run –name oracleexpressdev -p 1521:1521 -p 5500:5500 -e ORACLE_PWD=oracle1234 -v D:\LocalDB\OracleExpress\Datafiles:/opt/oracle/oradata container-registry.oracle.com/database/free:latest

Now every thing was fine . If all fgoes well , it will do some back ground work
and finally gives


Create a Console app and run in a Container with Visual Studio 2022

I couldn’t find an article on this topic . so i thought i will put one .

Now there are many ways to interact with the container .You can do it with visual studio , Docker Desktop /terminal window
The following shows how to interact with the console app running in container using visual studio .
click the button shown below to open the terminal window .

It opens the power shell in the /app directory
cd in to the the directory that has the dll file .Fo e.g in this case it will be
cd /app/bin/Debug/net9.0/
dotnet <.dllfile>
Now you will be able to interact with it


Another way to do it is to build the image from the docker file generated by visual studio, as shown below

so try to open a separate terminal window to interact with the container .

here i built the image from the docker file visual studio generated and then started a container from it.using the following command
D:\LocalProjects\2024\DotNetConsoleApps\JuiceShop.Solution>docker buildx build -t juiceshop:v2 -f ./JuiceShop/Dockerfile .
The following is the output of theabove command

Once the above command is successful , it created a container image .

if you have installed docker desktop you could see this local image .

Now, to spin a container from the image , you can execute the following command in the terminal
docker run -it –name “zzzz” juiceshop:v2

if you don’t specify –name followed by container name (in this example zzzz) then docker gives an arbitrary name to the container.

Run the container
docker run -it –name “zzzz” juiceshop:v2
Hello please enter your name ?
Ethan Hunt
hello Ethan Hunt