Skip to content

Add WSLC (WSL Containers) feature#40366

Merged
benhillis merged 1 commit into
masterfrom
merge/wslc-to-master
Apr 30, 2026
Merged

Add WSLC (WSL Containers) feature#40366
benhillis merged 1 commit into
masterfrom
merge/wslc-to-master

Conversation

@benhillis
Copy link
Copy Markdown
Member

@benhillis benhillis commented Apr 30, 2026

WSLC is a container runtime built on the Windows Subsystem for Linux, enabling Windows applications to create and manage Linux containers through a native Windows API surface.

Key components

  • wslc.exe: CLI for managing containers, images, volumes, and networks (build, run, stop, inspect, push/pull from registries)
  • wslcsession.exe: Per-user Windows service hosting container lifecycle, storage management, and networking
  • WSLC SDK: C++ and C# client libraries with NuGet packaging for programmatic container management
  • Container networking: port forwarding, DNS tunneling, virtio networking, and HCN integration
  • Storage: VHD-backed volumes, virtiofs file sharing, overlayfs layers
  • GPU passthrough and device host proxy support

Stats

  • 384 files changed, 73,620 insertions, 2,751 deletions
  • Squash merge of feature/wsl-for-apps (665 commits)

WSLC is a container runtime built on the Windows Subsystem for Linux,
enabling Windows applications to create and manage Linux containers
through a native Windows API surface.

Key components:
- wslc.exe: CLI for managing containers, images, volumes, and networks
  (build, run, stop, inspect, push/pull from registries)
- wslcsession.exe: Per-user Windows service hosting container lifecycle,
  storage management, and networking
- WSLC SDK: C++ and C# client libraries with NuGet packaging for
  programmatic container management
- Container networking: port forwarding, DNS tunneling, virtio
  networking, and HCN integration
- Storage: VHD-backed volumes, virtiofs file sharing, overlayfs layers
- GPU passthrough and device host proxy support

Co-authored-by: 1wizkid <richard.fricks@hotmail.com>
Co-authored-by: AmirMS <104940545+AmelBawa-msft@users.noreply.github.com>
Co-authored-by: beena352 <beenachauhan@microsoft.com>
Co-authored-by: Ben Hillis <benhillis@gmail.com>
Co-authored-by: Blue <OneBlue@users.noreply.github.com>
Co-authored-by: Craig Loewen <crloewen@microsoft.com>
Co-authored-by: Darshak Bhatti <47045043+dabhattimsft@users.noreply.github.com>
Co-authored-by: David Bennett <dbenne@microsoft.com>
Co-authored-by: Feng Wang <wang6922@outlook.com>
Co-authored-by: Flor Chacon <14323496+florelis@users.noreply.github.com>
Co-authored-by: John Stephens <johnstep@microsoft.com>
Co-authored-by: JohnMcPMS <johnmcp@microsoft.com>
Co-authored-by: Kevin Vega <40717198+kvega005@users.noreply.github.com>
Co-authored-by: Pooja Trivedi <poojatrivedi@gmail.com>
Co-authored-by: ramesh-ramn <raman.ramesh@gmail.com>
Co-authored-by: Richard Fricks <richfr@microsoft.com>
Co-authored-by: yao-msft <50888816+yao-msft@users.noreply.github.com>
@benhillis benhillis requested a review from a team as a code owner April 30, 2026 16:46
Copilot AI review requested due to automatic review settings April 30, 2026 16:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@benhillis benhillis requested a review from Copilot April 30, 2026 16:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Comment thread src/linux/init/main.cpp
// Create a tmpfs mount for the cross-distro shared mount.
//

if (UtilMount(nullptr, CROSS_DISTRO_SHARE_PATH, "tmpfs", 0, nullptr) < 0)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Context for other reviewers, this was added in 2db1652

dnsResolver->ResolveExternalInterfaceConstraintIndex();
}
CATCH_LOG()
// Copyright (C) Microsoft Corporation. All rights reserved.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we changed the line endings in this file somehow ?

@@ -29,6 +29,7 @@ wil::unique_socket Connect(
_In_ const GUID& VmId,
_In_ unsigned long Port,
_In_opt_ HANDLE ExitHandle = nullptr,
ULONG Timeout = 30000, // TODO: Fix
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can leave this as is. I'm planning to do a major hvsocket IO refactor once this is merged

std::string_view beginView(m_buffer.data() + m_offset, m_buffer.size() - m_offset);
std::string_view endView(m_buffer.data(), m_offset);
return {beginView, endView};
/*++
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like another line ending change


// Copyright (C) Microsoft Corporation. All rights reserved.

#pragma once
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another line ending change

@@ -1048,4 +1089,95 @@ class InstallerTests
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nullptr, nullptr);
VerifyWslSettingsProtocolAssociationExistsWithRetry();
}

/*
TODO: Uncomment when the functionality is implemented in the SDK.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want to remove this. This was for the old install API, which doesn't exist anymore

@benhillis
Copy link
Copy Markdown
Member Author

@OneBlue - agreed on the comments, I will address as a follow-up change on master. Thanks for taking a look!

@benhillis benhillis merged commit 358ab87 into master Apr 30, 2026
10 checks passed
@benhillis benhillis deleted the merge/wslc-to-master branch April 30, 2026 20:34
benhillis added a commit that referenced this pull request Apr 30, 2026
…PI test (#40369)

- Restore original CRLF line endings in DnsResolver.cpp, RingBuffer.cpp,
  and WslCoreHostDnsInfo.h that were inadvertently changed to LF
- Remove commented-out WSLCInstall/WSLCInstallManual test methods that
  referenced the old install API which no longer exists

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants