-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
virtualization_test fails at second step -- irecovery -f iBSS.vma2.RELEASE.patched.img4 #2
Comments
Something I forgot to mention above: I had to patch your |
Hello! I used iRecovery built from the latest (back then) source code. Also I built it against IOKit, and not libusb It was a long time ago since the last time I played with this, but if I remember correctly, AVPBooter fails to boot the next stage when one uses APTicket supplied within an IPSW instead of the one provided via TSS Speaking of the macOS 13+ issues - yea, as far as I know they made some previously private API non-private, so it will fail to compile |
Thanks for the quick response! I'll try building For my tests on macOS 12 I used an My tests on other versions of macOS used appropriately different copies of all these test files. I went to some trouble to find all these files, including for the ramdisk. If I can get everything working, I'll write a detailed gist and post a link to it here. |
I've been using the Ghidra disassembler, with an extension for it that adds support for iBoot files. |
This problem is very deep -- possibly deeper than I'll be able to penetrate. It turns out the Homebrew I got the clever idea of using Apple Configurator to try to "recover" the VM run by I'll keep playing with this, but I don't know how far I'll get. I'm going to try to rewrite For whoever's interested, you can also get relevant log messages by running the following command in Terminal before you start doing things in DFU mode.
I don't know how you were able to get |
The next stage after iBootStage2 is kernel, that doesn’t really log anything unless booted with special boot-args The possible cause of failure to restore is that you probably didn’t provide a main storage file to it, thus there was nowhere to restore root filesystem and stuff
Also if you’re restoring, then you should try to do it via And I’m not sure I understand what your final goal is. If you can share this, maybe I can help you more efficiently |
I've now progressed considerably beyond my last comment, but I still haven't discovered anything useful to me. I found all the files I need in one place -- a Once I got your original steps working, I tried them with my macOS 12.0.1 VM booted into DFU mode. Once again things stopped part way through. But after 30 seconds or so the VM booted normally, with no effect from what had happened in DFU mode. There wasn't even any trace of it in the VM's system logs (what you see running I told you above what my end goal is -- to find a workaround for Apple's refusal to support third party kernel extensions in its macOS guest VMs (those that use the Virtualization framework). Yes, that's pretty vague. And I'm not sure it's even possible. But your work with DFU mode is the best lead I have. The other approaches I tried (messing with files in the VM or in the IPSW directly) didn't work out. I'm slowly working through the changes made by your patches (beside the one you documented). I don't yet fully understand them, but I've made some interesting discoveries. For example I found out that your kernelcache patch changes the I'll be even happier if my work on your stuff helps me accomplish my original goal. But that's a long shot. |
One thing I forgot to mention above: Before testing with my macOS 12.0.1 VM in DFU mode, I followed instructions in this document to allow me to copy a patched And another: I dug through Apple's XNU kernel source code to decipher your special boot args. This showed me that they're needed to enable "serial" output past iBoot Stage2, and to tell the kernel about the ramdisk device ( Edit: Actually the |
Your |
You might like to know that I've finally figured out my original problem -- how to load third-party kernel extensions on Virtualization framework macOS VMs. I said nice things about your Virtual-iBoot-Fun project, but I found a different way to patch |
This is fantastic. Thank you for all your work |
You're most welcome. I'm glad you found it useful. |
The first step (
virtualization_test -r AVPBooter.vmapple2.patched.bin
) works fine, and afterwards I'm able to get plausible results fromirecovery -q
. But the second step (recovery -f iBSS.vma2.RELEASE.patched.img4
) seems to hang something inside the VM (irecovery -q
now fails after a timeout), and I need to CTRL-C to stopvirtualization_test
.I get the same results on macOS 12.6.7, 13.4.1 and 14 Beta 2. My guess is that there's something wrong with the
irecovery
that I'm using, or maybe with thelibusb
that it's using. My copy of it comes from Homebrew (brew install libirecovery
), and ultimately fromlibimobiledevice
. Mylibusb
also comes from Homebrew. Both seem quite up to date.So which
irecovery
did you use in your tests? And if possible please let me know the version oflibusb
that it used.I'm going to be spending a lot of time debugging this problem. But I'd appreciate any information you can give me (if possible in addition to what I've already asked for). Also let me know if you think I'm on the right trail.
Ultimately I'm hoping to use Apple's Virtualization framework's
forceDFU
setting to hack their VMs enough to work around this design flaw. I've patched UTM to supportforceDFU
on macOS 12 and up, and it seems to work very much like yourvirtualizaton_test
.irecovery -q
returns plausible results. And it even gets into the same "hang" whenever I try to useirecovery -f
on it.The text was updated successfully, but these errors were encountered: