Windows

Where Are WSL Config Files Stored?

Windows .wslconfig and wsl.conf plus distro VHDX disk paths.

Last updated

WSL splits config between a global .wslconfig in your Windows profile and per-distro wsl.conf files inside Linux, with virtual disks stored as VHDX files under app packages. Memory and disk tuning live on the Windows side.

Back up .wslconfig before memory-limit experiments since one bad byte-unit stalls every distro. Export distros with wsl --export before disk moves.

Where Windows stores this, by platform

Windows
%USERPROFILE%\.wslconfig

Global CPU, memory and networking settings for WSL2. Per-distro behavior lives in /etc/wsl.conf inside each install. Distro disks sit as ext4.vhdx under AppData\Local\Packages per distro. Edit with line endings intact.

Frequently asked questions

How do I limit WSL memory?

Set memory in .wslconfig above with units like 8GB, then wsl --shutdown. Per-distro tweaks go in wsl.conf inside Linux.

Where are WSL distro disks?

As VHDX files under Packages paths beside the config above. Move them with wsl --export and --import, never raw drags.

Notice an outdated path? Let us know.