Skip to content

adds containerd-shim-lcow-v2 shim - #2627

Merged
Harsh Rawat (rawahars) merged 6 commits into
microsoft:mainfrom
rawahars:lcow-shim-draft
Mar 19, 2026
Merged

adds containerd-shim-lcow-v2 shim#2627
Harsh Rawat (rawahars) merged 6 commits into
microsoft:mainfrom
rawahars:lcow-shim-draft

Conversation

@rawahars

@rawaharsHarsh Rawat (rawahars) commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

Summary

This pull request introduces a new implementation of the containerd-shim-lcow-v2 for Windows, used for running Linux Containers on Windows.

The changes cover the main entrypoint, shim manager logic, plugin registration, shared service implementation, and a manifest for proper Windows compatibility. The uber changes are-

  • The main entrypoint and supporting logic to start + serve the shim server.
  • The stubs for Task Service and Shimdiag service.
  • The implementation for Sandbox service.
  • The implementation for VM Controller which manages the VM lifecycle and operations.

This shim follows the upstream pattern of using containerd/pkg/shim for managing it's lifecycle. It uses plugin mechanism for registering service with containerd and is initialized during startup.

This PR is dependent upon PR #2612 and PR #2616

@rawahars
Harsh Rawat (rawahars) requested a review from a team as a code ownerMarch 10, 2026 11:31
Comment threadcmd/containerd-shim-lcow-v1/service/plugin/plugin.go Outdated
Comment threadcmd/containerd-shim-lcow-v2/service/service.go
Comment threadcmd/containerd-shim-lcow-v1/service/service.go Outdated
Comment threadcmd/containerd-shim-lcow-v1/service/service_sandbox.go Outdated
Comment threadcmd/containerd-shim-lcow-v1/service/service_sandbox.go Outdated
Comment threadinternal/controller/vm/status.go Outdated
Comment threadinternal/controller/vm/vm.go Outdated
Comment threadinternal/controller/vm/vm.go Outdated
Comment threadinternal/controller/vm/vm.go
Comment threadinternal/controller/vm/vm.go Outdated
In this commit, we are adding the initial draft of `containerd-shim-lcow-v1`. This shim is used for running Linux Containers on Windows.
As part of this commit, we are adding the following-
- The main entrypoint and supporting logic to start + serve the shim server.
- The stubs for Task Service and Shimdiag service.
- The implementation for `Sandbox` service.
- The implementation for `VM Controller` which manages the VM lifecycle and operations.
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
@rawahars
Harsh Rawat (rawahars)force-pushed the lcow-shim-draft branch 5 times, most recently from 6777136 to 1bb1938CompareMarch 15, 2026 11:31
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
Comment threadcmd/containerd-shim-lcow-v2/service/service.go
Comment threadcmd/containerd-shim-lcow-v2/service/service_shimdiag_internal.go Outdated
Comment threadinternal/builder/vm/lcow/specs.go
Comment threadinternal/controller/vm/vm.go Outdated
Comment threadinternal/controller/vm/vm.go Outdated
Comment threadinternal/logfields/fields.go
Comment threadinternal/logfields/fields.go Outdated
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review of the critical items — each comment is a question for clarification.

Comment threadinternal/controller/vm/vm.go
Comment threadinternal/controller/vm/vm_wcow.go
Comment threadinternal/controller/vm/vm_wcow.go
Comment threadinternal/controller/vm/vm.go
Comment threadinternal/controller/vm/vm.go
Comment threadcmd/containerd-shim-lcow-v2/manager.go
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nits

Comment threadinternal/vm/vmutils/constants.go Outdated

const (
// LCOWShimName is the name of the LCOW shim implementation.
LCOWShimName = "containerd-shim-lcow-v2"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you move this to cmd/containerd-shim-lcow-v2? this should be the app name for the shim, and there shouldn't be a need for any code outside of the shim binary code to use/access it

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Relocated the constant to the service package. Since main can import service but not vice versa without creating circular dependencies, this move ensures the name is available to both.

Comment threadcmd/containerd-shim-lcow-v2/service/service_sandbox_internal.go Outdated
Comment threadcmd/containerd-shim-lcow-v2/service/service_sandbox.go Outdated
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
Comment threadcmd/containerd-shim-lcow-v2/service/plugin/plugin.go

const (
// etwProviderName is the ETW provider name for lcow shim.
etwProviderName = "Microsoft.Virtualization.RunHCSLCOW"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if we should leave the provider name alone so we just need 1 log stream registered

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Changed the name of provider to Microsoft.Virtualization.containerd-shim-lcow-v2

@rawaharsHarsh Rawat (rawahars) changed the title adds containerd-shim-lcow-v1 shimadds containerd-shim-lcow-v2 shimMar 17, 2026
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm


const (
// etwProviderName is the ETW provider name for lcow shim.
etwProviderName = "Microsoft.Virtualization.containerd-shim-lcow-v2"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
etwProviderName="Microsoft.Virtualization.containerd-shim-lcow-v2"
etwProviderName="Microsoft.Virtualization"+ShimName

@rawahars
Harsh Rawat (rawahars) merged commit c70fd9f into microsoft:mainMar 19, 2026
17 checks passed
@rawahars
Harsh Rawat (rawahars) deleted the lcow-shim-draft branch March 19, 2026 21:05
Sign up for freeto 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.

4 participants

@rawahars@jterry75@shreyanshjain7174@helsaawy