Swtpm usage

How can one properly use swtpm?

Running the swtpm command in above link just starts the process and creates the socket… but what else? There’s no output in prompt, until I kill it with Ctrl+C. I know I can use the “-d” option to daemonize it, but then how to properly end the process? If the Windows VM is shutdown there’s no reason for any swtpm process to be running anymore.

From the man page:

-t|--terminate: Terminate the TPM after the client has closed the connection.

Which client?

The swtpm process can be gracefully terminated by sending a SIGTERM signal to it.

Sigterm signal?

Thanks.

Hi
With the kill command (kill -l 15 is SIGTERM);


kill -15 `pidof swtpm`

What are you using to manage your VM? Are you using raw qemu commands? Because in case of libvirt swtpm is started and stopped automatically if it is present in guest definition.

Using raw QEMU. But I already realized it. Thanks.