Jump to content

[HOW TO] Custom entry in OpenCore to boot Windows


miliuco
 Share

5 posts in this topic

Recommended Posts

(These instructions are already posted on various Internet sites but from time to time they are requested by a user so I publish them in the guides).
 
To add an entry in Misc> Entries of config.plist you need to know the path to the operating system boot loader.

For a Windows disk, you must know the path to the BOOTX64.EFI file located in the EFI\BOOT folder into the EFI partition. This path must be in EFI format and must match the PCI device where BOOTX64.EFI is located.

 

The simplest method to find out the path the is using the UEFI Shell (OpenShell.efi), an OpenCore tool that is usually displayed in the start menu. Selecting UEFI Shell, runs a shell in which we can write commands.

 

On startup it displays a list of all detected EFI paths, they may have different prefixes:

  • BLKX: they are all scanned disks / partitions.
  • FSX: these are all file systems that can be browsed.
  • PciRoot (0x0) / Pci (AxB, CxD) / Sata (or Nvme)... are disk types (SATA AHCI or NVMe).
  • HD (X, GPT, <PARTUUID>, ...) or HD (X, MBR) are partitions where X is a number, GPT / MBR is the partitioning scheme followed by the partition identifier PARTUUID.

 

To find which of those paths is the macOS EFI partition you must do so:
 
1. FSX command: (where X is a number starting from zero) places the prompt on that partition. For example, typing FS0: (note colon) the prompt is placed in the root directory of FS0.
 
2. To find out if it is what we are looking for, use the ls command to list files and folders (dir also works) and cd to change to a directory (cd.. go up one level in the directory). If there is an EFI folder, you have to enter it (cd EFI) to find out if it is the Windows folder (EFI> Microsoft> Boot). If there is no EFI folder or the one there is is not from Windows, we move to the next device with FS1: and repeat the process. Sometimes it is necessary to enter several devices to find the correct one (FS0:, FS1:, FS2:, FS3:, etc.).

shell2.png.6f8d9b00206fe8fee7cc30f896d4aa57.png
 
3. Once the Windows EFI folder is located, its FSX number must be noted.
 
4. Run map> map_table.txt. This creates a text file map_table.txt where the prompt was located when using the map command.
 
5. Exit the Shell with exit and restart to enter macOS.
 
Back on macOS, mount the volume that contains the map_table.txt file:

 

diskutil list
sudo diskutil mount disk0s1

(change disk0s1 by the real volume).
 
Open map_table.txt with a text editor and locate the EFI path of the FSX device you noted in a previous step.

The path to the Windows boot loader consists of 2 parts, an EFI path to the partition with the EFI folder + a path to the boot loader within the EFI folder. We already know that the path to the boot loader is EFI\BOOT\BOOTX64.EFI. The EFI path to the EFI partition is taken from map_table.txt by copying the line that corresponds to the Windows EFI folder.
 
The line with the EFI path looks like this (example):

PciRoot(0x0)/Pci(0x1D,0x0)/Pci(0x0,0x0)/NVMe(0x1,18-CC-1C-49-8B-44-1B-00)/HD(1,GPT,DF3F0348-A4F8-4A34-9C86-963B0E98F2BE,0x800,0x54747)

The path to the boot loader is like this:

EFI\BOOT\BOOTX64.EFI

 You have to join both paths by inserting a forward slash / and a backslash \ between the 2 strings:

PciRoot(0x0)/Pci(0x1D,0x0)/Pci(0x0,0x0)/NVMe(0x1,18-CC-1C-49-8B-44-1B-00)/HD(1,GPT,DF3F0348-A4F8-4A34-9C86-963B0E98F2BE,0x800,0x54747)/\EFI\BOOT\BOOTX64.EFI

This is the path to be entered in the Path key of the custom entry in Misc> Entries in the config.plist file. The custom entry would look like this (example):

        <key>Entries</key>
        <array>
            <dict>
                <key>Arguments</key>
                <string></string>
                <key>Auxiliary</key>
                <false/>
                <key>Comment</key>
                <string>Windows 10</string>
                <key>Enabled</key>
                <true/>
                <key>Flavour</key>
                <string>Windows10:Windows</string>
                <key>Name</key>
                <string>Windows</string>
                <key>Path</key>
                <string>PciRoot(0x0)/Pci(0x1D,0x0)/Pci(0x0,0x0)/NVMe(0x1,18-CC-1C-49-8B-44-1B-00)/HD(1,GPT,DF3F0348-A4F8-4A34-9C86-963B0E98F2BE,0x800,0x54747)/\EFI\BOOT\BOOTX64.EFI </string>
                <key>TextMode</key>
                <false/>
            </dict>
        </array>

Note1: Notice that there are no spaces in the Path key.

 

Note2: Notice that I have written the path to the Windows boot loader like this:

EFI\BOOT\BOOTX64.EFI 

as it is in OpenCore's Sample.plist. But there is a backup copy of BOOTX64.EFI in EFI\Microsoft\Boot named bootmgfw.efi, so we can also write the Windows boot loader path in this way:

EFI\Microsoft\Boot\bootmgfw.efi

 

Edited by miliuco
  • Like 3
  • Thanks 4
Link to comment
Share on other sites

  • 1 year later...

Thanks! Just got a chance to read this guide. 

ScanPolicy (Integer) = 2687747, I guess this will hide Windows.

 

Per your guide, I don't understand #4.  Example at FS0:\EFI\> type Run map or type map_table.txt

 

Edited by loganMac
Link to comment
Share on other sites

  • 11 months later...

thanks been awhile,  question: @antuneddu

 

the flavours part: what to put in?

 

I got it.

 

Windows11Pro:Windows

Windows10Pro:Windows

 

I have been able to have 3 Windows boot icons on OpenCore.

 

the 1st one boots into the Windows dual boot menu which has both plus 1.

Windows 11 Pro

Windows 10 Pro

Macrium Reflect

 

then 2 icons besides that

 Windows11Pro

 Windows10Pro

then all the rest of the icons such as UEFI Shell, NVRAM RESET, Clean Nvram, Shutdown....

 

in a single line:>   Windows Windows11Pro Windows10Pro CleanNvam UEFI Shell Shutdown .....

 

On the side, now if we can get RTX Geforce to run on the hacks that would be super cool.

 

Thanks for keeping this post up!

 

Have good week you two

Edited by makk
  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Have done the dortania config and root directory efi files, but not detecting all installs.

 

Have invoked the shell for PCI entries and added custom entries that failed to display and boot as intended.

 

However, the original question was, what does open core search for, and where, in detecting a linux installation.

 

Thanks for suggestions, but would appreciate if someone could specifically answer this question.

Edited by mek21
Link to comment
Share on other sites

 Share

×
×
  • Create New...