- alpine version: the image is slim
- Ubuntu version: might be more stable?
-
-
Save aont/4205ab39ff080b0601b45e1593018962 to your computer and use it in GitHub Desktop.
Purpose: To enable file system access to an iPhone connected via USB on WSL2 running Alpine Linux by using the ifuse tool.
Method: This process involves adding the appropriate package repository, installing ifuse, running the USB multiplexing daemon, attaching the iPhone device from Windows to WSL2, and mounting the iPhone filesystem within Alpine.
Steps:
- Add
edge/testingrepository to/etc/apk/repositories. - Run
apk updateto refresh package indexes. - Install ifuse:
apk add ifuse. - Start the USB multiplexing daemon:
usbmuxd -f -v. - On Windows, attach the iPhone device to WSL2 using usbipd, e.g.,
usbipd attach --wsl --busid 2-3 -w <distroname> -o <host ipaddress>. - Trust the computer when prompted on the iPhone.
- Verify connection with
ifuse --list-apps. - Mount the iPhone filesystem to a directory, e.g.,
ifuse /iPhone.
This guide explains how to access an iPhone's file system from Windows using WSL2 with the help of usbipd and ifuse.
Open a PowerShell or Command Prompt window and run:
usbipd listExample output:
Connected:
BUSID VID:PID DEVICE STATE
2-3 05ac:12a8 Apple Mobile Device USB Composite Device Not shared
Persisted:
GUID DEVICE
usbipd: warning: Unknown USB filter 'CsDeviceControl' may be incompatible with this software; 'bind --force' may be required.
Run PowerShell or Command Prompt as Administrator and execute:
usbipd bind --force --busid 2-3Replace 2-3 with the actual BUSID of your iPhone device from the previous step.
Restart your Windows machine to apply the changes.
Confirm that bind have taken effect.
usbipd listExample output:
Connected:
BUSID VID:PID DEVICE STATE
2-3 05ac:12a8 Apple Mobile Device USB Composite Device Attached
Persisted:
GUID DEVICE
usbipd: warning: Unknown USB filter 'CsDeviceControl' may be incompatible with this software; 'bind --force' may be required.
Start your WSL2 distribution. Then, from Windows, attach the device to WSL2:
usbipd attach --wsl --busid 2-3 -w <distro_name> -o <host ipaddress>Replace <distro_name> <host ipaddress> with your WSL2 distribution name and host IP address respectively.
Note: If you have other network interfaces such as ppp0, attach fails somehow without -o.
Inside WSL2, run:
lsusbYou should see the iPhone listed, for example:
Bus 001 Device 002: ID 05ac:12a8 Apple, Inc. iPhone
List installed apps on the iPhone:
ifuse --list-appsSample output:
com.google.chrome.ios, "131.0.6778.73", "Chrome"
...
Create a mount point:
mkdir ./iPhoneMount the documents directory of the desired app (e.g., Chrome):
ifuse -d --documents com.google.chrome.ios ./iPhoneFrom Windows Explorer or any file manager, access the mounted directory using the WSL path:
\\wsl.localhost\<distro_name>\path\to\iPhone
Replace <distro_name> and the path accordingly.