Install ubuntu on wsl(windows subsystem for linux)

To get a list of Linux distributions available to install in wsl

You can view all distributions that WSL supports by running the following command:

wsl --list --online


This command queries Windows for every distribution currently published and available for installation.

The following is a list of valid distributions that can be installed as of July-2026
Install using 'wsl.exe --install <Distro>', if you want it to be installed in custom location read below





How to Install a WSL Distribution with a Custom Name and Custom Location

By default, when you install a Linux distribution using Windows Subsystem for Linux (WSL), Windows stores the distro in its standard app‑package directory under your user profile. This works fine for most users, but developers often need more control — for example:

  • keeping work and personal environments separate

  • placing distros on a faster SSD

  • storing distros on a larger secondary drive

  • organizing multiple environments in a predictable folder structure

WSL provides two optional arguments to help with this:

  • --name — lets you assign a custom, human‑friendly name

  • --location — lets you choose where the distro’s virtual disk (ext4.vhdx) will be stored

What --location Means (Generic Explanation)

The --location argument tells WSL to install the distribution’s filesystem into any folder you choose, instead of the default %LOCALAPPDATA%\Packages\…\LocalState.

You can point it to any empty folder on any drive, such as:

  • D:\WSL\UbuntuDev

  • E:\Linux\ProdBox

  • C:\VM\WSL\MyDistro

WSL will place the distro’s ext4.vhdx file inside that folder.

Generic Command Format

wsl --install --distribution <Distro-Identifier> --name <Your-Custom-Name> --location <Drive:\Path\folder>

Examples 

wsl --install --distribution Ubuntu-26.04 --name ubnt-26-prod --location D:\VM\wsl\ubnt-26-prod
wsl --install --distribution Ubuntu-26.04 --name ubnt-26-dev --location D:\VM\wsl\ubnt-26-dev
wsl --install --distribution Ubuntu-26.04 --name ubnt-26-rel --location D:\VM\wsl\ubnt-26-rel

Requirements for --location

  • The folder must already exist

  • The folder must be empty

  • The path must be a local drive (USB, SSD, HDD all fine)

  • WSL will create the distro’s virtual disk inside that folder


Once installed, if you have only one linux installe,d you can just type wsl and it will enter to the linux



Checking what all linux is running
wsl --list --running -v

wsl setting

Type "wsl settings" in search





Comments

Popular posts from this blog

How to launch a specific WSL distro when you have multiple installed