Microsoft introduces Linux container support for WSL

WSL

Microsoft is moving beyond just running Linux distributions with the Windows Subsystem for Linux, as WSL containers are now generally available.

You can get the function by running wsl --updateand once it is installed there is a new one wslc.exe Command line tool.

Microsoft also includes container.exe as an alias so you can use more familiar container commands.

“WSL Container CLI: wslc.exe to create, run and deploy Linux containers directly on Windows or use the built-in alias container.exe to execute the same familiar container commands,” said Microsoft explained.

There is also a WSL Container API that allows Windows apps to programmatically launch and interact with Linux containers.

“Access functionality to programmatically run Linux containers within your native Windows apps – and unlock scenarios such as running local AI workloads or using cloud-based container applications locally,” Microsoft noted.

Windows 11 WSL

The general availability release adds several features that were missing in the preview, including restarting containers, copying files in and out, health checks, network connect and disconnect commands, real-time container events, mount support, and configurable storage locations.

Microsoft also makes WSL containers available to companies

WSL containers now integrate with Microsoft Defender for Endpoint, allowing security teams to see process, file, and network activity in containers and associate them back to the Windows host.

Microsoft Intune can also disable WSL containers completely or limit developers to images from approved container registries.

“Container registry allow lists allow administrators to define approved registries and help ensure that developers only retrieve container images from this list that meet the organization’s security and compliance requirements,” Microsoft noted.

Microsoft also works with the broader developer ecosystem.

VS Code Dev Containers can be used wslc as the default driver, while Aspire and the VS Code Containers extension now support WSL containers.

wsl compose up comes next

The most requested missing feature is Docker Compose-style support, and Microsoft says it’s already working on it.

“This is our goal wsl compose up to work with your existing ones compose.yaml Files unchanged,” Microsoft said. “We have started this and hope to share more soon.”

Microsoft is also working on WSL’s underlying network and cross-OS file performance.

The company says WSL containers can already deliver up to two times faster performance when accessing Windows files from Linux environments.

Leave a Comment