I'm not sure if I'm misunderstanding your question, but your ubuntu bash (top right window) should have access to your Windows-based disks under /mnt
. For example, on my machine /mnt/c/Users/Scott/Desktop
is my Windows desktop and I can read/write files there from vi for ex. I don't believe the opposite is true just yet. That is, I don't think you can explore into your bash world from Windows explorer.
What I've been doing as a developer is to host projects on my d: and point the linux-based tools to that /mnt/d/projects/someproject/
folder.
Make sure you update your Windows builds periodically as they seem to be fixing a lot of issues with each build, especially around sym-links and crossing FS boundaries between Linux/Windows.
Microsoft has recently added comprehensive support for this, and it should be generally available in the April 2019 (19H1) update. Once it's ready, a 9P server will run in the background whenever a Linux distro is running. The 9P server will be able to handle Linux filesystem metadata, and Windows will be able to treat it as a network drive so it can access it safely. You can read about it at https://blogs.msdn.microsoft.com/commandline/2019/02/15/whats-new-for-wsl-in-windows-10-version-1903/.
With the new feature, you'll be able to safely access both Windows and Linux filesystem files from Windows, as long as you go through the 9P server. This will be handled natively from within WSL. For example, from the WSL command line you'll be able to type code /mnt/c/Users/username/src/windows-file.txt
to open a Windows file in VS Code, or type code /home/username/src/linux-file.txt
to open a Linux file in VS Code.
If you're not part of the Windows Insider Program, you won't have access to this yet so you'll still have to use an older method, such as wslpath.
wslpath will convert between Windows- and Linux-style paths so you can easily open Windows files from the WSL command line. As per https://github.com/Microsoft/WSL/issues/3146#issuecomment-388118689, it will refuse to convert Linux filesystem paths (i.e. %AppData%\lxss), because without 9P it's unsafe to modify these files from Windows. This means you can't open /home/username/src/linux-file.txt
, but you can use code "$(wslpath -aw /mnt/c/Users/username/src/windows-file.txt)"
.
In the past, there were a number of third-party tools to perform the same conversion but wslpath does it natively-- in fact, ls -l /bin/wslpath
shows that it's just a link to /init.
Best Answer
"Bash on Ubuntu on Windows" is based on Windows Subsystem for Linux. WSL is an implementation of Linux system calls on the Windows' NT kernel, which allows you to run Linux executables unmodified (like Wine does for Ubuntu). "Bash on Ubuntu on Windows" is just one application of WSL. Other Linux distros like openSUSE or Fedora are either available or will soon be available.
There are "exe"s for WSL. Originally there used to
bash.exe
, then camewsl.exe
, and now there'subuntu.exe
andopenSUSE-42.exe
. Presumablyfedora.exe
will appear soon. From the MSDN post Manage multiple Linux Distributions in WSL:Where the files for WSL are will depend on the distro, now that they are apps installed from the store: