3

I have a dual boot set up with two separate hard drives: one for Windows and one for Linux. I also use WSL for light development work. I want to know if it is possible for me to access the WSL files from the Linux hard drive. Ordinarily, I could mount the C drive to navigate the Windows file system, but I don't know how to also (?) mount the WSL image.

geoffrey
  • 83
  • 6

2 Answers2

1

Take a look at this blog. I think it will tell you how to do.

TL;DR

  1. (PWSH) wmic diskdrive list brief to get disk info
  2. (PWSH admin) wsl --mount <hard device> --partition <part id> to mount your ext4(default) FS
  3. you can access it in your WSL
Hugh Liu
  • 11
  • 1
0

You can find WSL file in this path: C:\Users\YourAccount\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs so maybe if you mount this path then you should have access to the WSL files.

  • Not for me; I have a Debian 10 WSL2 instance. – Michael Harvey Sep 10 '20 at 17:30
  • Did you tired find here C:\Users\YourAccount\AppData\Local\Packages ? I think it should be in this path. In my last comment I put path to the Ubuntu instance. – MajkelTheITGuy Sep 10 '20 at 19:43
  • Isn't that just for WSL version 1? – Michael Harvey Sep 10 '20 at 20:09
  • Okay so I'm look deeper about path and found this: 1. Run the distribution 2. Press Win+R 3. Type \\wsl$ which opens File Explorer 4. Double click on the distribution folder. This should work. I checked on WSL v1 and after running my Ubuntu it's shows me folder with Ubuntu 18.04 – MajkelTheITGuy Sep 11 '20 at 09:18