Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Sep 2025 16:55:08 +0000
From:      bugzilla-noreply@freebsd.org
To:        virtualization@FreeBSD.org
Subject:   [Bug 287326] bhyve: Ubuntu guest doesn't boot with TPM emulation enabled
Message-ID:  <bug-287326-27103-Q6k5He6nSA@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-287326-27103@https.bugs.freebsd.org/bugzilla/>
References:  <bug-287326-27103@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D287326

--- Comment #3 from Roman Bogorodskiy <novel@FreeBSD.org> ---
(In reply to Corvin K=C3=B6hne from comment #2)

> If I get it correctly, a FreeBSD guest works fine while an Ubuntu guest f=
ails to boot? I would try the following:

Yes, that's correct.

> 1. Enable boot logs of the Ubuntu guest and check them.

Any specifics on what could I enable?

In the meantime, I've been experimenting with that for a bit, and I think I=
 get
new details.

What I do:

1. sudo swtpm socket --tpmstate backend-uri=3Dfile:////var/run/swtpm/tpm.st=
ate
--tpm2 --server type=3Dunixio,path=3D/var/run/swtpm/tpm --log file=3D/tmp/s=
wtmp.log
--flags not-need-init --daemon
2. sudo bhyve -c 2 -m 4096 -A -I -u -H -P -s 0:0,hostbridge -l
bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -s 1:0,lpc -s
3:0,ahci,hd:/data/img/ubuntu.img -s 5:0,fbuf,tcp=3D127.0.0.1:5905 -l com1,s=
tdio
-l tpm,swtpm,/var/run/swtpm/tpm ubuntu

I get:

---
BdsDxe: loading Boot0001 "UEFI BHYVE SATA DISK BHYVE-3609-D803-384E" from
PciRoot(0x0)/Pci(0x3,0x0)/Sata(0x0,0xFFFF,0x0)
BdsDxe: starting Boot0001 "UEFI BHYVE SATA DISK BHYVE-3609-D803-384E" from
PciRoot(0x0)/Pci(0x3,0x0)/Sata(0x0,0xFFFF,0x0)
Reset System
---

Exit code is 0.

3. I run exactly the same command for the second time:

sudo bhyve -c 2 -m 4096 -A -I -u -H -P -s 0:0,hostbridge -l
bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -s 1:0,lpc -s
3:0,ahci,hd:/data/img/ubuntu.img -s 5:0,fbuf,tcp=3D127.0.0.1:5905 -l com1,s=
tdio
-l tpm,swtpm,/var/run/swtpm/tpm ubuntu

System boots fine. TPM device is visible inside of the VM.=20

> 2. Use a hardware TPM if possible to make sure it's not swtpm related.

Unfortunately, I don't have hardware TPM.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-287326-27103-Q6k5He6nSA>