nokia / TPMCourse

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could not initialize TCTI on ubuntu 20.04

Eremiel opened this issue · comments

I am using default installation of ubuntu with Docker version 20.10.12, build 20.10.12-0ubuntu2~20.04.1.
Following the installation guide container fails tu run with:

root@wiktor:/TPMCourse/alpine# docker run -it tpmcourse:latest
/ # LIBRARY_COMPATIBILITY_CHECK is ON
Manufacturing NV state...
Size of OBJECT = 2600
Size of components in TPMT_SENSITIVE = 1096
    TPMI_ALG_PUBLIC                 2
    TPM2B_AUTH                      66
    TPM2B_DIGEST                    66
    TPMU_SENSITIVE_COMPOSITE        962
Starting ACT thread...
TPM command server listening on port 2321
WARNING:tcti:src/util/io.c:252:socket_connect() Failed to connect to host ::1Command IPv4 client accepted
Platform server listening on port 2322
, port 2322: errno 99: Address not available
WARNING:tcti:src/tss2-tcti/tctildr.c:79:tcti_from_init() TCTI init for function TPM command server listening on port 2321
0x7fc23258d620 failed with a000a
WARNING:tcti:src/tss2-tcti/tctildr.c:109:tcti_from_info() Could not initialize TCTI named: tcti-socket
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:154:tcti_from_file() Could not initialize TCTI file: mssim
ERROR:tcti:src/tss2-tcti/tctildr.c:416:Tss2_TctiLdr_Initialize_Ex() Failed to instantiate TCTI

** (tpm2-abrmd:10): CRITICAL **: 10:54:01.134: init_thread_func: failed to create TCTI with conf "mssim", got RC: 0xa000a

(tpm2-abrmd:10): GLib-GIO-CRITICAL **: 10:54:01.135: g_bus_unown_name: assertion 'owner_id > 0' failed
^C

Container does not stop so I am able to ctrl+c from the process, but services are not working:

/ # tpm2_getrandom 32 --hex

** (process:24): CRITICAL **: 10:56:27.710: failed to allocate dbus proxy object: Error calling StartServiceByName for com.intel.tss2.Tabrmd: Cannot do system-bus activation with no user

WARNING:tcti:src/tss2-tcti/tctildr.c:79:tcti_from_init() TCTI init for function 0x7f3e1b67c45f failed with a0008
WARNING:tcti:src/tss2-tcti/tctildr.c:109:tcti_from_info() Could not initialize TCTI named: tcti-abrmd
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:154:tcti_from_file() Could not initialize TCTI file: libtss2-tcti-tabrmd.so.0
ERROR:tcti:src/tss2-tcti/tcti-device.c:451:Tss2_Tcti_Device_Init() Failed to open specified TCTI device file /dev/tpmrm0: No such file or directory
WARNING:tcti:src/tss2-tcti/tctildr.c:79:tcti_from_init() TCTI init for function 0x7f3e1b1d94b0 failed with a000a
WARNING:tcti:src/tss2-tcti/tctildr.c:109:tcti_from_info() Could not initialize TCTI named: tcti-device
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:154:tcti_from_file() Could not initialize TCTI file: libtss2-tcti-device.so.0
ERROR:tcti:src/tss2-tcti/tcti-device.c:451:Tss2_Tcti_Device_Init() Failed to open specified TCTI device file /dev/tpm0: No such file or directory
WARNING:tcti:src/tss2-tcti/tctildr.c:79:tcti_from_init() TCTI init for function 0x7f3e1b1d94b0 failed with a000a
WARNING:tcti:src/tss2-tcti/tctildr.c:109:tcti_from_info() Could not initialize TCTI named: tcti-device
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:154:tcti_from_file() Could not initialize TCTI file: libtss2-tcti-device.so.0
Command IPv4 client accepted
TPM command server listening on port 2321
Platform IPv4 client accepted
Unrecognized platform interface command 00000005
Platform server listening on port 2322
ERROR:tcti:src/tss2-tcti/tcti-swtpm.c:222:tcti_control_command() Control command failed with error: 1
ERROR:tcti:src/tss2-tcti/tcti-swtpm.c:330:tcti_swtpm_set_locality() Failed to set locality: 0xa000a
WARNING:tcti:src/tss2-tcti/tcti-swtpm.c:599:Tss2_Tcti_Swtpm_Init() Could not set locality via control channel: 0xa000a
WARNING:tcti:src/tss2-tcti/tctildr.c:79:tcti_from_init() TCTI init for function 0x7f3e1b1cf810 failed with a000a
WARNING:tcti:src/tss2-tcti/tctildr.c:109:tcti_from_info() Could not initialize TCTI named: tcti-swtpm
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:154:tcti_from_file() Could not initialize TCTI file: libtss2-tcti-swtpm.so.0
Command IPv4 client accepted
Platform IPv4 client accepted
WARNING:esys:src/tss2-esys/api/Esys_GetCapability.c:303:Esys_GetCapability_Finish() Received TPM Error
ERROR:esys:src/tss2-esys/api/Esys_GetCapability.c:107:Esys_GetCapability() Esys Finish ErrorCode (0x00000100)
ERROR: Esys_GetCapability(0x100) - tpm:error(2.0): TPM not initialized by TPM2_Startup or already initialized
ERROR: Unable to run tpm2_getrandom
Platform server listening on port 2322
TPM command server listening on port 2321
/ #

Not sure what helped, upgrading kernel from 5.4.0-124 to 5.4.0-137 or rebooting the machine. But it works now.

wiktor@wiktor:~/TPMCourse/alpine$ sudo docker run -it tpmcourse:latest
[sudo] password for wiktor:
/ # LIBRARY_COMPATIBILITY_CHECK is ON
Manufacturing NV state...
Size of OBJECT = 2600
Size of components in TPMT_SENSITIVE = 1096
    TPMI_ALG_PUBLIC                 2
    TPM2B_AUTH                      66
    TPM2B_DIGEST                    66
    TPMU_SENSITIVE_COMPOSITE        962
Starting ACT thread...
TPM command server listening on port 2321
Platform server listening on port 2322
Command IPv4 client accepted
Platform IPv4 client accepted

/ # tpm2_getrandom --hex 32
5b7677d80c2a794c3146ea1fb3305c7130b5c8bedd1c7405d6aa7322e336eb56/ #

Closing the issue.