TPM emulator state contains sensitive data that can be encrypted thanks to swtpm support. A proposal from Stefan Berger ([libvirt] Encrypted vTPM state) is to use an XML similar to luks and the virSecret object framework: <tpm model='tpm-tis'> <backend type='emulator' version='2.0'> <encryption format='vtpm'> <secret type='passphrase' uuid='32ee7e76-2178-47a1-ab7b-269e6e348015'/> </encryption> </backend> </tpm>
Fixed in v5.6.0 (2019-08-05) Support encrypted soft TPM A soft TPM backend could be encrypted with passphrase. Now libvirt supports using a secret object to hold the passphrase, and referring to it via the encryption element of the TPM device.