I would like to access the filesystem of my Android mobile device in Windows-Subsystem-For-Linux:
I executed the command mount
, but I only see /mnt/c
and /mnt/g
.
Is there a way to get access to file on my mobile device.
I would like to access the filesystem of my Android mobile device in Windows-Subsystem-For-Linux:
I executed the command mount
, but I only see /mnt/c
and /mnt/g
.
Is there a way to get access to file on my mobile device.
I was able to get this working using the new USB/IP feature in WSL, along with jmtpfs
.
See the official Microsoft docs for WSL2 USB/IP support.
First, whether you are running Windows 10 or Windows 11, wsl --update
to the latest kernel (or App Store release with kernel) which has USB/IP support.
After that, however, the exact steps will depend on:
As with most things, directions for Ubuntu are standard. See my post on Debian for the changes needed for that distro.
The instructions from Microsoft and the usbipd-win project both assume that you are using your default WSL distribution. If you have more than one distribution, and need to access it in a non-default one, you can still manually run usbip
from within WSL2.
jmtpfs
Once you've shared your phone from Windows to WSL over USB/IP and can see it with lsusb
, then you should be able to mount it using jmtpfs
:
sudo apt install jmtpfs
sudo mkdir /media/android
sudo jmtpfs -o allow_other /media/android/
Refer to the jmtpfs readme for more info.
It seems that after unmounting, the USB/IP connection is "lost" or damaged, so I had to detach
and attach
the device again on the Windows side before I could try anything else with it.