Search code examples
ubuntuwindows-subsystem-for-linux

Difference between wsl.localhost and wsl:Ubuntu


Image showing the problem

I installed wsl2 and vscode in my computer. I am trying to run some code thats in the folder "home/raunakk/MSc_project". But when I try to open the folder on vs code, it shows me two folders.

I donot understand the difference between wsl.localhost and wsl:Ubuntu as shown in the picture. Can I delete/uninstall one of them? It is confusing because my code seems to run when I am in wsl:Ubuntu and not from wsl.localhost. I am new to wsl, thank you for any help.


Solution

  • They are the same WSL directory.

    When you use wsl.localhost, you are accessing that directoy from Windows.

    When you use wsl:Ubuntu, you are using VSCode WSL extension, so accessing that directory directly from WSL.