Skip to content

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

@greengorych

Description

@greengorych

Current behavior

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

Example command:

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

If .wslconfig specifies a default installation path via distributionInstallPath:

[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.:

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 <InstanceName> as the folder name when distributionInstallPath is defined in .wslconfig.

Example result:

D:\WSL\Ubuntu-24.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions