This question answers how to access Windows files from Ubuntu Bash, but how can I do the opposite?
Specifically, I need to access my SSH key from Windows which is located at
/home/mark/.ssh/id_rsa under Bash.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
PM for Windows Command-Line here:
Updated October 2019: Updating the response below to reflect the newly added ability to directly access distros' Linux files via the newly integrated P9 server in Win10 1903 (and later).
IMPORTANT: Spelunking through the Windows filesystem to access Linux files has and will continue to be unsupported and STRONGLY recommended against! To understand why, please read this post
So how does one access Linux files using Windows tools (e.g. notepad, VS/VScode, etc.)? Previously, you couldn't, but starting in Windows 10 1903 we (finally!) expose your distros' filesystems to Windows via a P9 fileserver. We've also published an in-depth video discussing how this works! You can also read a summary of this new feature in this blog post
Look forward to hearing how you get on with this feature. If you find any problems, please file issues on the WSL GitHub repo here: https://github.com/Microsoft/wsl.
The location was actually moved in the latest release to :
See this GitHub issue from Microsoft/WSL #2578
As mentionned in the Issue above and the comments below, don't mess with these files from the windows os.
As has been mentioned above by [onoma] files in WSL directories have attributes that would be gone if one manipulates it using explorer or text editor run under Windows system. The solution could be to start ssh-server in WSL (there might be a reinstall necessary) listening on localhost and then mounting WSL filesystem as a drive using, for example, win-sshfs or you can just use Bitvise SSH client to connect over ssh and manipulate files by sftp window. The topic has been partially discussed here: How can I SSH into “Bash on Ubuntu on Windows 10”?
subst L: $env:LOCALAPPDATA\lxss (for powershell)
subst L: %LocalAppData%\lxss (from
This puts your Linux-subsystem filesystem-root
/ on your L: drive.
You could also map just your home directory, or just whack
%LocalAppData%\lxss in an explorer window. Just don't try browsing L:\mnt\c or your brain might explode.
I finally made a way to open explorer (and vscode) with actual correct folder context from inside WSL: https://github.com/andymule/wslwin
For example, after you install this, in linux (WSL) you would just
cd /home/mark/.ssh/ and type
explorer, and it would open windows explorer at that location, whatever it is.
EDIT: this feature is being officially supported in WSL now, and you should no longer use my scripts