Disabling Secure Boot
Disabling Secure Boot
Article
12/15/2021
2 minutes to read
8 contributors
Feedback
Secure Boot helps to make sure that your PC boots using only firmware
that is trusted by the manufacturer. You can usually disable Secure Boot
through the PC’s firmware (BIOS) menus, but the way you disable it varies
by PC manufacturer. If you are having trouble disabling Secure Boot after
following the steps below, contact your manufacturer for help.
Warning
After disabling Secure Boot and installing other software and
hardware, you may need to restore your PC to the factory state
to re-activate Secure Boot.
Be careful when changing BIOS settings. The BIOS menu is
designed for advanced users, and it's possible to change a
setting that could prevent your PC from starting correctly. Be
sure to follow the manufacturer's instructions exactly.
Or
Or
On some PCs, select Custom, and then load the Secure Boot
keys that are built into the PC.
Tip
Related topics
Secure Boot Overview
Recommended content
Secure boot
Provides guidance on what an OEM should know about TPM 2.0 and
the features that require it
Show more
For a typical deployment scenario, you do not need to modify the BCD
store. This topic discusses the various BCD settings in the BCD store that
you can modify. On UEFI systems, this includes settings for the following
boot applications:
The following sections describe the available settings for each of these
boot applications in detail and how to modify each application for UEFI
systems.
For simplicity, the BCDEdit examples in this section modify the BCD
system store. To modify another store, such as a copy of the BCD-
template, include the store name in the command line.
The BCD settings for the device and path elements in Windows Boot
Manager indicate the firmware boot manager. The template that is named
BCD-template for Windows includes the following settings for Windows
Boot Manager.
cmdCopy
## Windows Boot Manager
identifier {bootmgr}
device partition=\Device\HarddiskVolume1
path \EFI\Microsoft\Boot\bootmgfw.efi
description Windows Boot Manager
Device Setting
The device element specifies the volume that contains Windows Boot
Manager. For UEFI systems, the device element for Windows Boot Manager
is set to the system partition volume letter. To determine the correct
volume letter, use the Diskpart tool to view the disk partitions. The
following example assumes that the system has a single hard drive that
has multiple partitions, including a system partition that has been
assigned a drive letter of S.
The following Diskpart commands select disk 0 and then list the details of
the volumes on that disk, including their drive letters. It shows volume 2
as the system partition.
cmdCopy
DISKPART> select disk 0
DISKPART> list volume
If the system partition does not have an assigned drive letter, assign one
by using the Diskpart assign command. The following example assumes
that the system partition is volume 2 and assigns it S as the drive letter.
cmdCopy
Diskpart
select disk 0
list volume
select volume 2 // assuming volume 2 is the system partition
assign letter=s
cmdCopy
Bcdedit /set {bootmgr} device partition=s:// system partition
Tip
If you've previously used Diskpart to get drive letters and then rebooted
your PC, use Diskpart to check your drive letters again prior to running
this command. Depending on your environment, drive letters could
change so be sure that you're setting the right partition.
Path Setting
The path element specifies the location of the Windows Boot Manager
application on that volume. For UEFI systems, path indicates the firmware
boot manager, whose path is \EFI\Microsoft\Boot\Bootmgfw.efi.
You can confirm that BCD-template has the correct path by enumerating
the values in the store, as follows:
cmdCopy
bcdedit /store bcd-template /enum all
Copy
Bcdedit /set {bootmgr} path \efi\microsoft\boot\bootmgfw.efi
Other Settings
You should set Windows Boot Manager to be the first item in the display
order of the UEFI firmware, as shown in the following example.
cmdCopy
Bcdedit /set {fwbootmgr} displayorder {bootmgr} /addfirst
You should also specify the topmost Windows boot loader application in
the Windows Boot Manager display order. The following example shows
how to put a specified Windows boot loader at the top of the display
order.
cmdCopy
Bcdedit /set {bootmgr} displayorder {<GUID>} /addfirst
Note
BCD-template for Windows has a single Windows boot loader object that has
the following settings.
cmdCopy
## Windows Boot Loader
identifier {9f25ee7a-e7b7-11db-94b5-f7e662935912}
device partition=C:
path \Windows\system32\winload.efi
description Microsoft Windows Server
locale en-US
inherit {bootloadersettings}
osdevice partition=C:
systemroot \Windows
cmdCopy
Bcdedit /default {9f25ee7a-e7b7-11db-94b5-f7e662935912}
For the Windows boot loader for EFI, both elements are usually set to the
drive letter of the Windows system partition. However, if BitLocker is
enabled or a computer has multiple installed versions of
Windows, osdevice and device might be set to different partitions.BCD-
template sets both elements to drive C, which is the typical value. You can
also explicitly set the osdevice and device values, as shown in the following
example. The example also assumes that you have specified the Windows
boot loader for EFI as the default boot-loader object.
cmdCopy
Bcdedit /set {default} device partition=c:
Bcdedit /set {default} osdevice partition=c:
Path Setting
The path element of a Windows boot loader specifies the location of the
boot loader on that volume. For UEFI systems, path indicates the Windows
boot loader for EFI, whose path is \Windows\System32\Winload.efi.
You can confirm that BCD-template has the correct path value by
enumerating the values in the store. You can also explicitly set
the path value, as shown in the following example.
cmdCopy
Bcdedit /set {default} path \windows\system32\winload.efi
cmdCopy
## Windows Memory Tester
identifier {memdiag}
device partition=\Device\HarddiskVolume1
path \boot\memtest.exe
description Windows Memory Diagnostic
Device Setting
For UEFI systems, the device element for the Windows memory tester is
set to the system partition drive letter. The following example assumes
that the system partition is drive S, as used in earlier examples.
cmdCopy
Bcdedit /set {bootmgr} device partition=s: // system partition
Path Setting
The path element specifies the location of Windows Test Manager on the
volume that the device element has specified. For UEFI
systems, path indicates the EFI version of the application ( \EFI\Microsoft\
Boot\Memtest.efi).
You can confirm that BCD-template has the correct path value by
enumerating the values in the store. You can also use the BCDEdit tool to
explicitly set the path value, as shown in the following example.
cmdCopy
Bcdedit /set {memdiag} path \efi\microsoft\boot\memtest.efi
Recommended content
Boot and UEFI - Windows drivers
This document lists the basic validation scenarios that are required to
pass before signing-off on the Windows UEFI Firmware Update Platform
functionality.
Prerequisites
For each EFI System Resource Table (ESRT) entry, you need a
capsule for the latest firmware version. The scenarios will refer to the
latest version as X. Each ESRT entry is identified using a unique
GUID.
For each ESRT entry exposed, create a capsule package that its
version is incremented above the package created in step 1. These
capsules will be referred to as X+1.
Capsules that aid in simulating failure conditions such as a capsule
for which the payload is not signed or signed with an invalid PK.
Make sure all capsules to be used are signed appropriately from the
OS perspective, catalog signed, and firmware signed, PK signed.
Unless, you are specifically testing the negative PK signing cases.
See “Signing the Firmware driver Package” in the specification for
details on how to sign a capsule or firmware driver package.
How To
Install a new capsule or reinstall a previously installed
capsule
1. Open up device manager.
2. Find the device node that represents your firmware, it is usually
under the “Firmware” devices.
3. Right click on the firmware device you wish to update.
4. Select Update driver software. You will get a popup that states
“Update Driver Software - <Firmware>”.
5. Select Browse my computer for driver software.
6. On the next window, select Let me pick from a list of device
drivers on my computer.
7. If the driver has been installed before, select it from the Show
compatible hardware box. If it does not exist, select Have
disk and continue on. Otherwise, select OK and reboot the system.
8. If you select Have Disk, you will get a popup labeled Install From
Disk.
9. Use Browse to go to the directory that has the capsule of the
firmware you wish to install.
10.Select the INF file in that directory and hit OK to install.
11.During installation, if you get a popup saying the driver is not signed,
go ahead and accept this driver.
12.The system asks you to reboot.
13.After you installed the capsule for the firmware, you need to reboot.
If you wish to install multiple capsule packages, then wait to reboot
until all capsules are installed and then reboot on the final capsule.
Query the version and status details
Run the QueryVersionAndStatus.ps1 PowerShell (PS) script to query
the current firmware version, last attempt firmware version and last
attempt status.
To run the script
1. Run PowerShell as administrator.
2. Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force (This
only has to be done once.)
3. Display the version and status details for the given GUID. For
example: .\QueryVersionAndStatus.ps1 6bd2efb9-23ab-4b4c-bc37-
016517413e9a
4. Check if firmware update was successful: Refer to the section
“Validating the status of the firmware update” in the specification
document. Make sure that the Last Attempt Status and the Current
Version matches the expected version.
5. Recommended: Check to make sure that the devices you are
updating are also still functioning.
6. Set the rollback policy: Some of the scenarios might require rolling
back firmware. Rollback is not a production scenario. In order to be
able to rollback, a registry policy key has to be created. Create a
REG_DWORD key with the name “Policy” under the node
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\
FirmwareResources\{<GUID>} and set the value of the Policy key to
1. Note that the GUID should be replaced with the actual GUID from
the ESRT.
Scenarios
S1: Each ESRT entry is successfully updatable through
capsule
The following steps should be completed for each ESRT entry that is
supported by the platform. Or in other words, for System firmware and
each device firmware that supports updating firmware through
UpdateCapsule.
S1 Steps
1. For each ESRT entry, install the capsule for firmware version X.
2. Make sure all the above capsules are installed, prior to rebooting.
S1 Expected Result
Firmware update should be successful for each ESRT entry that was
updated. For all ESRT entries, for which the update was attempted,
validate that:
The following steps should be completed for each ESRT entry that is
supported by the platform. Or in other words, for System firmware and
each device firmware that supports updating firmware through
UpdateCapsule.
S2 Steps
1. Complete scenario S1 above.
2. For each ESRT entry, install the capsule for firmware version X+1.
S2 Expected Result
Firmware update should be successful for each ESRT entry that was
updated. For all ESRT entries, for which the update was attempted,
validate that:
The Status codes are defined in the section named “UEFI System
Resource Table Definition”, in the table with the title “ESRT Last Attempt
Status Field Values”.
Firmware update should fail. For ESRT entry corresponding to the System
Firmware, validate that:
Firmware update should fail. For all ESRT entries, for which the update
was attempted, validate that:
Firmware update should fail for the System firmware and for all the device
firmware for which the update was attempted. For all ESRT entries, for
which the update was attempted, validate that:
The following steps should be completed for each ESRT entry that is
supported by the platform. Or in other words, for System firmware and
each device firmware that supports updating firmware through
UpdateCapsule.
S3.4 Steps
1. For each ESRT entry, create a capsule X+2, the payload for which is
not signed.
2. Install the capsules X+2. Let’s assume that the current version is X.
S3.4 Expected Result
Firmware update should fail for all the ESRT entries for which the update
was attempted. For all ESRT entries, for which the update was attempted,
validate that:
The following steps should be completed for each ESRT entry that is
supported by the platform. Or in other words, for System firmware and
each device firmware that supports updating firmware through
UpdateCapsule.
S3.5 Steps
1. For each ESRT entry, create a capsule X+2, sign the payload with a
wrong key or certificate (for example use a debug signed capsule on
a production device).
2. Install the capsules X+2. Let’s assume that the current version is X.
S3.5 Expected Result
Firmware update should fail for all the ESRT entries for which the update
was attempted. For all ESRT entries, for which the update was attempted,
validate that:
The following steps should be completed for each ESRT entry that is
supported by the platform. Or in other words, for System firmware and
each device firmware that supports updating firmware through
UpdateCapsule.
S3.6 Steps
1. For each ESRT entry, create a capsule X+2, sign the payload with the
right key or certificate. Then open the firmware bin file and flip 1 or
more bits in the file and save the file back.
2. Regenerate the catalog for the bin file and the INF file.
3. Install the capsules X+2. Let’s assume that the current version is X.
S3.6 Expected Result
Firmware update should fail for all the ESRT entries for which the update
was attempted. For all ESRT entries, for which the update was attempted,
validate that:
The following steps should also be carried out for other device firmware
(lower priority).
S3.7 Steps
1. For UEFI System Firmware, create a capsule X+1 such that the
“LowestSupportedFirmwareVersion” in the ESRT entry for the system
firmware is set to X+1.
2. Install the capsule X+1 and make sure that the update succeeds.
3. Create a UEFI System firmware update capsules, such that the
version in the INF is X+2 but the actual firmware binary file is of
version X.
4. Install the capsule X+2 and reboot the system.
S3.7 Expected Result
Firmware update should fail. For ESRT entry corresponding to the System
Firmware, validate that:
S4 Expected Result
The system should boot into the OS and the firmware update should be
marked as failed. The version reported by the UEFI firmware resource
device should not have changed.
The only text that is displayed on the screen is “Please wait while we
install a system update”. The text is displayed at the right co-
ordinates on the screen as called out in the specification.
OEM Logo is displayed as described in the specification.
Related topics
Windows UEFI Firmware Update Platform
Recommended content
UEFI firmware requirements