Jump to content

Setting the default OpenCore partition temporarily


8 posts in this topic

Recommended Posts

I like using my hack remotely through Screen Sharing / VNC as it has all the resources, but its often more convenient to be elsewhere on a laptop.

One thing I cant work out how to do though is e.g boot into another OS temporarily, without being at the keyboard.

 

There was a way to configure the boot order in Clover, but it seems everything is moved to NVRAM now.

On a real bootcamp install, it could be done via System Prefs > Startup Disk, but the only Startup Disk option available is my Ventura disk.

 

Using the Opencore picker is not an option without being at the keyboard, same for Ctrl-Enter to change the default boot.

 

Is there any way I can tell OpenCore to reboot into linux from MacOS?

Perhaps injecting key in NVRAM manually? 

 

 

Edited by TijuanaKez
Link to comment
Share on other sites

  • 10 months later...
On 6/21/2023 at 5:05 PM, TijuanaKez said:

Is there any way I can tell OpenCore to reboot into linux from MacOS?

Since the Starup Disk is not relevant in this case and you don't have access to the keyboard probably the best you can do is change the UEFI boot order in NVRAM used by OpenCore. This assumes that you have the RequestBootVarRouting quirk enabled in the UEFI section of your config file. Put the entry for GRUB (if installed) first in the BootOrder list then change back when done or enable GRUB only temporarily using the BootNext setting. You can do this from Linux using the efibootmgr command or from macOS using the bootoption utility. Refer to the documentation of both for details.

 

On 4/22/2024 at 3:15 PM, TijuanaKez said:

If I know the UUIDs of all the partitions, could I use a terminal command like this?

Probably not since OpenCore would need an entry with the path to a Linux kernel and the associated boot arguments. If going that route you may be able to create one (and set as default or BootNext) using the tools above but I've not tried that approach and can't say if that would work.

Link to comment
Share on other sites

Amazing. Thanks for that, I wasn't aware of the bootoption utility. That definitely looks promising. It correctly lists all 3 OS.

 

BootCurrent: Not set
BootNext: Not set
Timeout: 1
  1: Boot0080 Mac OS X
  2: Boot0001 ubuntu
  3: Boot0000 Windows Boot Manager

Now my only problem is allowing NVRAM write in SIP, but I'm getting conflicting information on the web. These appear to be the options.

CSR_ALLOW_UNTRUSTED_KEXTS            = 0x1
CSR_ALLOW_UNRESTRICTED_FS            = 0x2
CSR_ALLOW_TASK_FOR_PID               = 0x4
CSR_ALLOW_KERNEL_DEBUGGER            = 0x8
CSR_ALLOW_APPLE_INTERNAL             = 0x10
CSR_ALLOW_UNRESTRICTED_DTRACE        = 0x20 // Formerly known as CSR_ALLOW_DESTRUCTIVE_DTRACE
CSR_ALLOW_UNRESTRICTED_NVRAM         = 0x40
CSR_ALLOW_DEVICE_CONFIGURATION       = 0x80
CSR_ALLOW_ANY_RECOVERY_OS            = 0x100
CSR_ALLOW_UNAPPROVED_KEXTS           = 0x200
CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE = 0x400
CSR_ALLOW_UNAUTHENTICATED_ROOT       = 0x800

Given that, would you say setting csr-active-config to 0100 000 in config.plist under 7C436110-AB2A-4BBB-A880-FE41995C9F82 is what I should be doing?

Do I have that endian-ness right?

Or do I need to do this in Recovery?

Does OpenCore config.plist setting overwrite the csr-active-config variable every boot?

 

Thanks.

 

Link to comment
Share on other sites

20 hours ago, TijuanaKez said:

Amazing. Thanks for that, I wasn't aware of the bootoption utility. That definitely looks promising. It correctly lists all 3 OS.

Looks good. I think this should work well.

 

20 hours ago, TijuanaKez said:

Given that, would you say setting csr-active-config to 0100 000 in config.plist under 7C436110-AB2A-4BBB-A880-FE41995C9F82 is what I should be doing?

Do I have that endian-ness right?

Or do I need to do this in Recovery?

Does OpenCore config.plist setting overwrite the csr-active-config variable every boot?

There are several options to disable NVRAM protection as listed below:

  1. Boot to Recovery open the terminal and enter "csrutil enable --without nvram".
  2. Boot to OpenCore menu and select OpenShell then change to the mapping (FS#:) for the EFI partition containing OpenCore. Enter the following "FS#:\EFI\OC\Tools\CsrUtil.efi disable 0x40".
  3. Set the NVRAM value (in little-endian) for csr-active-config to 40000000 under NVRAM -> Add -> 7C436110-AB2A-4BBB-A880-FE41995C9F82 then add csr-active-config to NVRAM -> Delete -> 7C436110-AB2A-4BBB-A880-FE41995C9F82 and enable. This configuration will always replace the entire SIP value with the one specified as described here.
Edited by jpz4085
Link to comment
Share on other sites

  • 2 weeks later...

Ok this is actually working out great.

Combined with Shortcuts, boot options can now live conveniently in the dock.

Screenshot2024-05-08at8_52_17PM.png.812964d259f5c048e522964c60a09407.png 

 

Because 'BootNext' applies to the next boot only, reboot again from Ubuntu gets me back to MacOS.

 

Thanks for the help!

Link to comment
Share on other sites

11 hours ago, TijuanaKez said:

Ok this is actually working out great.

Combined with Shortcuts, boot options can now live conveniently in the dock.

Cool. Can you elaborate on how you added it to the dock? Did it involve pinning something like a script or third party app?

 

11 hours ago, TijuanaKez said:

Thanks for the help!

You're welcome!

Link to comment
Share on other sites

21 hours ago, jpz4085 said:

Cool. Can you elaborate on how you added it to the dock? Did it involve pinning something like a script or third party app?

Shortcuts.

Screenshot 2024-05-10 at 6.23.48 AM.png

  • Like 3
Link to comment
Share on other sites

 Share

×
×
  • Create New...