1

I am trying to use tpm2-tools on ubuntu 16.04 (I have this kernel version 4.15.0-54-generic)

To install tpm2-tools i did apt-get install tpm2-tools

I have TPM2.0 hardware and i can see that on my machine

$ ls -l /dev/tpm*
crw------- 1 root root  10,   224 Sep 18 08:12 /dev/tpm0
crw------- 1 root root 253, 65536 Sep 18 08:12 /dev/tpmrm0

However, i'm unable to do any tpm operations

$ tpm2_getrandom -s 20 -o random.out
Resource Mgr, resMgr, failed initialization: 0x1.  Exiting...

Can anyone point me to the right direction here?

tpm2-tools details

$ sudo apt-cache show tpm2-tools
Package: tpm2-tools
Priority: optional
Section: universe/utils
Installed-Size: 964
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Version: 1.0.0+20160226.64b3334-0ubuntu2
Depends: libc6 (>= 2.14), libcurl3 (>= 7.16.2), libssl1.0.0 (>= 1.0.0), libtss2-0, libtss2-utils
Filename: pool/universe/t/tpm2-tools/tpm2-tools_1.0.0+20160226.64b3334-0ubuntu2_amd64.deb
Size: 90006
MD5sum: 2a5dd741bab5ba886508b87559d1151d
SHA1: 65c4f508b8643d808eb28e481dc660a68a0aba3d
SHA256: a8127c59b2ac7520f8f8993e9849f9dcc46486bced2f4b54c7fef56ac8e3b59e
Description-en: TPM 2.0 utilities
 This package contains a set of tools to use with TPM 2.0 chips,
 for common tasks and features provided by the hardware; such as
 for doing basic key management, attestation, encryption and signing.
Description-md5: 7dab290b7414623bbe70b4f8bc047903
Homepage: https://github.com/01org/tpm2.0-tools
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

EDIT:

setting the in-kernel resource manager for tpm2-tools by running

export TPM2TOOLS_TCTI="device:/dev/tpmrm0"

Didn't help either, got same error

Bad_Coder
  • 121

1 Answers1

1

There's a binary resourcemgr, nowhere to be documented, it is a part of a dependent package(libtss2-utils) of tpm2-tools. Found it here

we need to start the resourcemgr service before running the tpm2 commands

systemctl start tpm2-resourcemgr or /usr/sbin/resourcemgr &

Bad_Coder
  • 121