Check current PATH variable You may see paths from your Windows setup such as “/mnt/c/Program Files/…..” WSL utilizes the file /etc/wsl.conf to configure its setup. Add the following settings to the file to ignore Windows path variable. For effect restart the WSL instance Or
Tag: path
Windows default environment variables
Powershell display current variables ls env: User Path Variables %APPDATA% C:\Users\{username}\AppData\Roaming %HOMEPATH% C:\Users\{username} %LOCALAPPDATA% C:\Users\{username}\AppData\Local %TEMP% C:\Users\{username}\AppData\Local\Temp %TMP% C:\Users\{username}\AppData\Local\Temp %USERNAME% {username} %USERPROFILE% C:\Users\{username} %OneDrive% C:\Users\{username}\OneDrive Program Path Variables %ALLUSERSPROFILE% C:\ProgramData %COMMONPROGRAMFILES% C:\Program Files\Common Files %COMMONPROGRAMFILES(x86)% C:\Program Files (x86)\Common Files %CommonProgramW6432% C:\Program Files\Common Files %PROGRAMDATA% C:\ProgramData %PROGRAMFILES% C:\Program Files %ProgramW6432% C:\Program Files %PROGRAMFILES(X86)% C:\Program Files (x86)
Remove Windows Paths from WSL Ubuntu Path
Edit or create the file /etc/wsl.conf and add the lines below [interop]appendWindowsPath = false May need to restart WSL from Powershell to work wslconfig /l to get distribution name wslconfig /t [distribution name] Restart WSL Microsoft docs: https://devblogs.microsoft.com/commandline/automatically-configuring-wsl/ https://learn.microsoft.com/en-us/windows/wsl/wsl-config