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

Virtual Box- startup Options

The following is a summary of startup options available in virtual box start up .

Start with GUI

This launches the VM in a standard window, complete with 3D graphics support—provided 3D acceleration is enabled, Guest Additions are installed, and the OS supports it.

Detachable vs. Headless

These modes are essentially the same: neither provides 3D acceleration, even if it’s enabled in the VM settings.

Start without GUI (Headless)

Think of this as “monitorless.” The VM’s graphics system runs, but no window appears—like a monitor turned off and tucked away. The guest OS still renders the GUI, which you can access remotely via native protocols or VirtualBox RDP/VNC. To display the window, click Show in VirtualBox Manager, which switches to Detachable mode. To hide it again, use Machine → Detach GUI. You can toggle between visible and hidden as needed.

Start with Detachable GUI

This is simply a headless VM with its monitor visible in a window. You can show or hide the window at will, using the same toggle options as in headless mode.

MSYS2 where does the package get installed ? I mean in which environment ?

In MSYS2, packages are installed into different environments based on the type of package and the environment you are using. Here are the main environments:

  1. MSYS: Contains Unix-like tools and is always active. Packages installed here are placed under /usr.
  2. MINGW32: For 32-bit MinGW-w64 packages, installed under /mingw3.
  3. MINGW64: For 64-bit MinGW-w64 packages, installed under /mingw64.
  4. UCRT64: Uses the Universal C Runtime, installed under /ucrt64.
  5. CLANG32: Uses the Clang toolchain for 32-bit, installed under /clang32.
  6. CLANG64: Uses the Clang toolchain for 64-bit, installed under /clang64.

MSYS2 How to know which is the default environment.

echo $MSYSTEM
This command will display the current environment, such as MSYSMINGW32MINGW64UCRT64CLANG32, or CLANG64

MSYS2 How to change the default environment ?

To change the default environment in MSYS2, you can set the MSYSTEM environment variable to the desired environment. Here’s how you can do it:

  • Open MSYS2 Terminal: Start the MSYS2 terminal.
  • Set the Environment Variable: Use the “export” command to set the “MSYSTEM” variable. For example, to switch to the “MINGW64” environment, you would use: export MSYSTEM=MINGW64
  • You can also create a shortcut that opens MSYS2 with a specific environment. Here’s how:
    • Create a Shortcut: Right-click on your desktop and select New > Shortcut.
    • Enter the Path: Enter the path to the MSYS2 executable followed by the desired environment.
      For example: C:\msys64\msys2_shell.cmd -mingw64
    • Name the Shortcut: Give your shortcut a name, like “MSYS2 MINGW64”, and click Finish.
      Now, you can use this shortcut to open MSYS2 directly in the “MINGW64” environment.

Once you change the default environment to MINGW64 and run the pacman -Suy command, the packages will be installed in the MINGW64 environment. Specifically, they will be placed under the /mingw64 directory.

Find Operating System in Linux Using Bash

Accessing OS Information

The most straightforward method to check your OS details is by using the cat command on the /etc/os-release file. This file contains identification data of the Linux distribution and looks something like this:

$ cat /etc/os-release

You’ll receive output similar to:

NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"

This file is present in most modern Linux distributions and provides a standardized way to access OS information.

Using the lsb_release Command

Another method is to use the lsb_release command, which displays Linux Standard Base (LSB) and distribution-specific information:

$ lsb_release -a

The output will provide detailed information about the distribution:

Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

However, it’s worth noting that lsb_release might not be installed by default on some systems.

The hostnamectl Command

For systemd-based systems, hostnamectl can also be used to query and change the system hostname and related settings, including the OS information:

$ hostnamectl

It will display a comprehensive view, including the OS details:

Operating System: Ubuntu 20.04.1 LTS
Kernel: Linux 5.4.0-42-generic
Architecture: x86-64

WSL Error- Processing fstab with mount -a failed

i installed windows subsystem for linux + now i am gettign the following error <3>WSL (8) ERROR: CreateProcessParseCommon:754: getpwuid(0) failed 2
Processing fstab with mount -a failed.
<3>WSL (8) ERROR: CreateProcessEntryCommon:331: getpwuid(0) failed 2
<3>WSL (8) ERROR: CreateProcessEntryCommon:502: execvpe /bin/sh failed 2
<3>WSL (8) ERROR: CreateProcessEntryCommon:505: Create process not expected to return

To resolve the issue:
The reason for this error could be if the default WSL distribution is set to an incorrect value
Open PowerShell as an administrator.
For e.g if you had installed ubuntu then you can set it as default distribution
Run the command wsl –setdefault Ubuntu to set the default WSL distribution to Ubuntu. Replace Ubuntu with the name of the distribution you want to use.
Restart your computer.
Open PowerShell as an administrator again.
Run the command wsl to start the default WSL distribution.

How to Install MongoDB on windows subsystem for Linux (Ubuntu Jammy)

  • Open command prompt on your windows machine (Start –> run –> cmd –>type wsl . This will put
    you in Linux bash terminal . The please execute the following commands in sequence.
  • wget -qO – https://pgp.mongodb.com/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg –dearmor
  • echo “deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
  • sudo apt update
  • sudo apt-get install -y mongodb-org
  • By default if mongodb is installed via Package manager , the data directory is /var/lib/mongodb and the log directory is /var/log/mongodb are created during the installation.
  • sudo systemctl start mongod
  • sudo systemctl status mongod
  • sudo systemctl stop mongod

How to Create a short cut for a Folder in Linux Cinnamon desktop

Steps :

  • Open File Manager (Nemo) make sure make link is enabled . (edit > preferences > context menus > make link (should be checked)
  • Navigate to the parent folder of the folder which you need to create a short cut . for e.g if you have a folder structure /usr/parent/child . right click the folder “open as administrator” then right click child > make link .
  • This will create a shortcut in the same parent folder . cut and paste it in to the desktop or any folder where you need the short cut .