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.
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.