Skip to content

Commit 41d1405

Browse files
committed
Fix missing NVRAM file when manually checking Enable EFI in System settings
NVRAM file is not created for new VMs where EFI is not set by defalut (I guess pretty much anything except Windows 11 and macOS). When manually checking "Enable EFI" in System settings later, the file was not created, and the VM settings became unavailable. I was trying to make the secure boot flag working, but due to the issue with vboxwebsrv always reporting it as enabled, and inability to tell whether it's disabled, I had to turn this off, and carelessly also commented the code creating the NVRAM file. This part is now restored. Fixes #369
1 parent ab759b9 commit 41d1405

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

endpoints/lib/vboxconnector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,8 +1875,8 @@ public function remote_machineSave($args) {
18751875
$m->Platform->X86->setCPUProperty('LongMode', ($guestOS->is64Bit ? 1 : 0));
18761876
}
18771877

1878-
/* secureBootEnabled reported incorrectly by vboxwebsrv
18791878
$oldFirmware = (string)$m->FirmwareSettings->firmwareType;
1879+
/* secureBootEnabled reported incorrectly by vboxwebsrv
18801880
$oldSecureBoot = ($oldFirmware != 'BIOS' && $m->nonVolatileStore->uefiVariableStore != null ? $m->nonVolatileStore->uefiVariableStore->secureBootEnabled : false);
18811881
*/
18821882

@@ -1891,12 +1891,12 @@ public function remote_machineSave($args) {
18911891
$m->Platform->X86->setCPUProperty('LongMode', (strpos($args['OSTypeId'],'_64') > - 1 ? 1 : 0));
18921892
$m->trustedPlatformModule->type = $args['trustedPlatformModule']['type'];
18931893

1894-
/* secureBootEnabled reported incorrectly by vboxwebsrv
18951894
if($oldFirmware == 'BIOS' && $args['firmwareType'] == 'EFI') {
18961895
$m->nonVolatileStore->initUefiVariableStore(0);
18971896
$m->nonVolatileStore->uefiVariableStore->enrollOraclePlatformKey();
18981897
$m->nonVolatileStore->uefiVariableStore->enrollDefaultMsSignatures();
18991898
}
1899+
/* secureBootEnabled reported incorrectly by vboxwebsrv
19001900
if($args['firmwareType'] != 'BIOS' && $oldSecureBoot != (bool)$args['secureBootEnabled']) {
19011901
$m->nonVolatileStore->uefiVariableStore->secureBootEnabled = (bool)$args['secureBootEnabled'];
19021902
}

0 commit comments

Comments
 (0)