ls -ls /dev/tpm*

ls -ls /dev/tpm*

你好,我想在 kvm 上安装 Windows 11。

我的系统上启用了 tpm。ubuntu 21.04(qemu 5.2+dfsg-9ubuntu3.1)

ls -ls /dev/tpm*

0 crw-rw-rw- 1 root root  10,   224 Sep 25 18:18 /dev/tpm0
0 crw-rw-rw- 1 tss  tss  253, 65536 Sep 25 18:18 /dev/tpmrm0

w11 xml 文件包含直通代码:

<tpm model="tpm-tis">
  <backend type="passthrough">
    <device path="/dev/tpm0"/>
  </backend>
</tpm>

启动虚拟机时出现以下错误:

Unable to complete install: 'internal error: qemu unexpectedly closed the monitor: 2021-09-26T06:28:55.041197Z qemu-system-x86_64: -tpmdev passthrough,id=tpm-tpm0,path=/dev/fdset/3,cancel-path=/dev/fdset/4: '/dev/fdset/3' is not a TPM device.'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/createvm.py", line 2001, in _do_async_install
    installer.start_install(guest, meter=meter)
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 701, in start_install
    domain = self._create_guest(
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 649, in _create_guest
    domain = self.conn.createXML(install_xml or final_xml, 0)
  File "/usr/lib/python3.9/site-packages/libvirt.py", line 4376, in createXML
    raise libvirtError('virDomainCreateXML() failed')
libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: 2021-09-26T06:28:55.041197Z qemu-system-x86_64: -tpmdev passthrough,id=tpm-tpm0,path=/dev/fdset/3,cancel-path=/dev/fdset/4: '/dev/fdset/3' is not a TPM device.

关于如何正确地将 tpm 传递给 vm 有什么想法吗?

谢谢

答案1

我遇到了同样的错误。

我参考了下一个网页并发现 Apparmor 出现了这个问题。

/dev/tpm0 rw,在 /etc/apparmor.d/abstractions/libvirt-qemu 中添加了以下内容/dev/net/tun rw,(注意,),然后重新启动了 apparmor。错误对话框不会显示。

我希望这会有所帮助。

参考升级到 Windows 11 需要满足以下条件 https://arstechnica.com/gadgets/2021/06/heres-what-youll-need-to-upgrade-to-windows-11/?utm_brand=arstechnica&utm_source=twitter&utm_social-type=owned&utm_medium=social

相关内容