Add support for QEMU AMD SNP VM Measured linux boot with the addition of new AMDSEV OVMF.fd
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
edk2 (Debian) |
New
|
Unknown
|
||||
edk2 (Ubuntu) | Status tracked in Questing | |||||
Plucky |
New
|
Undecided
|
Unassigned | |||
Questing |
In Progress
|
Wishlist
|
Lukas Märdian |
Bug Description
On the plucky release, the launch of SNP QEMU VM with SNP measurement boot option fails due to the absence of OVMF amdsev file in the OVMF plucky ubuntu package
Plucky OVMF package requires the integration of the AMD SEV firmware file,OVMF.
Currently, the SEV firmware necessary to support SEV Virtual Machine Remote Attestation is not available within the Ubuntu OVMF package.
I attempted to execute an SNP QEMU measured boot using the OVMF file packaged with Ubuntu, but this endeavor was unsuccessful due to the provision of an invalid OVMF file within the Ubuntu OVMF package.
Error message that I see using Ubuntu OVMF.fd(
qemu-system-x86_64: SEV: guest firmware hashes table area is invalid (base=0x0 size=0x0)
QEMU commandline used for my SNP guest test launch on Plucky release is as follows:
qemu-system-x86_64 \
-enable-kvm \
-cpu EPYC-v4 \
-m 2048 \
-nographic \
-netdev user,hostfwd=
-device virtio-
-device virtio-
-device scsi-hd,drive=disk0 \
-drive if=none,
-machine memory-
-object memory-
-machine memory-backend=ram1 \
-object sev-snp-
-bios /usr/share/
-kernel /home/amd/
-initrd /home/amd/
-append "console=tty1 console=
ProblemType: Bug
DistroRelease: Ubuntu 25.04
Package: ovmf 2025.02-3ubuntu2
ProcVersionSign
Uname: Linux 6.14.0-13-generic x86_64
ApportVersion: 2.32.0-0ubuntu3
Architecture: amd64
CasperMD5CheckR
Date: Tue Apr 8 05:43:04 2025
Dependencies:
InstallationDate: Installed on 2025-04-08 (0 days ago)
InstallationMedia: Ubuntu-Server 25.04 "Plucky Puffin" - Daily amd64 (20250407)
PackageArchitec
ProcEnviron:
LANG=en_US.UTF-8
PATH=(custom, no user)
SHELL=/bin/bash
TERM=tmux-256color
XDG_RUNTIME_
SourcePackage: edk2
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Canonical Server Reporter: Pending requested
- git-ubuntu import: Pending requested
-
Diff: 96 lines (+51/-1)4 files modifieddebian/changelog (+7/-0)
debian/descriptors/60-edk2-x86_64-amdsev.json (+31/-0)
debian/ovmf.install (+1/-0)
debian/rules (+12/-1)
- Hector CAO: Pending requested
- Canonical Server Core Reviewers: Pending requested
- Canonical Server Reporter: Pending requested
- git-ubuntu import: Pending requested
-
Diff: 96 lines (+51/-1)4 files modifieddebian/changelog (+7/-0)
debian/descriptors/60-edk2-x86_64-amdsev.json (+31/-0)
debian/ovmf.install (+1/-0)
debian/rules (+12/-1)
tags: | added: server-triage-discuss |
tags: | removed: server-triage-discuss |
Changed in edk2 (Ubuntu): | |
status: | Incomplete → Confirmed |
Changed in edk2 (Debian): | |
status: | Unknown → New |
Changed in edk2 (Ubuntu Questing): | |
assignee: | nobody → Lukas Märdian (slyon) |
status: | Confirmed → In Progress |
As a workaround fix, I used the built AMDSEV OVMF.fd from the OVMF source code extracted from the Ubuntu Plucky Package.
I built the AMDSEV-SNP VM OVMF from the OVMF plucky ubuntu package using the following steps:
Step 1: Get OVMF Source code from the Ubuntu Plucky Package
apt-get source ovmf
Step 2: Build AMD-SNP OVMF for SNP VM measure direct boot based on the below link: /github. com/tianocore/ tianocore. github. io/wiki/ Common- instructions
https:/
a) Pre-Install OVMF Dependencies to setup EDK2 Build Environment
sudo apt install build-essential uuid-dev iasl git nasm python-is-python3
b) Compile build tools
$ cd edk2-2025.02/ PATH=$HOME/ edk2-2025. 02/BaseTools
$ make -C BaseTools
$ export EDK_TOOLS_
$ ./edksetup.sh
When the above steps are done, we can work in the edk2 directory for code development.
c) Build the EDK II BaseTools
$ make -C edk2/BaseTools
d) Setup build shell environment
$ cd edk2-2025.02/ PATH=$HOME/ src/edk2/ BaseTools
$ export EDK_TOOLS_
# Below command populates edk2/Conf directory with the default configuration files
$ . edksetup.sh BaseTools
e) Modify Conf files to build AMDSEV OVMF.fd firmwar for SNP remote attestation and secret injection purposes.
# Create GRUB file under AmdSev to build AmdSev firmware without error AmdSev/ Grub/grub. efi
$ touch OvmfPkg/
# Modify Conf/target.txt to build AMDSEV Firmware
# In the Conf/target.txt,
# Set the build platform, target architecture, tool chain, and multi-threading options as follows:
# Build AMDSEV OVMF Firmware
build
# After build, OVMF firmware for SNP VM measured boot is located at Build/AmdSev/ DEBUG_GCC5/ FV/OVMF. fd inside edk2 source directory