Setting a macOS VM to automatically boot to Recovery HD using VMware Fusion
When testing various security functions, like System Integrity Protection or High Sierra’s new kernel extension functionality, it’s often useful to be able to boot a macOS virtual machine (VM) into the Recovery environment. However, it can be challenging to select the VM and hold down Command+R in time to boot to the Recovery environment. This can result in having to try several or more times before you can successfully boot the VM to Recovery HD.
Fortunately, VMware has a setting that enables a forced boot to Recovery HD. For more details, please see below the jump.
My colleague mosen discovered that you could add the following setting to a macOS VM’s .vmx configuration file:
macosguest.forceRecoveryModeInstall = "TRUE"
Once this setting has been added to the .vmx configuration file, the VM will automatically boot to Recovery HD the next time it is started.
To add the macosguest.forceRecoveryModeInstall setting to a macOS VM:
1. Shut down the relevant VM.
2. Open the VM’s .vmx file for editing.
3. Add the following line to the end of the .vmx configuration file:
macosguest.forceRecoveryModeInstall = "TRUE"
4. Save the changes to the .vmx configuration file.
5. Start the VM.
The VM should boot from the macOS VM’s Recovery HD partition automatically, and will continue to boot to Recovery until the setting is removed from the VM’s .vmx file.
After reboot even though i removed the command string .vmx configuration file the MAC always resumes in recovery mode. What do I do now?
After reboot even though i removed the command string .vmx configuration file the MAC always resumes in recovery mode. What do I do now? have I lost everything?
You have to open .vmx again and delete macosguest.forceRecoveryModeInstall = “TRUE”. After that, find the .nvram file in the VM folder and delete it!
Delete .nvram
it worked thanks
I try to disable SIP. When I boot into Recovery mode I can disable SIP. If I delete the .nvram file to boot into normal mode, then the SIP is active again. Any idea how to fix that?
Solution: I had to use a real Mac for that. On the Mac I could boot my 10.13 vm image into Recovery Mode and disable SIP. This created the appropriate “macOS 10.13.nvram” small file which could then be copied to non-Mac hosts. So all the 10.13 vm images are in “sip-disabled” mode.
Solution addendum #1: Pay attention to the file permission of the copied .nvram file. On some systems (eg. Win10) it’s blocked by default if it’s coming from a different system. In this case a freshly created nvram file will have SIP activated again. Check if there has been a new file created in the VM directory. You may have to “unblock” the copied .nvram file by right-clicking on the file – and then choose permissions etc.
I just discovered that if my VM uses APFS, I can’t start in macOS Recovery. I can with HFS. I’ve been using vfuse from Joe Chilcote with an AutoDMG dmg with the –recovery flag.
sudo nvram “recovery-boot-mode=unused”
sudo reboot
source: http://anandmpandit.blogspot.ch/2017/09/how-to-boot-into-recovery-mode-on-mac.html
nvram -d recovery-boot-mode
If you are stuck in a recovery loop try setting the Startup Disk in recovery mode.
To boot the VM normally again, you have to:
1. Shutdown the VM. (don’t simply restart)
2. remove macosguest.forceRecoveryModeInstall = “TRUE” in the .vmx file
3. delete the .nvram file
4. boot normally
so, a normal boot will only work if macosguest.forceRecoveryModeInstall = “TRUE” in .vmx is removed and the nvram file is deleted with the power off.
Thanks for this tip from Catalina it works I have to try with Big Sur no need to delete the string just select the startup disk while you are using the recovery
Has anyone been able to get this working with Big Sur on Fusion 12? The old tricks don’t work for me.