Skip to content

Conversation

@ptrivedi
Copy link

No description provided.

@ptrivedi ptrivedi requested a review from a team as a code owner November 21, 2025 19:33
@ptrivedi ptrivedi changed the base branch from master to feature/wsl-for-apps November 21, 2025 19:34
@ptrivedi ptrivedi requested a review from a team as a code owner November 21, 2025 19:34
@ptrivedi ptrivedi marked this pull request as draft November 21, 2025 19:34
Copilot finished reviewing on behalf of ptrivedi November 21, 2025 19:35
Copy link
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.

Pull request overview

This PR implements the "Create Container" functionality for WSLA (Windows Subsystem for Linux for Apps), adding comprehensive infrastructure for container management, virtual machine control, and process execution. The implementation introduces a new service (wslaservice), client library (wslaclient), and extensive test coverage.

Key Changes:

  • New WSLA service architecture with COM interfaces for session, VM, and container management
  • Container creation support via nerdctl integration
  • Client API for querying and installing WSL components
  • Comprehensive test suite with 1100+ lines covering VM, process, networking, and container scenarios

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/windows/wslaservice/inc/wslaservice.idl Defines COM interfaces for WSLA service including IWSLASession, IWSLAContainer, IWSLAProcess, and IWSLAVirtualMachine
src/windows/wslaservice/exe/WSLAVirtualMachine.cpp Implements VM lifecycle management, process creation, networking, and disk operations
src/windows/wslaservice/exe/WSLAContainer.cpp Implements container creation using nerdctl with GPU, volume, and port mapping support
src/windows/wslaservice/exe/WSLASession.cpp Implements session management coordinating VM and container operations
src/windows/wslaclient/DllMain.cpp Client library implementation for component installation and version checking
test/windows/WSLATests.cpp Comprehensive test suite covering VM boot, processes, networking, mounts, and GPU features
tools/FormatSource.ps1.in Fixes PowerShell script to handle missing $PSScriptRoot and correct file filtering
test/windows/Common.h Refactors RegistryKeyChange to defer key opening for improved resource management

// Constants for required default arguments for "nerdctl run..."
static std::vector<std::string> defaultNerdctlRunArgs{
"--pull=never",
"--host=net", // TODO: default for now, change later
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

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

The networking option appears to be incorrect. '--host=net' is not a valid nerdctl option. The correct option should be '--net=host' or '--network=host' for host networking mode.

Suggested change
"--host=net", // TODO: default for now, change later
"--network=host", // Use correct nerdctl option for host networking

Copilot uses AI. Check for mistakes.
@ptrivedi ptrivedi force-pushed the user/ptrivedi/create-cont branch from 1220fbe to 3d5fa8b Compare November 21, 2025 21:24
return wil::MakeOrThrow<WSLAContainer>(&parentVM, launcher.Launch(parentVM));
}

std::vector<std::string> WSLAContainer::prepareNerdctlRunCommand(const WSLA_CONTAINER_OPTIONS& options)

Choose a reason for hiding this comment

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

nit:

Suggested change
std::vector<std::string> WSLAContainer::prepareNerdctlRunCommand(const WSLA_CONTAINER_OPTIONS& options)
std::vector<std::string> WSLAContainer::PrepareNerdctlRunCommand(const WSLA_CONTAINER_OPTIONS& options)


using wsl::windows::service::wsla::WSLAContainer;

const std::string nerdctlPath = "/usr/bin/nerdctl";

Choose a reason for hiding this comment

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

nit: and similar for below

Suggested change
const std::string nerdctlPath = "/usr/bin/nerdctl";
constexpr std::string_view c_nerdctlPath = "/usr/bin/nerdctl"sv;

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ended up using a constexpr const char*, since that makes it easier to add to the command line vectors

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.

4 participants