Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
vtpm.md
# On the host
```
# dnf install libtpms swtpm swtpm-tools
# modprobe tpm_vtpm_proxy
# mkdir /tmp/my_vtpm
# swtpm chardev --tpm2 --vtpm-proxy --tpmstate dir=/tmp/my_vtpm -d
New TPM device: /dev/tpm1 (major/minor = 253/1)
# container_id=$(mktemp)
# docker run -td --privileged -v /dev/tpm1:/dev/tpm0 $image-name > ${container_id}
# docker exec -u 0 -it --tty "$(cat ${container_id})" /bin/bash
```
# Inside the container
```
# dnf install tpm2-tools tpm2-tss
# export TPM2TOOLS_TCTI=device:/dev/tpmrm0
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment