Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save twome/d3e260e9981260134c91d8164fd8c030 to your computer and use it in GitHub Desktop.
Save twome/d3e260e9981260134c91d8164fd8c030 to your computer and use it in GitHub Desktop.
How to remove Windows paths from WSL `path` environment variable

[Requires WSL Build 17093 or above]

You can override WSL's settings by editing /etc/wsl.conf in the WSL filesystem. (Normally, this file doesn't exist at first.)

$ sudo vi /etc/wsl.conf

[interop]
appendWindowsPath = false

For the new WSL settings to take effect, you should shut down and then restart WSL - from Windows:

c:\Users\you> wsl --shutdown

Now check your path inside WSL:

$ echo $PATH

See also:

Default wsl.conf settings:

[automount]
enabled = true
mountFsTab = true
root = "/mnt/"
options =

[network]
generateHosts = true
generateResolvConf = true

[interop]
enabled = true
appendWindowsPath = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment