Enable MS-compatible secure boot with OVMF#284874
Enable MS-compatible secure boot with OVMF#284874adamcstephens merged 6 commits intoNixOS:masterfrom
Conversation
|
Note that I am still doing final comprehensive tests, but I have done initial validation of the resulting images. |
|
I would rather this be included by default with OVMFFull and not a standalone package. I see OVMFFull as batteries included and should definitely have secure boot support. What do you think @RaitoBezarius ? |
|
The QEMU update looks good, but why is it part of this PR? |
|
@alyssais The |
|
@adamcstephens I can move that if that's what the maintainers want. To be clear, |
Would make more sense in a separate PR IMO. There's no point holding up a simple QEMU update for the other stuff here. |
|
Looks like #284925 is the qemu side. If that's going to move forward this time, we may want to base this PR off of it since both add the OVMF build flag. I do prefer Either way, yes I think this should be handled in the OVMF package directly. It can include |
|
@adamcstephens That other PR doesn't bump qemu versions and is mostly about NixOS support. I also think the logic of requiring SMM when secureBoot is being used is more appropriate. |
|
Thanks a lot. |
|
@adamcstephens OK, inlined into the main derivation. |
|
@adamcstephens Updated flag name for SMM. |
|
Testing confirmed: Default vars file does not have secure boot enabled, new vars file does and requires MS-signed boot. |
|
There is still an issue with SMM when secureboot is enabled. I don't know if we should build OVMF with a builtin set of keys. I'd much rather go with an approach like: baloo@0174b95 Get the test driver (or whatever wrapper) to write the efivars storage directly, and embed a set of keys from the user if needed. |
|
@baloo It can't be right that it's impossible to update EFI vars, since the script that generates the variables template works by launching a qemu VM and running a firmware program to update them, and my Windows VM is able to update the boot order. Where are you seeing this issue?
With this change, you still get the empty variable store if you want it. You have to opt in to the default keys by using |
The moment secureboot is turned on, the SMM handler for qemu seems to make it impossible to update variables. |
|
@baloo You need to pass |
Co-authored-by: Arthur Gautier <[email protected]>
Fixed |
Yes, this works for me. I used |
|
This PR would close #288184. |
|
Is this ready to merge? |
|
I have no known issues on my end. |
|
Well, if no-one has any objections... |
|
@adamcstephens still wants to test #284874 (comment) |
|
Thanks for your contribution. Sorry for the delay. Since there are no objections, I'm going to merge it. |
|
Thanks! |
|
FYI the merge blocked channels. See PR #291544 |
I accidentally removed this in f6fc51d (I missed the leading comma on line 160), which was merged as part of #284874 This should be removed eventually, but it should be done intentionally with proper release notes.
I accidentally removed this in f6fc51d (I missed the leading comma on line 160), which was merged as part of NixOS#284874 This should be removed eventually, but it should be done intentionally with proper release notes.
|
This breaks a lot of things. Most notably it makes secure boot with aarch64 impossible because of weird defaults, an assertion and a qemu machine type that is x86 only. I'm biased to revert it. |
|
@nikstur Can you explain the issue/show a repro? The only x86-only code here is the usage of q35 when system management mode is enabled, but SMM is an x86 feature… |
If this is that critical, I'm happy to revert, but it would be helpful to know what and why. It's possible we can just fix and move forward instead of rolling back completely. |
|
Maintainer of |
|
Nothing is offered for these Should we add some way, controlled from editing the |
Description of changes
These changes, especially the new
msVarsTemplateflag forOVMFto create a UEFI variables store with MS secure boot keys enrolled, allow for virtualization of Windows 11 without bypassing secure boot restrictions.Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.