[HN Gopher] Virtualizing iOS on Apple Silicon
___________________________________________________________________
Virtualizing iOS on Apple Silicon
Author : walterbell
Score : 162 points
Date : 2024-10-06 10:44 UTC (1 days ago)
(HTM) web link (nickb.website)
(TXT) w3m dump (nickb.website)
| heavyset_go wrote:
| Slightly tangential, but has anyone virtualized ARM macOS on
| x86-64?
| 3abiton wrote:
| You should look into the hackintosh project.
| aspenmayer wrote:
| https://dortania.github.io/OpenCore-Legacy-Patcher/
| fl0id wrote:
| But that's not arm on x86 is it? My understanding was that
| it 'just' enables things to work on unsupported intel macs,
| by enabling stuff that still works on newer Intel Macs.
| aspenmayer wrote:
| It's complicated, but you have the right intuition about
| it. OCLP re-inserts drivers removed by Apple and patches
| the OS to enable functionality that doesn't rely on
| hardware verification or ARM hardware. According to the
| devs, that's about all they are currently able to do with
| current approaches.
|
| UTM might do what you want but likely not on x86.
|
| https://mac.getutm.app/
|
| > Virtualize macOS as well.
|
| > Run multiple instances of macOS on your Apple Silicon
| Mac with UTM. This can be useful for developers as well
| as security conscious users.
|
| > Note that macOS VM support is limited to ARM based Macs
| running macOS Monterey or higher.
| amarshall wrote:
| Hackintosh currently has no way of running ARM-based macOS,
| so it is of no help here.
| aliher1911 wrote:
| You can try to virtualize generic ARM in qemu and see that it
| won't reach Raspberry Pi performance. Recent versions should
| have it available out of the box afaik. Virtualizing Mn cpus
| would be even less useful.
| grishka wrote:
| You can't. The term "virtualize" is generally used to mean
| running an OS via hardware virtualization, where your host CPU
| natively runs its code but forwards all I/O to a hypervisor.
| You can only do that with an OS built for the same CPU
| architecture as your host system.
|
| For everything else, like running ARM software on x86 (and vice
| versa), you'll have to resort to emulation, which involves
| either interpreting the code or dynamically recompiling it. By
| definition, you can emulate anything on anything else (someone
| recently booted Linux for MIPS on an Intel 4004, the first ever
| microprocessor), but the performance might be a problem.
| amarshall wrote:
| TL;DR: emulating _any_ ARM binaries on x86_64 via QEMU is so
| slow that it is unusable for any general use.
|
| This is also less of a QEMU problem and more just that ARM
| does not emulate well on x86_64 due to their designs.
| ChrisMarshallNY wrote:
| Very cool!
|
| I have a feeling that the reason that Apple hasn't made their
| Simulator into an Emulator, is because they don't want folks
| digging into the substrate of iOS.
| astrange wrote:
| Developers still use Intel Macs, and you can't virtualize ARM
| iOS on that.
| ChrisMarshallNY wrote:
| Yeah, I was thinking about the ARM Macs. They are common
| enough, now, to make it worthwhile.
| ChocolateGod wrote:
| Another reason it was a Simulator and not an Emulator to begin
| with could be because a lot of iOS (or iPhone OS) components at
| the time were forks of existing Mac OS X libraries.
| kridsdale1 wrote:
| The reason to begin with was the Mac OS was x86-32 and the
| iOS environment was arm. Building for intel let the ui devs
| have high performance by leveraging the existing network
| stack and graphics compositor. But most of the libraries live
| parallel in the sim, not using the OS ones. That wouldn't
| allow you to simulate different iOS versions.
| cedws wrote:
| According to the author's GitHub profile they are a fresh CS grad
| - seriously impressive work.
| valval wrote:
| I bet this one never used ChatGPT to cheat at homework then!
| MYEUHD wrote:
| Apple already provides an iOS simulator in XCode. So, what's the
| benefit of this project over the apple-provided one?
| ykl wrote:
| The simulator is not actually running real iOS or the iOS build
| of your app. Instead, when you run an app in the simulator,
| your app is being compiled to the current Mac's native
| instruction set and links/runs against a set of Mac frameworks
| and libraries that _simulate_ and in some cases only stub in
| the expected iOS behavior. So as an example, you can't just
| take an iOS binary off of the App Store and run it in the iOS
| Simulator (especially not on an Intel Mac). You also can't use
| the simulator to probe and learn anything about how real iOS
| works internally, because the simulator isn't really running
| full iOS. If you drill down in the simulator's frameworks far
| enough you eventually just find yourself back in macOS.
|
| Contrast with an emulator, where you are just running the full
| iOS build identical to the build on a real device. You would in
| theory be able to run any iOS binary unmodified and probe how
| the real os works.
|
| It's sort of like the difference between running an app through
| Wine versus running an app in a Windows VM, except in the case
| of the simulator it'd be like if you had to custom
| recompile/link a Windows app first against the Wine environment
| before being able to run it. If you wanted to study how Windows
| works internally, there's not much you can learn about that
| from running Wine, but there is quite a lot you could learn
| from probing a VM running Windows.
| gorkish wrote:
| This is great; for your next trick, can you please figure out how
| to install MacOS on an iPad so that we can all finally get the
| dang computer we want Apple to build?
| makeitdouble wrote:
| You can start with Windows XP
|
| https://www.theverge.com/2024/7/22/24200536/windows-xp-ipad-...
| walterbell wrote:
| _> It took two and a half hours for my iPad to crawl through
| installation._
|
| Jailbroken Apple M1 iPads with iOS16 can use the iOS
| hypervisor to run VMs without overheating their devices or
| waiting hours to boot.
|
| Still, we can thank Apple for small mercies like UTM, ashell
| and iSH.
|
| As a science experiment, Apple could silently launch a "VM
| store" with $100 VMs, accessible only via hidden URL. How
| badly do Apple customers want to use the iPad hardware they
| already purchased? Could Apple customers be extorted into
| paying for VMs? Will anyone ever ship a competitive tablet
| running Linux?
| tambourine_man wrote:
| Without JIT, it's more a prof-of-concept than a useful tool,
| IMO.
| worstspotgain wrote:
| If they called it a Macbook Air with an upside-down bulge and a
| detachable keyboard, would that be just as well?
| walterbell wrote:
| _> Corellium and their virtual iPhone cloud product (only
| publicly-available "complete" solution)_
|
| Corellium won their legal case, allowing them to rent [1] iOS
| Cloud VMs for security research,
| https://hn.algolia.com/?query=corellium
|
| If iOS can be virtualized on Apple Silicon Macbooks, it could
| reduce demand for commercial iOS virtualization services.
| Individuals: $400/month Business: $60,000/year
|
| [1] https://support.corellium.com/subscriptions/pricing
| jamesy0ung wrote:
| Discussion of this is on the nick's funny device emporium Discord
| server. https://discord.com/invite/4HXCHWhf6r
___________________________________________________________________
(page generated 2024-10-07 23:00 UTC)