Skip to content

Emulated tpm under qemu doesn't work under windows anymore #1069

@webczat

Description

@webczat

Describe the bug

I admit I don't know whether this could possibly be a qemu bug or swtpm bug, and that configuration has worked before. I don't know which component update caused this
So generally, suddenly my windows vm that had bitlocker enabled stopped booting and asked for recovery key. After I disabled bitlocker and tried to reenable, I noticed that windows doesn't see a tpm beingpresent.
When I went to device manager: I saw the tpm module, but in properties something like: (this string is localized so unable to translate exactly):

Unable to start this device (code 10)

Protocol error has been detected

I have enabled debug logging, but this doesn't show enough information. I need some directions how to make it work, will attach debug logs (level 5) below.

Required: To Reproduce (without these steps your issue may be deleted)

Steps to reproduce the behavior/issue showing all commands on command line, needed XML or JSON (if necessary), etc.:

  1. Create virtual machine with emulated tpm 2.0 (type crb or tis, doesn't matter) with default backend settings.
  2. Install windows 11
  3. Observe on the installed system whether tpm is present. If not, it might be installation will actually fail.

Expected behavior

I would expect tpm to be properly detected and working.

Desktop (please complete the following information):

  • OS: Fedora
  • Version 42

Versions of relevant components

  • swtpm: 0.10.1
  • libtpms: 0.10.1
  • openssl: 3.2.6
  • gnutls: 3.8.10
  • ...:

Log files
Please attach any log files. If using a VM and it was started with libvirt, attach the logfile found in /var/log/swtpm/libvirt/qemu/VM-NAME-swtpm.log.

win11-swtpm.log

Additional context

I have tried switching profiles between default-v1 and null, of course removing tpm state when changing them. No luck.
Also, sometimes, rarely, the tpm seems to be detected and work. But it's likely random.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EDK2Issue with EDK2

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions