The Computer Oracle

How to access linux/Ubuntu files from Windows 10 WSL?

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Ocean Floor

--

Chapters
00:00 How To Access Linux/Ubuntu Files From Windows 10 Wsl?
00:25 Accepted Answer Score 100
01:44 Answer 2 Score 88
02:15 Answer 3 Score 81
02:45 Answer 4 Score 11
03:13 Answer 5 Score 8
03:33 Thank you

--

Full question
https://superuser.com/questions/1110974/...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#windows10 #windows10v1607 #windowssubsystemforlinux

#avk47



ACCEPTED ANSWER

Score 100


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

enter image description here

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.




ANSWER 2

Score 88


The location was actually moved in the latest release to :

C:\Users\%USERNAME%\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\

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.

https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/




ANSWER 3

Score 81


\\wsl$\Ubuntu\home\user\whatever 

In the explorer or the Run widget (Cmd+R). Works like a normal network share and it's safe to manipulate files.

You can also map it to a drive or folder, just as any other network share.

Note: This is a new feature implemented in Windows 10 build 18342




ANSWER 4

Score 11


Yes but is not recommended to manipulate that folder from the windows explorer. If you want to copy, move, edit or erase files from the lxss folder you need to do it inside bash with command line tools. Only files that are on /mnt/* are really manipulable from the windows explorer.




ANSWER 5

Score 8


Found it by searching my entire C drive. Files are here:

C:\Users\<username>\AppData\Local\lxss

e.g., my SSH key is here:

C:\Users\Mark\AppData\Local\lxss\home\mark\.ssh\id_rsa