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:
[wsl2]
defaultVhdSize=10GB
Example command:
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:
wsl --install Ubuntu-24.04 --fixed-vhd
It might also be a good idea to make a setting in .wslconfig, for example:
[wsl2]
defaultVhdType=fixed | dynamic
This would allow creating new instances with the desired disk type and size using just:
wsl --install Ubuntu-24.04