3

I'm very confused with the whole WSL situation. Sometimes I feel like I get it but in reality, I don't. My main confusion is where does Ubuntu (I use Ubuntu 20.04) save files? And how do they intertwine with files I install with Windows Command Line? All installations I have done via Ubuntu have been a waste of time, I can't find packages or libraries I install for any programming language. If someone knows of a course or video that could help me understand, I would appreciate it if you share it as well.

The specific situation of this question is caused because I installed a package for C with Ubuntu (the cs50 one) but I can't get VS Code to recognize it. I tried adding /usr/local path to the c_cpp_properties.json but it doesn't find this path.

VS Code message

I go to this folder in the explorer and I don't find anything, as expected.

Windows Explorer

Thanks in advance.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
byVerbel
  • 31
  • 1
  • 5

4 Answers4

6

The file ext4.vhdx is the complete filesystem for the Linux subsystem. However, you can't (or shouldn't) access it directly from Windows 10.

Instead (within the Linux subsystem) you can access your C: drive through mount point /mnt/c (E.g. ls -l /mnt/c/Users ), and that way copy files between the two file systems.

If you want to user Windows explorer (again within the Linux subsystem), use following command:

/mnt/c/Windows/explorer.exe .

Just found out. You can access the files directly from Windows 10. E.g:

dir \\wsl$\Ubuntu-20.04\home
  • Thanks, now I know what is that .vhdx files, but I can't access the files I download with Ubuntu, nor in the Linux Subsystem, nor by using the mount point. I guess my question is how can I access those files to use the package? Or how can I install that package in a folder I can access? – byVerbel Feb 02 '21 at 02:04
1

I faced the same problem. I was trying to reach rootfs but couldn't and as you have shown, I was reaching a dead end at "ext4.vhdx". After looking at articles, I found the home directory is found within the Linux subsystem, and to reach there you can use the following path to Linux and go to Linux > Ubuntu > home > user/admin and you'll be in your home directory.

  • This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://stackoverflow.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://stackoverflow.com/help/whats-reputation), you can also [add a bounty](https://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/31239429) – beeselmane Mar 13 '22 at 07:56
1

You can directly type \\\\wsl$ in the directory path and then you can see the below image to access the file directory of ubuntu.

File Directory

Then, You can navigate here to see all the files as same as rootfs.`

\Ubuntu-22.04\home\user-name

`

-1

I had the same issue and this is how I figured it out: first, open PowerShell and type: wsl -d Ubuntu then, go to your file explorer and type: \\wsl$ this will open the Ubuntu folder and you can access all your files