-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Implement Create Container #13758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/wsl-for-apps
Are you sure you want to change the base?
Implement Create Container #13758
Conversation
There was a problem hiding this 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 |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
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.
| "--host=net", // TODO: default for now, change later | |
| "--network=host", // Use correct nerdctl option for host networking |
1220fbe to
3d5fa8b
Compare
Co-authored-by: Copilot <[email protected]>
…oft/WSL into user/ptrivedi/create-cont
| return wil::MakeOrThrow<WSLAContainer>(&parentVM, launcher.Launch(parentVM)); | ||
| } | ||
|
|
||
| std::vector<std::string> WSLAContainer::prepareNerdctlRunCommand(const WSLA_CONTAINER_OPTIONS& options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
| 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"; |
There was a problem hiding this comment.
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
| const std::string nerdctlPath = "/usr/bin/nerdctl"; | |
| constexpr std::string_view c_nerdctlPath = "/usr/bin/nerdctl"sv; |
There was a problem hiding this comment.
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
No description provided.