Issues with simtrace2-remsim Communication and Integration with Virtual Smart Card

I am working with simtrace2 and have installed simtrace2-remsim on my server. I’m trying to establish a communication link with the reader:

Reader 2: HID Global OMNIKEY 3x21 Smart Card Reader [OMNIKEY 3x21 Smart Card Reader] 00 00
Event number: 9
Card state: Card inserted,

My goal is to transmit data using:

$ ./simtrace2-remsim --usb-vendor 1d50 --usb-product 60e3 --usb-path 1-1.3 --usb-config 1 --pcsc-reader-num 2

I want to observe the communication data. However, when I insert the card into the device (whether a phone or any other device), the program crashes, and I receive the error:

Entering main loop
BULK IN transfer error; rc=-9

This results in the program closing and terminating:

who@ubuntu:~/simtrace2-hoernchen-simtrace_cardem/host/src$ ./simtrace2-remsim --usb-vendor 1d50 --usb-product 60e3 --usb-path 1-1.3 --usb-config 1 --pcsc-reader-num 2
simtrace2-remsim - Remote SIM card forwarding
(C) 2010-2017, Harald Welte <>
(C) 2018, sysmocom -s.f.m.c. GmbH, Author: Kevin Redon <>

Vendor ID: 7504, Product ID: 24803, Config ID: 1, Interface Num: 0, Altsetting: 0, Addr: 255
<- 01 05 00 00 00 00 09 00 01
<- 02 02 00 00 00 00 09 00 01
<= osmo_st2_cardem_request_set_atr(3b 80 80 81 1f c7 59 )
<- 01 02 00 00 00 00 10 00 07 3b 80 80 81 1f c7 59
<- 02 01 00 00 00 00 0b 00 02 2c 01
Entering main loop
BULK IN transfer error; rc=-9

My primary questions are:

  1. Which firmware should I use for this setup?
  2. Which version of simtrace2-remsim (i use something like: simtrace2-hoernchen-simtrace_cardem from github) is best suited for this purpose?

Ideally, I’d like to get simtrace2-remsim working with Virtual Smart Card. However, when I try to set up the virtual smart card, it seems not to detect the card at all, with an “unknown control command” message.

who@ubuntu:~/apdu-trace$ env PYTHONPATH=/usr/lib/python3/site-packages/virtualsmartcard python3 ./ -r 2
unknown control command

Has anyone encountered a similar issue or have insights on integrating simtrace2-remsim with Virtual Smart Card? Any help or guidance would be greatly appreciated.

this looks all rather strange.

In terms of firmware and host software versions, please always use the official sources linked from the sidebar top section of Wiki - SIMtrace 2 - Open Source Mobile Communications which links to source code, binary packages, etc. rather than some fork/version on github. The fact that there is “hoernchen” in the name doesn’t sound like it’s an official build/source.

Please also make sure to describe your full setup, including the operating system, whether you use any kind of virtualization technique, and whether you’ve tried only one specific phone/SIM or a variety of them.

In any case the low-level USB error looks rather serious, but let’s wait until you are using official latest or nightly packages + firmware builds.