[Bug]: EFI snapshot restore loads older NVRAM - VirtualBox 7.1.12

未關閉
#981 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 6 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
12/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
c

研究方向

The payload names no source files. Start by reproducing the issue on a VM with several snapshots, using the NVRAM paths the report lists (Snapshots/*.nvram) and the active NVRAM SHA-256 before and after a restore. Then find where snapshot restore copies NVRAM into the active VM file. Done when restoring the newest snapshot leaves the active NVRAM hash equal to that snapshot's NVRAM and Boot0004 is still present.

由索引模型根據 Issue 內容生成。

描述

bug
Version

7.1.12

Host OS Type

Linux

Host OS name + version

Ubuntu 20.04.5 LTS, x86-64, Intel Xeon E5-2667 v3

Host Architecture

x86

Guest OS Type

macOS

Guest Architecture

x86

Guest OS name + version

macOS Ventura 13.0, x86-64 - Configured guest type:** MacOS1013_64

Component

EFI

What happened?

Related issue: https://github.com/VirtualBox/virtualbox/issues/832
Restoring the newest snapshot of an EFI VM substitutes the active NVRAM with the contents of an unrelated, older snapshot.

This is demonstrated by byte-for-byte SHA-256 comparisons across four successive captures.

The newest snapshot, Ventura Automatic Boot, contains a valid EFI Boot0004 entry pointing to the macOS Ventura APFS Preboot loader. Automatic boot had been tested successfully.

After restoring this snapshot through VirtualBox Manager, Boot0004 disappears from the active NVRAM. The guest attempts the invalid Boot0002 hard-disk entry and fails to boot automatically.

The restored active NVRAM is byte-for-byte identical to the NVRAM belonging to the older Ventrua install stage 2 snapshot, rather than the selected Ventura Automatic Boot snapshot.

The selected snapshot's own NVRAM file remains correct and unchanged, and the .vbox configuration continues to identify the correct current snapshot and its NVRAM path.

Expected behavior

Restoring an EFI snapshot must restore the firmware state associated with that snapshot, including its EFI boot entries and boot order.

It must not load the NVRAM contents belonging to a different snapshot.

Actual behavior

The VM reports the correct current snapshot but has the wrong active NVRAM.

The resulting EFI boot error is:

BdsDxe: failed to load Boot0002 "UEFI VBOX HARDDISK"
Not Found
BdsDxe: No bootable option or device was found.

Querying the missing boot entry returns:

VBoxManage: error: Failed to query the attributes
of variable 'Boot0004': VERR_PATH_NOT_FOUND
How can we reproduce this?

Controlled reproduction

Four checkpoint archives were collected on November 13, 2026, in UTC.

UTC time Operation Active NVRAM SHA-256 prefix Boot0004
17:33:20 VM paused, initial state 1186f3c8 Present
17:39:56 Forced power-off, no saved state 824c20bf Present
17:41:31 Restore newest snapshot 41b59834 Missing
17:42:15 Change NAT to bridged and save 41b59834 Missing

The power-off operation changed the active NVRAM contents but preserved the Ventura boot entry.

The snapshot restoration is the first operation that removed Boot0004.

Changing the network configuration afterward did not change the active NVRAM.

Evidence of incorrect snapshot selection

Selected snapshot:

Name: Ventura Automatic Boot
UUID: d632ed51-1928-48ac-9314-9291a2377803
NVRAM: Snapshots/2026-11-13T07-13-03-052440000Z.nvram

Correct selected-snapshot NVRAM SHA-256:

1186f3c84b087ef166ca2d71c32ad219d0067497035c8c8618b057d232247183

Older snapshot:

Name: Ventrua install stage 2
NVRAM: Snapshots/2026-11-13T03-17-19-308073000Z.nvram

Older-snapshot NVRAM SHA-256:

41b59834c8054c092240267003c3fcbe624dfa81c68d3b452740730d42d228fb

Active NVRAM SHA-256 after restoration:

41b59834c8054c092240267003c3fcbe624dfa81c68d3b452740730d42d228fb

The hashes establish that the active NVRAM after restoration exactly matches the older snapshot.

All five snapshot NVRAM files remained unchanged during the controlled experiment. The .vbox file continued to reference the correct newest snapshot.

Confirmed workaround

With the VM powered off, copying the known-good NVRAM from the newest snapshot back over the active VM NVRAM restores the missing EFI boot entry.

Automatic boot was subsequently verified to work.

This confirms that the installed operating system and VDI were not responsible for the boot failure.

Related bug and investigation requested

Issue #832 reports EFI boot entries disappearing during snapshot creation with VirtualBox 7.2.16 on a Debian/Linux host with a Slackware guest.

This case concerns snapshot restoration with VirtualBox 7.1.12, Ubuntu host, and macOS guest.

The symptoms are similar, but this case demonstrates that an older snapshot's complete NVRAM state is substituted for the selected snapshot's state.

Please investigate how the active NVRAM source is selected or copied when restoring EFI VMs with multiple snapshots.

I can provide all four timestamped evidence archives, containing the active NVRAM, five snapshot NVRAM files, configuration XML, snapshot metadata, timestamps, and SHA-256 hashes.

The behavior has been confirmed on this five-snapshot VM. A fresh single-snapshot reproduction has not yet been tested.

Filename Checkpoint
20261113T173320.tgz Initial working state
20261113T173956.tgz After power-off
20261113T174131.tgz After snapshot restore — failure introduced
20261113T174215.tgz After bridged-adapter configuration

VirtualBox_EFI_NVRAM_Evidence_20261113.zip

Original log VBox.log
Session started November 13, 2026, 17:43:10 UTC
VirtualBox 7.1.12 r169651
NVRAM Active 6 Ventura 13.nvram
Network Bridged through eno1, Intel 82545EM
EFI failure 3.77 seconds after VM startup
Error VMBootFail

What's included
Original log Session opened (UTC) Lines
VBox.log.3 07:23:45 2,636
VBox.log.2 07:25:46 2,624
VBox.log.1 07:51:00 2,941
VBox.log 17:43:10 1,542
Total 9,743

The most important file is VBox.log.1. It covers the long-running VM session, including the pause and eventual power-off at approximately 17:38 UTC.

The final VBox.log captures the failed boot after snapshot restoration and the bridged-network change.
Additional contents

  • README.txt — chronology and explanation of the test.
  • MANIFEST.txt — SHA-256 hashes, file sizes and timestamps.
  • VBox-full-session-chronological.txt — all four logs concatenated chronologically.
  • logs/ — original individual logs, preserved unchanged.
    Important distinction
    The VirtualBox runtime logs do not record every GUI operation performed while the VM is powered off. The snapshot restoration and network-setting transitions are documented by the separate NVRAM/configuration evidence ZIP already uploaded.

VirtualBox_7.1.12_EFI_NVRAM_Full_Test_Session_Logs_20261113.zip

Did you upload all of your necessary log files, screenshots, etc.?
  • Yes, I've uploaded all pertinent files to this issue.
主要語言
C
星號
1.4k
分支
219
PR 合併指標
30 天內沒有已合併 PR

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

VirtualBox/virtualbox 的其他 Issue

查看 VirtualBox/virtualbox 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。