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.
Asked
Active
Viewed 1,743 times
3
-
2Without more information, this is a bad idea. ***PERHAPS if it were mounted READ ONLY***. WSL controls metadata for files virtualized under root and not mnt. Editing them WILL result in corruption. @michal.fied (below) gives you the path.. but don't EDIT anything in it. – Señor CMasMas Sep 09 '20 at 16:04
-
is it wsl 1 or 2? – Michael Harvey Sep 09 '20 at 17:55
-
@SenorCMasMas I actually corrupted the file when trying to mount it with `guestmount` in read only, so I think you are correct. – geoffrey Sep 10 '20 at 17:25
-
@MichaelHarvey wsl 2 – geoffrey Sep 10 '20 at 17:26
-
Try `\\wsl$` but beware as has been said. – Michael Harvey Sep 10 '20 at 17:34
2 Answers
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.
-
-
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
-
-
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