-1

I have been learning coding and slight amounts of hacking by dual-booting windows and Kali Linux (Don't worry this is not about any of those oses). The only problem was that I had to reboot in Kali Linux to boot into Windows and vice versa. Later, I learned that I could use something called W.S.L where I could run Linux bash with Windows. I got happy and I installed the Ubuntu terminal. The problem is, that ubuntu says there is a folder before the Partitions called MNT and there are multiple folders like that. It says my windows downloads folder is in MNT/c/Users/<insert name here>/Downloads. Now, I cannot access my ubuntu download folder from windows, so I want to change the downloads folder of ubuntu to one of the windows. I could typically use ubuntu tweaks, but I cannot use any ubuntu applications (or at least I don't know how to). What should I do?

1 Answers1

1

This may not (or may) answer your question, but it sounds like you have several areas of confusion that we need to clarify to at least help you understand how to solve this.

The problem is, that ubuntu says there is a folder before the Partitions called MNT and there are multiple folders like that.

The /mnt folder is a standard folder on Linux (Ubuntu, Kali, and pretty much every distribution there is). It's one of the core folders of the Filesystem Hierarchy Specification (FHS). As the FHS says, it is:

[a] mount point for a temporarily mounted filesystem

When WSL starts, WSL automatically mounts your Windows drive letters (yes, they are partitions, but Windows users usually refer to them as "drives") under /mnt (by default, although you can change it). So yes, your C:\ drive in Windows will be accessible in WSL/Ubuntu through /mnt/c.

You definitely have a Windows download folder at the path you mentioned. That is also a standard Windows folder that is created for each user profile. It's typically used by web browsers in Windows, although any application that downloads files will typically default to this directory.

Now, I cannot access its download folder from Windows

You should be able to access that folder in both Windows and WSL/Ubuntu:

  • Under Windows, it will be C:\Users\<Windows_username>\Downloads.
  • And as we covered above (and you mention in your question), it will be accessible from Ubuntu/WSL as /mnt/c/Users/<Windows_username>/Downloads.

It's also possible for Linux applications in Ubuntu to create a downloads folder inside Ubuntu, although it doesn't sound like that's what you are asking about. That folder is typically ~/Downloads (a.k.a. /home/<Ubuntu_username>/Downloads).

WSL makes Ubuntu folders available to Windows as well. It does this under:

  • \\wsl$\<distroname>\ in Windows 10 (and this path will also work in Windows 11)
  • \\wsl.localhost\<distroname> (by default) in Windows 11

The distribution name can be found by running:

wsl.exe -l -v

So if your distribution name is "Ubuntu" (the default for many installations), then from Windows File Explorer:

\\wsl$\Ubuntu\home\<Ubuntu_username>\

If you have a downloads folder in Ubuntu, then it will be accessible from Windows/File Explorer at:

\\wsl$\Ubuntu\home\<Ubuntu_username>\Downloads

If you have Ubuntu applications that default to ~/Downloads and you want to change that without access to Ubuntu Tweak, then this answer mentions that you can update the default from the command-line via:

xdg-user-dirs-update --set DOWNLOAD /absolute/path/to/new/download/folder

The xdg-user-dirs-update doc points out that this creates a configuration file at (by default ~/.config/user-dirs.dirs.

Note that this will only work for applications that read that config setting.

NotTheDr01ds
  • 17,888
  • Thanks! This worked. But is there a way to change the other folders like Desktop, Videos, Images, etc? Should I just replace the folder type in 'xdg-user-dirs-update --set DOWNLOAD /absolute/path/to/new/download/folder' from downloads to what I want? – SamanwayK2077 Jun 16 '22 at 04:59
  • @SamanwayK2077 Pretty much. man xdg-user-dirs-update will give you the list of valid options. – NotTheDr01ds Jun 16 '22 at 13:13