IOS Emulation: Difference between revisions
→Starting restore: Add steps for companion VM |
|||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
Following guide describes how to setup iOS emulation using the project [https://github.com/ChefKissInc/QEMUAppleSilicon QEMU-AppleSilicon]. Currently emulation iPhone 11 with iOS 14.0 beta 5 is supported. | |||
== Setup == | == Setup == | ||
{{Security Warning|Do not share any IVs, keys or files, such as pre-made modified or unmodified images or decrypted, patched, modified or unmodified firmware, etc. That all surely violates Apple's EULA. EULA violations or any of the aforementioned actions may be a crime in your jurisdiction.}}{{Warning|Most parts of this guide are not yet supported by the latest stable NixOS release. It should be available with the next 25.11 release.}} | {{Security Warning|Do not share any IVs, keys or files, such as pre-made modified or unmodified images or decrypted, patched, modified or unmodified firmware, etc. That all surely violates Apple's EULA. EULA violations or any of the aforementioned actions may be a crime in your jurisdiction.}}{{Warning|Most parts of this guide are not yet supported by the latest stable NixOS release. It should be available with the next 25.11 release.}} | ||
| Line 36: | Line 38: | ||
==== Starting restore ==== | ==== Starting restore ==== | ||
Prepare and run the companion VM, required for the restore process | Prepare and run the companion VM, required for the restore process. Create the file <code>configuration.nix</code><syntaxhighlight lang="nix"> | ||
{ config, pkgs, ... }: | |||
{ | |||
imports = [ <nixpkgs/nixos/modules/virtualisation/qemu-vm.nix> ]; | |||
boot.loader.grub.device = "/dev/vda"; | |||
fileSystems."/" = { | |||
device = "/dev/vda1"; | |||
fsType = "ext4"; | |||
}; | |||
networking.hostName = "nixos-companionvm"; | |||
services.openssh.enable = true; | |||
users.users.root.initialPassword = "root"; | |||
environment.systemPackages = [ pkgs.idevicerestore ]; | |||
documentation.enable = false; | |||
} | |||
</syntaxhighlight>Build the VM image<syntaxhighlight lang="bash"> | |||
qemu-system-x86_64 -m 2024 -nic user -hda | nix-build '<nixpkgs/nixos>' -A config.system.build.qcow2Image -I nixos-config=./configuration.nix | ||
</syntaxhighlight>Run the companion VM<syntaxhighlight lang="bash"> | |||
qemu-system-x86_64 -m 2024 -nic user -hda ./result/nixos.qcow2 -nographic -usb -device usb-ehci,id=ehci -device usb-tcp-remote,conn-type=ipv4,conn-addr=127.0.0.1,conn-port=8030,bus=ehci.0 -nic user,model=virtio-net-pci,hostfwd=tcp::32222-:22 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
The companion VM must always be started before the emulated iPhone otherwise no USB connection is established. | Some parts in this documentation is missing, so please consult [https://github.com/ChefKissInc/QEMUAppleSilicon/wiki/Running-&-Restoring upstream documentation].The companion VM must always be started before the emulated iPhone otherwise no USB connection is established. | ||
Now run the iOS emulator on your host<syntaxhighlight lang="bash"> | Now run the iOS emulator on your host<syntaxhighlight lang="bash"> | ||
| Line 84: | Line 108: | ||
-display gtk,zoom-to-fit=on,show-cursor=on | -display gtk,zoom-to-fit=on,show-cursor=on | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Virtualization]] | |||