Qrexec remoting of pkcs11

hello
i am trying to call remote pkcs11 service via qrexec. i believe it worked with a different smart card before, but i changed it and it works no more (trying with yubikey now)
i call qrexec-client-vm to liteqube.pkcs11 from p11-kit-client.so module, and on the smartcard side i run “p11-kit remote /usr/lib64/opensc-pkcs11.so”.

If I do it on the same vm (no qrexec, just running the same command line from the module definition), everything works, but if i try to wrap it to qrexec socket, i get random failures in the middle on operation – some operations succeed, some fail.

I suspected premature socket close and added sleep 1 at the end of the service, but it changed nothing.

Very wild guess but it might be interactive shell session, or Io handling or environment variable that is different through qrexec calls.

Both are unlikely to be relevant. But socket sharing works, unlike this (as i did it in first version of split-pkcs11), but i do not want to go back to socket sharing, i want to find the root cause and fix it properly (I found that sockets tend to stuck sometimes in open state, and remote module provides atomic state for transactions)

Oh fuck. That’s unexpected.