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

Is it possible to boot into "recovery mode"? #46

Open
magicgoose opened this issue Dec 10, 2017 · 32 comments
Open

Is it possible to boot into "recovery mode"? #46

magicgoose opened this issue Dec 10, 2017 · 32 comments

Comments

@magicgoose
Copy link

…for example, to disable SIP.
I tried to use cmd(right)+R but it ignores it and boot as usual.

@geerlingguy
Copy link
Owner

That... I'm not sure of. I've never tried it, but I'm not even sure if VirtualBox would pass keystrokes in the proper way during the OS boot process?

@magicgoose
Copy link
Author

Maybe it won't. I don't know unfortunately.

@unqueued
Copy link

unqueued commented Dec 8, 2018

Yes, it is possible, but you have to hit F12 to enter the EFI shell first, and then follow some instructions. I have tested it on Sierra.

http://anadoxin.org/blog/disabling-system-integrity-protection-from-guest-el-capitan-under-virtualbox-5.html

2.0 Shell> FS2:
2.0 FS2:>
2.0 FS2:\> cd com.apple.recovery.boot
2.0 FS2:\com.apple.recovery.boot\> boot.efi

Instructions with screenshots:
https://steemit.com/utopian-io/@kabooom/reset-mac-sierra-password-in-recovery-mode-running-inside-virtualbox

There is also a recovery mode disk image available:
https://techsviewer.com/how-to-boot-a-macos-mojave-virtual-machine-to-recovery-mode/
https://drive.google.com/file/d/1eh7Q0Xxky4diJig7KTbSW8OPAFlUGzt6/view

@the-vishal-kumar
Copy link

Yes, it is possible.
Restart your Mac from top left.
Click the same button such as Esc/F12/F8 whichever you use to go into the bios of your PC, it'll take you to Virtual Box Bios.
Go to 'Boot Manager'.
Choose 'EFI Internal Shell'.
Click Esc to to go to Shell.
Type FS2:
Type cd com.apple.recovery.boot
type boot.efi
You'll boot into Recovery OS

@pietmlr
Copy link

pietmlr commented Jun 8, 2020

My shell says: cd: 'FS2:\com.apple.recovery.boot' is not a directory.
What should I do now?

@LasseHenrich
Copy link

LasseHenrich commented Jun 14, 2020

My shell says: cd: 'FS2:\com.apple.recovery.boot' is not a directory.
What should I do now?

Same here. Fixed it with these steps:

  1. Download this file: https://drive.google.com/drive/folders/1YMc1HvamDnWg6wVLibX2RQw13kjCxbYu
    This is a macos recovery boot image.
  2. Select it as a separate drive in the settings of your virtual machine and remember its SATA port.
  3. Launch the machine and go into the boot menu, launch the recovery disk which is referenced by the same SATA port.
  4. From there recovery mode will launch, open the terminal from "Utilities" in the status bar.
  5. Type "csrutil disable" and then reboot via the apple logo in the top left corner.
  6. In your mac vm, you can check whether SIP is disabled in Terminal by typing "csrutil status".

Hope this helps!

@pietmlr
Copy link

pietmlr commented Jun 15, 2020

Thank you @DerLasseHenrich, I‘ll try it later and comment if it works.

So, I'm using macOS Catalina and I can't use this one because it's for mojave :/

@LasseHenrich
Copy link

@redmlr You sure? I was also using Catalina, 10.15.4 I believe, and it worked perfectly.

@pietmlr
Copy link

pietmlr commented Jun 16, 2020

I‘m booting in recovery disk, but when I‘m there I cannot use my mouse and keyboard to navigate..

@vviikk
Copy link

vviikk commented Jun 22, 2020

This would help users get into recovery mode and back out. From my answer here.

In your VM's terminal:

sudo nvram recovery-boot-mode=unused && sudo shutdown -r now

Once in recovery mode you can run the commands you need in Utilities>Terminal.

Run the commands you want like:

$ csrutil disable
$ nvram -d recovery-boot-mode && shutdown -r now # this gets you out of recovery mode

And you'll get back into normal MacOS.

@ilampirai
Copy link

This would help users get into recovery mode and back out. From my answer here.

In your VM's terminal:

sudo nvram recovery-boot-mode=unused && sudo shutdown -r now

Once in recovery mode you can run the commands you need in Utilities>Terminal.

Run the commands you want like:

$ csrutils disable
$ nvram -d recovery-boot-mode && shutdown -r now # this gets you out of recovery mode

And you'll get back into normal OSX.

csrutil, not csrutils this gave me a mini heart attack. This works like a charm thanks.
host windows 10, guest catalina

@vviikk
Copy link

vviikk commented Jul 28, 2020

Updated my answer :) Sorry!

@david-turnell
Copy link

See this, it fixes your issue and more. Makes the install very easy even if you are not a super user.

https://blog.victormendonca.com/2020/04/17/how-to-install-macos-catalina-in-virtual-box/

@matham
Copy link

matham commented Sep 3, 2020

@vviikk Thanks for the commands. That + https://www.virtualbox.org/ticket/19047 allowed me to install virtual box additions on OSX.

