Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save aont/4205ab39ff080b0601b45e1593018962 to your computer and use it in GitHub Desktop.

Select an option

Save aont/4205ab39ff080b0601b45e1593018962 to your computer and use it in GitHub Desktop.

Accessing iPhone File System on Windows via WSL2 Using usbipd and ifuse

Accessing iOS Files on WSL2 Alpine Linux Using ifuse

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:

  1. Add edge/testing repository to /etc/apk/repositories.
  2. Run apk update to refresh package indexes.
  3. Install ifuse: apk add ifuse.
  4. Start the USB multiplexing daemon: usbmuxd -f -v.
  5. On Windows, attach the iPhone device to WSL2 using usbipd, e.g., usbipd attach --wsl --busid 2-3 -w <distroname> -o <host ipaddress>.
  6. Trust the computer when prompted on the iPhone.
  7. Verify connection with ifuse --list-apps.
  8. Mount the iPhone filesystem to a directory, e.g., ifuse /iPhone.

Accessing iPhone File System on Windows via WSL2 Using usbipd and ifuse

This guide explains how to access an iPhone's file system from Windows using WSL2 with the help of usbipd and ifuse.


1. List USB Devices on Windows

Open a PowerShell or Command Prompt window and run:

usbipd list

Example 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.

2. Bind the iPhone USB Device

Run PowerShell or Command Prompt as Administrator and execute:

usbipd bind --force --busid 2-3

Replace 2-3 with the actual BUSID of your iPhone device from the previous step.


3. Reboot Your PC

Restart your Windows machine to apply the changes.


4. Start WSL2 and Attach the USB Device

Confirm that bind have taken effect.

usbipd list

Example 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.


5. Verify USB Device in WSL2

Inside WSL2, run:

lsusb

You should see the iPhone listed, for example:

Bus 001 Device 002: ID 05ac:12a8 Apple, Inc. iPhone

6. Access iPhone Apps Using ifuse

List installed apps on the iPhone:

ifuse --list-apps

Sample output:

com.google.chrome.ios, "131.0.6778.73", "Chrome"
...

7. Mount the Documents Directory of an App

Create a mount point:

mkdir ./iPhone

Mount the documents directory of the desired app (e.g., Chrome):

ifuse -d --documents com.google.chrome.ios ./iPhone

8. Access Mounted Files from Windows

From 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment