Contribute
Register

[HOW TO] Custom entry in OpenCore to boot Windows

Joined
Dec 10, 2010
Messages
738
Motherboard
Gigabyte Z390 Aorus Elite
CPU
i9-9900K
Graphics
RX 580
Mobile Phone
  1. iOS
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.).
shell.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):
Code:
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:
Code:
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):
XML:
  <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>Name</key>
                <string>Windows</string>
                <key>Flavour</key>
                <string>Windows10: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
 
Last edited:
Joined
Mar 31, 2011
Messages
640
Motherboard
Gigabyte GA-Z77-DS3H-F11a
CPU
i5-3570K OC @ 4.2GHz
Graphics
HD 4000
Mobile Phone
  1. Android
Good stuff Miliuco,

there is also another handy command in the UEFI Shell which lists multiple OS drives (credits @tiqo)

bcfg boot dump

don't forget the OpenCore Update now includes the Flavour quirk so your example in OC v0.7.0+ will be

Code:
<key>Entries</key>
        <array>
            <dict>
                <key>Arguments</key>
                <string></string>
                <key>Auxiliary</key>
                <false/>
                <key>Comment</key>
                <string>Windows</string>
                <key>Enabled</key>
                <true/>
                <key>Flavour</key>
                <string>Windows10:Windows</string>
                <key>Name</key>
                <string>Windows 10</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>
 
Last edited:
Joined
Mar 31, 2011
Messages
640
Motherboard
Gigabyte GA-Z77-DS3H-F11a
CPU
i5-3570K OC @ 4.2GHz
Graphics
HD 4000
Mobile Phone
  1. Android
P.S. for those of us that were using the bootmgfw.efi.icns workaround in order to see the Windows icon in the picker following setup of Custom Entries and Scan Policy to remove the EFI icon(s) from the picker menu. You can now delete bootmgfw.efi.icns from your Windows drive in mac e.g, located under NO NAME > EFI > Microsoft > Boot. This new Flavor quirk eliminates the need for this workaround
:thumbup:
 

Edhawk

Moderator
Joined
Aug 2, 2013
Messages
2,372
Motherboard
Gigabyte Z97X-UD5H
CPU
i7-4790K
Graphics
HD 4600 / RX 580
Mac
  1. iMac
  2. MacBook Air
  3. MacBook Pro
Mobile Phone
  1. iOS
@miliuco is there a screenshot/image missing from the first post between sections 2 & 3, as it shows a large empty space between the two sections when I look at the 1st post?
 
Joined
Dec 10, 2010
Messages
738
Motherboard
Gigabyte Z390 Aorus Elite
CPU
i9-9900K
Graphics
RX 580
Mobile Phone
  1. iOS
@miliuco is there a screenshot/image missing from the first post between sections 2 & 3, as it shows a large empty space between the two sections when I look at the 1st post?
Yes, it's this attached image, I've deleted it from post 1 so you can see how the space adjusts and I'll put it back later.
In this post, do you see the UEFI Shell image?
(pic deleted after being seen, it's in the first post).
 
Last edited:

Edhawk

Moderator
Joined
Aug 2, 2013
Messages
2,372
Motherboard
Gigabyte Z97X-UD5H
CPU
i7-4790K
Graphics
HD 4600 / RX 580
Mac
  1. iMac
  2. MacBook Air
  3. MacBook Pro
Mobile Phone
  1. iOS
Joined
Sep 22, 2011
Messages
1,380
Motherboard
HP EliteDesk 800 G5 Mini
CPU
I9-9900
Graphics
UHD 630
Mac
  1. Mac mini
Mobile Phone
  1. iOS
For the moderator who deleted my post to @miliuco about how to create spoilers on tonymacx86, the code I posted does work on tonymacx86. See this first post where @miliuco has created a spoiler using the code I provided.

Code:
[spoiler="text for spoiler"]
[/spoiler]
 
Top