@nobruinfo
Copy link

@vviikk For me the second line omitting =unused to reinstate a non recovery operation of the Mac in the VM was not
necessary as a next boot process ended in normal mode anyways.

@matham The thread states this to be true but no functionality came back. Is this also your experience?

@matham
Copy link

matham commented Oct 7, 2020

I was able to get copy and paste outside the vm working for a bit, but then it stopped working. But I couldn't get shared folders to work, nor the GPU, which was my primary interest so I didn't investigate in depth.

@nobruinfo
Copy link

@matham Wow, impressive. Seems this is really going into the right direction.

@t0rr3sp3dr0
Copy link

t0rr3sp3dr0 commented Apr 17, 2021

At least on macOS Big Sur, it is also possible to boot into recovery mode using the EFI Internal Shell. This is useful if you are unable to boot into the OS to set the NVRAM flag via Terminal.

  1. restart the VM and repeatedly press ESC until the selection menu shows up

Screen Shot 2021-04-16 at 11 36 11 PM

  1. select Boot Manager and then select EFI Internal Shell

Screen Shot 2021-04-16 at 11 36 30 PM

  1. look for the recovery partition and run FSx:\System\Library\CoreServices\boot.efi

Screen Shot 2021-04-16 at 11 37 24 PM

You can look for the recovery partition by executing ls FSx:\, where x is an integer greater than 0, and checking if there is a folder Install macOS Big Sur.app. In my VM it was FS8.

@jkutianski
Copy link

The @t0rr3sp3dr0 solutions works. If you don't see the partition is because you haven't the recovery partition. A workaround to this is to use a pen drive with the installer.

@spookyuser
Copy link

I‘m booting in recovery disk, but when I‘m there I cannot use my mouse and keyboard to navigate..

Same thing was happening to me, I had to install this extension pack for virtualbox and set usb to 3.0 and it worked!

Steps over here: https://www.geekrar.com/fix-mouse-keyboard-stuck-macos-mojave-virtualbox/

@oguzhnatly
Copy link

My shell says: cd: 'FS2:\com.apple.recovery.boot' is not a directory.
What should I do now?

Same here. Fixed it with these steps:

  1. Download this file: https://drive.google.com/drive/folders/1YMc1HvamDnWg6wVLibX2RQw13kjCxbYu
    This is a macos recovery boot image.
  2. Select it as a separate drive in the settings of your virtual machine and remember its SATA port.
  3. Launch the machine and go into the boot menu, launch the recovery disk which is referenced by the same SATA port.
  4. From there recovery mode will launch, open the terminal from "Utilities" in the status bar.
  5. Type "csrutil disable" and then reboot via the apple logo in the top left corner.
  6. In your mac vm, you can check whether SIP is disabled in Terminal by typing "csrutil status".

Hope this helps!

Thanks to @DerLasseHenrich, it helped me to fix another error which is a circle with a line through it occurred in VMware. In recovery mode, do not need to re-install the Mojave version to Catalina System even it is recommended to re-install OS by Apple Documentation, I just restart the system and now everything works perfectly!

@CalculonPrime
Copy link

The @t0rr3sp3dr0 solutions works. If you don't see the partition is because you haven't the recovery partition. A workaround to this is to use a pen drive with the installer.

I see the partition, and I see the GUID directory, but there's no boot.efi there as there was in Catalina. So it seems the recovery partition does get installed by the Big Sur or Monterey installer ... it's just inaccessible via the Virtualbox BIOS. Or is the install somehow quietly failing? (Quietly because I don't see any errors during the upgrade process.)

I really don't want to download some mystery image from the web or have a separate USB just to boot recovery. I want the existing integral recovery partition to work. Will this require a fix from Oracle?

@Kein
Copy link

Kein commented May 12, 2022

Anyone managed to enter recovery mode on Windows Host with Catalina as guest on Ryzen CPU?
I've tried:

sudo nvram recovery-boot-mode=unused
sudo nvram internet-recovery-mode=RecoveryModeNetwork
sudo nvram internet-recovery-mode=RecoveryModeDisk
Command (⌘)-R
Option-Command-R
Shift-Option-Command-R
F12/F8 during boot

None of these work.

@akaydev-coder
Copy link

My shell says: cd: 'FS2:\com.apple.recovery.boot' is not a directory.
What should I do now?

Same here. Fixed it with these steps:

  1. Download this file: https://drive.google.com/drive/folders/1YMc1HvamDnWg6wVLibX2RQw13kjCxbYu
    This is a macos recovery boot image.
  2. Select it as a separate drive in the settings of your virtual machine and remember its SATA port.
  3. Launch the machine and go into the boot menu, launch the recovery disk which is referenced by the same SATA port.
  4. From there recovery mode will launch, open the terminal from "Utilities" in the status bar.
  5. Type "csrutil disable" and then reboot via the apple logo in the top left corner.
  6. In your mac vm, you can check whether SIP is disabled in Terminal by typing "csrutil status".

Hope this helps!

Awesome - you saved my Saturday. Thanks

@jpapa1896
Copy link

This would help users get into recovery mode and back out. From my answer here.

In your VM's terminal:

sudo nvram recovery-boot-mode=unused && sudo shutdown -r now

Once in recovery mode you can run the commands you need in Utilities>Terminal.

Run the commands you want like:

$ csrutil disable
$ nvram -d recovery-boot-mode && shutdown -r now # this gets you out of recovery mode

And you'll get back into normal MacOS.

Thank you very much. This worked for me :)

