Skip to content
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

Recovery #4

Closed
wants to merge 2 commits into from
Closed

Recovery #4

wants to merge 2 commits into from

Conversation

agraf
Copy link

@agraf agraf commented May 17, 2022

Virtualization.Framework has a few private APIs that can come handy when debugging issues: A PL011 emulator so you can get iBoot & kernel debug output and forcing parameters to get the VM to boot in RecoveryOS or DFU mode.

This PR adds support for all 3 of them: The PL011 configuration can be stored permanently as part of the vm config. Recovery and DFU are only command line switches, because they will only be useful during manual recovery.

Alexander Graf added 2 commits May 17, 2022 11:54
MacOS VMs emit their debug log to a PL011 serial port, not the
virtio-console one that we spawn with --serial. This is important if you
want to see kernel debug output. Let's add an option to turn on the pl011
console as well. For now, it can only be attached to stdin/stdout.

Signed-off-by: Alexander Graf <graf@amazon.com>
When running macOS VMs, there are a few hidden options one can pass.
The most important ones are --recovery to force the VM into RecoveryOS
and --dfu to force it into DFU mode for recovery using Apple Configurator.

This patch adds both options as parameters when launching a VM.

Signed-off-by: Alexander Graf <graf@amazon.com>
@s-u
Copy link
Owner

s-u commented Nov 9, 2022

As nice as those features would be, it seems that Ventura has blocked those :( - on macOS 13 the VM will fail to start if PL011 is enabled with:

err=Error Domain=VZErrorDomain Code=1 "The virtual machine failed to start."
UserInfo={NSLocalizedFailure=Internal Virtualization error.,
          NSLocalizedFailureReason=The virtual machine failed to start.}

so I'll keep it open since I like the idea, but sadly private APIs don't seem to last long.

s-u added a commit that referenced this pull request Nov 9, 2022
@agraf
Copy link
Author

agraf commented Nov 9, 2022

They look different on Ventura, with recovery becoming a first class citizen. I have an updated branch at https://github.com/agraf/macosvm/tree/macos13 that enables it there. Let's close this PR, I'll add it the official way later :)

@agraf agraf closed this Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants