3

I am searching for the user's files in kali linux so I can transfer them to my windows machine. I have also spent an hour at least combing through my AppData folder in windows 10 but with no luck. If anyone has any idea where I could access the virtual kali file system, I would greatly appreciate it!

I have checked this path so far: C:\Users\USER_NAME\AppData\Local but with no luck. I have tried putting a unique file that only exists on kali and searching my entire machine for it but that does not work.

Is this a wsl2 problem?

EDIT:

This is what I found in my WindowsApps folder:

enter image description here

And inside each of those I find: enter image description here

In C:\Users*YOURUSERHERE*\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState I find this(the only file that has kali linux in it):

enter image description here and inside I find this:

enter image description here with nothing in most of the folders.

Another update:

enter image description here

gets me:

enter image description here

10
  • 1
    They should be within the appropriate folder within WindowsApps within Program Files
    – Ramhound
    Commented Feb 12, 2021 at 0:08
  • 1
    Do you mean the OS files or the files you're creating within your Kali home directory?
    – Layne B
    Commented Feb 12, 2021 at 0:40
  • 1
    I installed Win-Kex from this long document (kali.org/docs/wsl/win-kex/#install-kali-linux-in-wsl2) and all the steps therein. There are no files per se yet but the folder c:\users\me..\AppData\Local\Microsoft\WindowsApps and there is data there. Similar it appears to your edited post. Now recall Kali in WSL is just for Linux command (as I understand WSL) . I also have a full fledged Kali machine Hyper-V with all the functionality.
    – anon
    Commented Feb 12, 2021 at 0:49
  • 1
    The user filesystem (for WSL Ubuntu, at least) is stored in a virtual hard drive (.vhdx) file under %LOCALAPPDATA%\Packages\ . In my case, with Ubuntu, it's C:\Users\*YOURUSERHERE*\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState. Windows 10 has built in tools to mount this type of virtual drive, so you can just right-click it and click "mount". Make sure WSL isn't running when you mount it or it will fail. %LOCALAPPDATA% is your C:\Users\*YOURUSERHERE*\AppData\Local folder, but you can paste that directly into the file manager path and it will work.
    – Layne B
    Commented Feb 12, 2021 at 0:54
  • 1
    What happens when you run WSL from the Windows Start button? You should get a dialogue box, and I clicked on Open (because Kali is the only WSL system I have) and Kali opened. Prompt is [/mnt/c/WINDOWS/system32] . DIR in the Kali system just shows me EXE , DLL and like files for running the Linux commands it can.
    – anon
    Commented Feb 12, 2021 at 1:12

1 Answer 1

4

The filesystems for WSL2 instances are stored in .vhdx files in the package directory (look in LocalState for ext4.vhdx). Those are virtual disks, so that's why you don't see the individual files that you placed in the filesystem when you search in Windows.

However, WSL2 does provide an easy way to get at the ext4 filesystem from within Windows. Go to \\wsl$\ and you should find a directory named after your distribution (probably \\wsl$\kali-linux if using the defaults). Inside there you should find your entire kali filesystem, and the files you are looking for.

14
  • 1
    Retracted previous statement, \\wsl$\ works for me too with Ubuntu when WSL is not running.
    – Layne B
    Commented Feb 12, 2021 at 1:26
  • 2
    @Layne-Bernado The WSL instance does need to be started (see wsl -l -v) in order for it to appear. But you can exit the shell and it will still be there until you terminate it (wsl --terminate <distroname>) or shutdown the subsystem (wsl --shutdown). Commented Feb 12, 2021 at 1:29
  • 1
    Ah that explains it. @Cyclist No worries I'm just being dumb. Yeah you should be able to copy files directly, I don't think you can move them like that though.
    – Layne B
    Commented Feb 12, 2021 at 1:33
  • 1
    It's not quite as easy as dragging-and-dropping. Check out this answer for details on how to do it. The answer uses Ubuntu as the example, but I've done the same thing with Kali. Commented Feb 12, 2021 at 1:38
  • 1
    @NotTheDr01ds Will this work? I am only asking because it's a little more simple of an answer... stackoverflow.com/questions/57580420/…
    – love2phish
    Commented Feb 12, 2021 at 2:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .