Last active
February 22, 2022 21:38
-
-
Save lukehinds/f7338fe3bd13687e2600fa70a2055e1c to your computer and use it in GitHub Desktop.
vtpm.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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