microsoft / microsoft/WSL

Suggestion: Use `defaultVhdSize` and add `defaultVhdType` to `.wslconfig`

Open
#13,529 3 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

I would like to propose changing the logic of WSL 2 commands and adding a VHD disk type setting.

To create a WSL 2 instance with a fixed disk size, the size must always be specified with `--vhd-size`, even if `.wslconfig` already contains a `defaultVhdSize` setting:

```ini
[wsl2]
defaultVhdSize=10GB
```

Example command:

```powershell
wsl --install Ubuntu-24.04 --vhd-size 10GB --fixed-vhd
```

The logical thing to do would be to use the `defaultVhdSize` setting from `.wslconfig` and simplify the command to:

```powershell
wsl --install Ubuntu-24.04 --fixed-vhd
```

It might also be a good idea to make a setting in `.wslconfig`, for example:

```ini
[wsl2]
defaultVhdType=fixed | dynamic
```

This would allow creating new instances with the desired disk type and size using just:

```powershell
wsl --install Ubuntu-24.04
```

Contributor guide

Open the contributing guide

Research direction

The request concerns `.wslconfig` and the `wsl --install` path; start by tracing how `defaultVhdSize`, `--vhd-size`, and `--fixed-vhd` are currently handled. Define the precedence between command-line and configuration settings, then assess the proposed `defaultVhdType` behavior. Done means the documented install commands create new instances with the intended VHD size and type.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.