microsoft / microsoft/WSL

Suggestion: To use `--name <InstanceName>` as the folder name for new instances

Open
#13,530 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

**Current behavior**

To create a WSL 2 instance with a specific name and folder location, I must use both `--name` and `--location`.

Example command:

```powershell
wsl --install Ubuntu-24.04 --name Ubuntu-24.04 --location D:\WSL\Ubuntu-24.04
```

If `.wslconfig` specifies a default installation path via `distributionInstallPath`:

```ini
[general]
distributionInstallPath=D:\\WSL
```

Then running:

```
wsl --install Ubuntu-24.04 --name Ubuntu-24.04
```

creates the instance in a GUID-based folder, e.g.:

```powershell
D:\WSL\{d7c75f51-5ebb-4d83-bafe-95e5a8333e9d}
```

**Problem**

The folder name does not reflect the instance name. This makes it harder to manage instances and requires always specifying `--location` explicitly.

**Proposed improvement**

Automatically use the value of `--name ` as the folder name when `distributionInstallPath` is defined in `.wslconfig`.

Example result:

```powershell
D:\WSL\Ubuntu-24.04
```

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.

Research direction

Start with the `wsl --install` handling and the `.wslconfig` `distributionInstallPath` setting described in the issue. Trace how the instance name and default installation path are combined, then verify that a named instance uses a matching folder under the configured path without an explicit `--location`.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.