Hi Marcandre,
Thanks for your command steps and I tried them, but my qemu failed to connect
the socket tpmemu.sock. When I added the control channel to the TPM, the swtpm
socket command stuck there and never exit. Not sure whether it was successful.
Below are the command steps running output in my side
Then you can run:
mkdir tpmstatedir
swtpm_setup.sh --tpm2 --tpm-state tpmstatedir
$ swtpm_setup.sh --tpm2 --tpm-state tpmstatedir
Starting vTPM manufacturing as jshi19:jshi19 @ 2018年03月09日 星期五 10时28分39秒
TPM is listening on TCP port 47364.
Successfully authored TPM state.
Ending vTPM manufacturing @ 2018年03月09日 星期五 10时28分39秒
Run the emulator:
swtpm socket --tpmstate dir=tpmstatedir --ctrl type=unixio,path=tpmemu.sock
--tpm2
$ swtpm socket --tpmstate dir=tpmstatedir --ctrl type=unixio,path=tpmemu.sock
--tpm2
(the swtpm socket command stuck there and never exit)
Run qemu (from git) with ovmf (with this series):
qemu ... -chardev socket,id=chrtpm,path=tpmemu.sock -tpmdev
emulator,id=tpm0,chardev=chrtpm -device tpm-crb,tpmdev=tpm0
-drive if=pflash,format=raw,file=OVMF_CODE.fd,readonly -drive
if=pflash,format=raw,file=OVMF_VARS.fd ..
$ qemu-system-x86_64 -serial file:serial.log -m 5120 -hda fat:. -monitor stdio
--enable-kvm -smp 4 -bios ../Ovmf3264/NOOPT_GCC5/FV/OVMF.fd -chardev
socket,id=chrtpm,path=tpmemu.sock -tpmdev emulator,id=tpm0,chardev=chrtpm
-device tpm-crb,tpmdev=tpm0
qemu-system-x86_64: -chardev socket,id=chrtpm,path=tpmemu.sock: Failed to
connect socket tpmemu.sock: No such file or directory