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.
The command to set the default Linux user is different in different versions of Windows.
For versions of WSL up to the Fall Creators Update, run the following command in an elevated Windows command prompt:
lxrun /setdefaultuser root
For installations after the Fall Creators Update, the command is:
<distro> config --default-user root
Substitute the distro's exe name for <distro>
in the command above. So, if you're running Ubuntu, the command would be:
ubuntu config --default-user root
For openSUSE...
opensuse-42 config --default-user root
And, for SUSE Linux Enterprise Server, the command is...
sles-12 config --default-user root
Again, all of these commands are performed from an elevated Windows command prompt.
Note:
The examples above are for the root
user. You may specify any other existing username in place of root
.
Best Answer
It's also possible to do with just a batch file:
Now just use Open with... (and remember to check Always use this app to open .sh files) to associate the sh files with this batch file.
EDIT: included
--login
argument for bash.exe to set all the appropriate linux specific environment variables (such as$PATH
)