Celeb Glow
updates | February 26, 2026

Change of WSL installation location

I am trying to install the Windows Subsystem for Linux in my PC (Windows 10). I opened a "Command Prompt" window by running it as administrator and ran wsl --install without changing the initial default folder C:\Windows\system32. Thus, WSL is installed in this location by default.

Later, I uninstalled WSL by going to Settings -> Apps & Features -> Windows Subsystem for Linux Update -> Uninstall.

Then, I downloaded and installed WSL Update in C:\users\myaccount. However, when I run WSL from the start menu, it still goes to C:\Windows\system32.

Is there a way to move this default location of WSL installation to C:\users\myaccount. Besides, I have noticed that WSL is still in C:\Windows\system32 folder after I uninstall WSL from Settings -> Apps & Features.

3

1 Answer

It's important to understand that there are multiple components involved in a WSL installation, and whether you can "move" or change their installation location differs for each of those components:

  1. The wsl.exe command, which is what you mainly appear to be asking about, is built-in to Windows in recent releases. You didn't (and can't) actually install or uninstall the actual wsl.exe through any of the Windows Features or Apps & Features settings. It is present when you install Windows.

  2. The base Windows Subsystem for Linux ("lxss", to some degree), which is also built into Windows as a "Windows Feature". As a Windows Feature, it can be enabled or disabled, but not, to my knowledge, uninstalled. As you can see in my post here, this takes up very little disk space.

  3. The WSL2 Virtual Machine Platform, which is also a Windows feature.

Like all other Windows features, no, you can't change the location where the files live. Most will be under System32. The fact that you were in that directory when you enabled the feature has nothing to do with it.

I can't recall which of the files in the C:\Windows\System32\lxss directory are there when Windows is installed.

The other components, which are not built-in to Windows, are:

  1. The WSL2 Linux kernel. This is actually what was removed when you uninstalled the "Windows Subsystem for Linux Update". I agree that it is confusingly named.

    This official kernel is also installed in a subdirectory with the other WSL binaries, in C:\Windows\System32\lxss\tools. While you can't change the folder where this kernel is installed, you can move it to another directory if you'd like and create a file in your Windows (not Linux) user profile directory named .wslconfig with the following contents:

    [wsl32]
    kernel="C:\path\to\kernel"

    You can also compile additional kernels and place them whereever you like, pointing to the one you want to launch in the .wslconfig.

  2. One or more WSL distributions.

    When you install a distribution using wsl --install -d <distro> or from the Microsoft Store, it is installed by default in %USERPROFILE%\AppData\Local\Packages\<PackageName>. These can be "moved" by exporting them and re-importing them.

    From PowerShell:

    mkdir D:\WSL\images # For example
    mkdir D:\WSL\instances\<newDistroName>
    cd D:\WSL
    wsl -l -v # Verify distro name to export
    wsl --export <distroname> .\images\<distroname>.tar
    wsl --import <newDistroName> .\instances\<newDistroName> .\images\<distroname>.tar
    wsl --set-default <newDistroName>

    You'll also need to set the default username in that copied instance via the /etc/wsl.conf file as discussed in this answer.

    It might also be possible to forcibly move the distribution files from your AppData folder to another location and then update the registry corresponding registry location (HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss). However, I have not tested this, nor seen anyone else try it. If you want to give it a shot, make sure you have a backup via wsl --export above.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy