Code Monkey home page Code Monkey logo

Comments (12)

egandro avatar egandro commented on July 21, 2024

I found this:

https://www.tekrevue.com/tip/mac-vm-boot-recovery-mode-vmware-fusion/

macosguest.forceRecoveryModeInstall = "TRUE"

Boots the VM in OSX Recovery Mode. This opens the door to an elevated terminal.

from macinbox.

egandro avatar egandro commented on July 21, 2024

So this works. OSX gets into Recovery.

I have a theory - this might be the offset in the nvram that needs to be patched:

< 00002200: 0000 0000 2c3b 0000 61df e48b ca93 d211  ....,;..a.......
---
> 00002200: 0000 0000 463e 0000 61df e48b ca93 d211  ....F>..a.......

The other part I found is about the boot loader.

from macinbox.

KirkMartinez avatar KirkMartinez commented on July 21, 2024

I have this need as well. Happy to test out any proposed implementations.
I tried hacking my nvram file, but replacing those bytes was not sufficient for "csrutil status" to show "disabled".

@egandro what did you find about the boot loader?

from macinbox.

egandro avatar egandro commented on July 21, 2024

I put a few more hours in this investigating what the "magic bits" are in the NVRAM.

  1. I created a fresh OSX install - backuped the nvram
  2. I bootet into recovery (using the .vmx line for forcing the recovery mode) - i backuped the nvram
  3. I csr'ed via recovery terminal - and i backuped the nvram

Binary diffing 1/2/3 lead into no insigths. I used diff + xxd (from vim - to create a hexdump)

So maybe somebody has a smarter idea then I have.


2nd approach - how does clover do this?

https://github.com/svn2github/cloverefiboot/blob/bb27dc5fc4c85f08375b04f3752d44fdf8c538fa/rEFIt_UEFI/Platform/kext_inject.c

They patch the kexts in memory :(

Unfortunately it's not a simulated nvram...

So this is still open...

from macinbox.

JonHolman avatar JonHolman commented on July 21, 2024

Is there a way I can boot my macinbox virtualbox VM into recovery mode? I want to disable SIP to test some things. I see the line above, but I'm not sure where to put that.

from macinbox.

bacongravy avatar bacongravy commented on July 21, 2024

@JonHolman Some quick googling indicates that there are a couple of methods that may work to get you into recovery mode with Virtualbox, but I don't have experience with them and can't comment on whether they would be effective.

The macosguest.forceRecoveryModeInstall = "TRUE" setting is for VMware Fusion, not Virtualbox, but I also haven't tested that method, either.

from macinbox.

JonHolman avatar JonHolman commented on July 21, 2024

@bacongravy thanks. I'm not sure how to trigger booting into recovery mode with virtualbox, but I ended up creating a Mojave ISO and booted to that and was able to do what I wanted.

from macinbox.

egandro avatar egandro commented on July 21, 2024

The macosguest.forceRecoveryModeInstall = "TRUE" setting is for VMware Fusion, not Virtualbox, but I also haven't tested that method, either.

This works - however - after doing that you can't get the system to boot into non recovery mode... Maybe I am to stupid.

from macinbox.

frankosterfeld avatar frankosterfeld commented on July 21, 2024

https://github.com/myspaghetti/macos-virtualbox/blob/master/macos-guest-virtualbox.sh might have a solution for this (search for "csr-active-config"), generating a nvram file and loading it in the EFI boot loader, if I read that code correctly.

from macinbox.

frankosterfeld avatar frankosterfeld commented on July 21, 2024

I've created a pull request, but I can only test virtualbox here, so this needs to be applied for the other providers, too.

from macinbox.

bacongravy avatar bacongravy commented on July 21, 2024

@frankosterfeld Thank you for the PR! I haven't had a chance to give it a spin but it looks good. I don't how to replicate this functionality for VMware Fusion or Parallels Desktop, so it may need to be VirtualBox-only for now.

from macinbox.

bacongravy avatar bacongravy commented on July 21, 2024

(Specifically, I don't know how to replicate the dmpstore call from startup.nsh for VMware or Parallels.)

from macinbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.