Boot a Virtual iPhone via Apple's Virtualization.framework
Booting a Virtual iPhone via Apple's Virtualization.framework
This project, known as vphone-cli, enables the execution of a virtualized iPhone environment by leveraging Apple's Virtualization.framework and the PCC research VM infrastructure.
🛠 Prerequisites
To successfully run this environment, your host machine must meet the following criteria:
- Hardware: Apple Silicon (M-series).
- OS: macOS 15+ (Sequoia).
- Tooling: Xcode and the iOS SDK (required for cross-compiling the guest daemon).
- Security: Relaxation of SIP (System Integrity Protection) and AMFI (Apple Mobile File Integrity) to permit private
PV=3entitlements for unsigned binaries.
Required Dependencies
Install the following via Homebrew:
brew install python@3.13 aria2 wget gnu-tar openssl@3 ldid-procursus sshpass keystone cmake libusb ipsw zstd
🚀 Installation
Option 1: Rapid Install
The fastest way to get started is via the tap:
brew install zqxwce/tap/vphone-cli
Option 2: Manual Build
If you prefer building from source, follow these steps:
- Clone the repository with submodules:
git clone --recurse-submodules https://github.com/Lakr233/vphone-cli.git - Initialize the environment:
./scripts/setup_tools.sh(Installs dependencies, builds toolchains, and sets up the Python venv) - Compile the project:
./scripts/build.sh(Builds/signs the CLI, bundles the .app, and cross-compiles vphoned)
To verify the installation:
cd .build/vphone-cli.app/Contents/MacOS/
vphone-cli --help
📱 Quick Start & Workflow
You can deploy a VM in a single step, which handles everything from downloading the firmware to the initial boot.
The "One-Shot" Command:
vphone-cli vm create myphone -V jb vphone-cli vm launch myphone
(Note: -V or --variant specifies the patch level)
The VM Lifecycle Pipeline
The vm create command is essentially a wrapper for the following sequence:
Manual Pipeline Automated Pipeline (via vm create)
⌨️ Command Reference
VM Management
| Command | Description |
|---|---|
vphone-cli vm list | Displays all VMs (use --json for scripts) |
vphone-cli vm info <name> | Detailed status of a specific VM |
vphone-cli vm new <name> | Initializes an empty bundle (configurable CPU/RAM/Disk) |
vphone-cli vm config <name> --cpu 8 --memory 8192 | Adjusts hardware resources |
vphone-cli vm clone <src> <dest> | Fast APFS clone with a unique device identity |
vphone-cli vm export <name> --out <file> | Exports to .tzst (default) or .txz (via --max) |
vphone-cli vm import <file> --name <name> | Restores a VM from an archive |
vphone-cli vm rename <old> <new> | Changes the VM identifier |
vphone-cli vm delete <name> | Removes the VM |
Manual Build Steps
If you need granular control, execute these in order:
vphone-cli vm new myphonevphone-cli fw prepare myphone --iphone-version 26.1(Downloads/merges IPSWs)vphone-cli fw patch myphone --variant jb(Patches for boot)vphone-cli restore myphone --get-shshvphone-cli restore myphone(DFU restore)vphone-cli vm stop myphone(Exit DFU mode)vphone-cli cfw install myphone --variant jb(Installs Custom Firmware via sudo)vphone-cli vm launch myphone
Pro Tip: To update iOS, run
fw prepareagain and point to specific files using--iphone-source /path/to.ipswand--cloudos-source /path/to.ipsw.
🛠 Firmware Variants
The --variant flag determines the level of security bypasses applied.
| Variant | Patches | Phases | Capabilities |
|---|---|---|---|
less | 4 | 2 | Minimal patches; iOS mitigations remain active |
regular | 42 | 10 | Bypasses AMFI, SSV, Img4, and TXM |
dev | 53 | 12 | regular + TXM debug/entitlement bypass |
jb | 113 | 14 | Full Jailbreak; auto-installs Sileo and TrollStore |
exp | 141 | 18 | jb + anti-VM detection research patches |
Detailed breakdowns are available in research/0_binary_patch_comparison.md.
🔌 Connectivity & Access
Once the VM is running, you can connect via the following methods:
- SSH (Jailbroken):
ssh -p 22222 mobile@<vm-ip>(Password:alpine) - SSH (Dev/Regular):
ssh -p 22222 root@<vm-ip> - VNC:
vnc://<vm-ip>:5901
📂 File System & Storage
All data is stored in ~/.vphone/ to keep the signed .app bundle portable.
Path Hierarchy:
$VPHONE_ROOT(Default:~/.vphone/): The primary data directory..../ipsws/: Cached iPhone and cloudOS firmware..../tools/: APFS seal-volume artifacts (apfs_sealvolume_)..../debs/: Cached packages forjb/expvariants (e.g.,apt)..../venv/: The Python runtime environment (Override via$VPHONE_VENV_DIR).
Priority Logic:
🔐 SIP/AMFI Relaxation
You must choose one of two paths to allow the binary to run:
Option A: Maximum Permissiveness
- Boot into Recovery Terminal.
- Run:
csrutil disableandcsrutil allow-research-guests enable. - Reboot and set the AMFI boot-arg:
sudo nvram boot-args="amfi_get_out_of_my_way=1 -v"
Option B: Targeted Relaxation
- Boot into Recovery Terminal.
- Run:
csrutil enable --without debugandcsrutil allow-research-guests enable. - Reboot and run the allowlist tool:
vphone-amfidont(Found in.build/vphone-cli.app/Contents/Resources/)
🧪 Compatibility Matrix
| Host Mac | iPhone Version | CloudOS Version | Result |
|---|---|---|---|
| Mac16,11 | 27.0b2 | 17,3_18.6.2_22G100 | 26.1-23B85 |
| Mac16,8 | 26.5.1 | 17,3_26.0_23A341 | 26.1-23B85 |
| Mac16,8 | 26.5.1 | 17,3_26.0.1_23A355 | 26.1-23B85 |
| Mac16,12 | 26.3 | 17,3_26.1_23B85 | 26.1-23B85 |
| Mac16,12 | 26.3 | 17,3_26.3_23D127 | 26.1-23B85 |
| Mac16,12 | 26.3 | 17,3_26.3_23D127 | 26.3-23D128 |
| Mac16,12 | 26.3 | 17,3_26.3.1_23D8133 | 26.3-23D128 |
| Mac16,11 | 26.2 | 17,3_26.4_23E246 | 26.4-2 |