microsoft / microsoft/WSL

WSL.Container API for existing containers and sessions

Open
#40,990 11 comments 0 reactions 1 assignee View on GitHub

@craigloewen-msft is already working on this.

Since Jul 7, 2026.

feature wslc
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

**Is your feature request related to a problem? Please describe.**
While testing the new SDK the program crashed.
Next time it failed to create the container because one with that name already existed.
Right now it does not appear that there is a way to manage already existing containers.

**Describe the solution you'd like**

```C#
public class Session
{
public static void TerminateSession(string name);
public IReadOnlyList GetContainers();
public Container? OpenContainer(string name); //Open existing container
}

class SessionSettings
{
public bool OpenExisting { get; set; }
public bool ReplaceExisting { get; set; }
}

class ContainerSettings
{
public bool ReplaceIfExist { get; set; }
}
```

**Describe alternatives you've considered**

```bash
wslc.exe --session MySession system session terminate
wslc.exe --session MySession container list --format json --all
wslc.exe --session MySession stop MyContainerName
wslc.exe --session MySession rm MyContainerName
```

**Additional context**
Add any other context or screenshots about the feature request here.

NuGet: Microsoft.WSL.Containers 2.9.3
wslc 2.9.3.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.