Use tpm2 tools and tpm2 simulator - tearust/tee-on-mac GitHub Wiki

TMP2.0

Install

wget https://downloads.sourceforge.net/project/ibmswtpm2/ibmtpm1563.tar.gz
mkdir ibmtpm
cd ibmtpm
tar -xavf ../ibmtpm1563.tar.gz
cd src
make

Start

./tpm_server &
TPM command server listening on port 2321
Platform server listening on port 2322

tpm2-tools

Under ubuntu

sudo apt -y update

sudo apt -y install \
  autoconf-archive \
  libcmocka0 \
  libcmocka-dev \
  procps \
  iproute2 \
  build-essential \
  git \
  pkg-config \
  gcc \
  libtool \
  automake \
  libssl-dev \
  uthash-dev \
  autoconf \
  doxygen \
  libjson-c-dev \
  libini-config-dev \
  libcurl4-openssl-dev \
  uuid-dev \
  libgcrypt-dev

# install package manager deps for tools
sudo apt install lcov pandoc autoconf-archive

# install package manage deps for tss
sudo apt install liburiparser-dev

# install package manager deps for abrmd
# Note: the dbus-x11 dependency is for dbus-launch not for abrmd itself.
sudo apt install libdbus-1-dev libglib2.0-dev dbus-x11

# install TSS itself
git clone https://github.com/tpm2-software/tpm2-tss.git
cd tpm2-tss
./bootstrap
./configure --enable-unit
make check
sudo make install
sudo ldconfig

# Install abrmd itself
git clone https://github.com/tpm2-software/tpm2-abrmd.git
cd tpm2-abrmd
./bootstrap
./configure --enable-unit --with-dbuspolicydir=/etc/dbus-1/system.d
dbus-launch make check
sudo make install

# Install tools itself
git clone https://github.com/tpm2-software/tpm2-tools.git
cd tpm2-tools
./bootstrap
./configure --enable-unit
make check
sudo make install

Hello world

sudo root
tpm2-abrmd --allow-root --tcti=mssim

# new terminal
tpm2_pcrread