@CalculonPrime
Copy link

CalculonPrime commented Oct 28, 2022

This didn't work for me on Monterey:

sudo nvram recovery-boot-mode=unused && sudo shutdown -r now
Error setting variable - 'recovery-boot-mode': (iokit/common) not permitted.

I'm told you can avoid this error by going into Recovery Mode and running a command. Catch 22.

A bit of web searching turned up this alternative command for Monterey, and it set the nvram data no problem, but afterwards, I just booted back into normal mode:

sudo nvram internet-recovery-mode=RecoveryModeDisk && sudo shutdown -r now

So, still stuck. Note that there's a bug logged against VMware for booting into Recovery Mode in Big Sur+ too, so obviously, some format or data structure changed in MacOS at a low level, affecting both VMware and VB.

@NadgobKhan
Copy link

NadgobKhan commented Mar 28, 2023

For anyone who is still having issues with this, even after trying the solutions above, I tried the following and it works (on VirtualBox, for macOS 10.13):

  1. Restart macOS from the VM (for example with sudo reboot )
  2. Pres ESC to skip startup.sh in the first screen and enter the EFI Internal Shell (as @t0rr3sp3dr0 and others recommended)
  3. Now that you are in Shell, enter exit. This will open the selection menu
  4. Go to "Boot Maintenance Manager" -> "Boot from file"
  5. From there, select "Recovery"
  6. Select the option that looks like a UUID (a random string between { } )
  7. Select "boot.efi"
  8. After some time, you will be in Recovery Mode

Hope this helps somebody! 😄

@CalculonPrime
Copy link

For anyone who is still having issues with this, even after trying the solutions above, I tried the following and it works (on VirtualBox, for macOS 10.13):

1. Restart macOS from the VM (for example with `sudo reboot` )

2. Pres ESC to skip startup.sh in the first screen and enter the EFI Internal Shell (as @t0rr3sp3dr0 and others recommended)

3. Now that you are in Shell, enter `exit`. This will open the selection menu

4. Go to "Boot Maintenance Manager" -> "Boot from file"

5. From there, select "Recovery"

6. Select the option that looks like a UUID (a random string between { } )

7. Select "boot.efi"

8. After some time, you will be in Recovery Mode

Hope this helps somebody! smile

That's the standard way to boot into Recovery with VirtualBox, but it stopped working in Big Sur, because the boot.efi file isn't present.

@shb3014
Copy link

shb3014 commented May 14, 2023

I booted successfully into Recovery mode with Monterey following this thread https://superuser.com/questions/1235970/stuck-on-uefi-interactive-shell-with-mac-os-x-high-sierra-vm#:~:text=I%20found%20it%20in%20System%5CLibrary%5CCoreservices%5Cboot.efi%20for%2011.4%20Big%20Sur
The "boot.efi" can be found at "System\Library\Coreservices\boot.efi".

@CalculonPrime
Copy link

CalculonPrime commented Jun 3, 2023

I booted successfully into Recovery mode with Monterey following this thread https://superuser.com/questions/1235970/stuck-on-uefi-interactive-shell-with-mac-os-x-high-sierra-vm#:~:text=I%20found%20it%20in%20System%5CLibrary%5CCoreservices%5Cboot.efi%20for%2011.4%20Big%20Sur The "boot.efi" can be found at "System\Library\Coreservices\boot.efi".

You must be mistaken. The superuser page you quote relates to High Sierra, a much older version of MacOS, and System\Library\CoreServices\boot.efi is a file that boots to normal MacOS, not Recovery Mode. In Catalina, where Recovery Mode was still accessible, you'll find boot.efi right underneath a GUID directory in the Recovery Partition.

As mentioned, the issue with Big Sur and later MacOS versions is that boot.efi is not present in the Recovery Partition. There are many slight variations of that name when you dig around in the UEFI Shell, but not boot.efi, and therefore it's not possible to use 'boot from file' in the VirtualBox BIOS to boot into recovery mode.

When you type sw_vers when booted normally, what is the output?

@BenLaKnet
Copy link

BenLaKnet commented Jun 20, 2023

Hi,

I tried solutions here, but I can not obtain Recovery Mode.

Itried : FS3:\System\Library\Coreservices\boot.efi
Kernel Panic !

How could I do that with Monterey VM.

Thanks.

@haidar47x
Copy link

This would help users get into recovery mode and back out. From my answer here.

In your VM's terminal:

sudo nvram recovery-boot-mode=unused && sudo shutdown -r now

Once in recovery mode you can run the commands you need in Utilities>Terminal.

Run the commands you want like:

$ csrutil disable
$ nvram -d recovery-boot-mode && shutdown -r now # this gets you out of recovery mode

And you'll get back into normal MacOS.

Thank you kind human.

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

No branches or pull requests