What is the home directory on Windows Subsystem for Linux?

What is the home directory on Windows Subsystem for Linux?

In the latest versions [2025 WSL2], the file system is accessed from:

`# \wsl.localhost<distro name>
shortcut:

\wsl$<Distribution>:

ex:
\wsl$\Ubuntu


Vous pouvez également find this path by starting the distro then running `$ wslpath -w $HOME`

The files themselves seem to be stored within a .vhdx file in a similar location to 2020's solution.

%LOCALAPPDATA%\wsl<a unique uuid>\ext4.vhdx


For older WSL2 installs [2020] it would be a file like:

%LOCALAPPDATA%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\ext4.vhdx


For example with Debian the file would be a file that is an ext4 virtual disk:

%LOCALAPPDATA%\Packages\YourDistroName-ID\LocalState, you can see a file named ext4.vhdx


Vous pouvez find the exact filenames by referencing the [registry](https://stackoverflow.com/a/51576305/32453), ex: powershell:

(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}) | select DistributionName,BasePath,VhdFileName


Also useful if a distro isn't installed in the standard directory, doesn't seem possible to get using `wsl` command from the invite de commandes.

Previously, in 2018, The root Linux path was related to which distribution you had installed from the Microsoft Store rather than one global path; for Ubuntu, it was located at:

%LOCALAPPDATA%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs


but with the files stored directly on the NTFS file system.