PIVert icon indicating copy to clipboard operation
PIVert copied to clipboard

Failed to connect to Virtual Smart Card, is the driver installed?

Open rweijnen opened this issue 1 year ago • 4 comments

The following happens on Server 2019 (build 17763.2931).

  • I have installed using PIVert.exe install
  • In device manager I can see the "Bix Virtual Smart Card Reader"
  • when calling PIVert.exe mypfx password I get the following error:

[!] Failed to connect to Virtual Smart Card, is the driver installed?

When installing the driver again, I get slightly different behaviour:

[=] Connected to Smartcard Event Pipe
[+] Connected Virtal Smart Card Driver
[+] Virtual card inserted
[=] Press ESC to exit, or any other key to remove and reinsert the virtual card?
[=] Unsupported INS ca with CLA 0
[=] Unsupported INS ca with CLA 0
[+] Virtual card removed
[+] Virtual card inserted```

However when I start an RDP connection it doesn't give me access to a smartcard nor is there a smart card visible in device manager (just the smart card reader)

I can see the following in the eventlog:
Could not get device ID for smart card in reader Virtual Smart Card Pipe Reader 0. The return code is 2148532239. (https://www.magnumdb.com/search?q=0x8010000F -> SCARD_E_PROTO_MISMATCH)

and 

Smart Card Reader 'Virtual Smart Card Pipe Reader 0' rejected IOCTL SET_PROTOCOL: The request is not supported.  If this error persists, your smart card or reader may not be functioning correctly.

Command Header: 03 00 00 00

rweijnen avatar Aug 31 '22 15:08 rweijnen

The README mentions this issue, there is some kind of race condition in the driver. Sometimes you have to virtually remove and reinsert the card by pressing any key, or sometimes restarting PIVert works too. You'll know when it works as you'll see PIV data objects being read by Windows

CCob avatar Sep 08 '22 21:09 CCob

Yes on a (physical) windows 10 machine it does indeed work, with sometimes needing a retry by pressing a key. On server 2019 it never works, no matter how often I retry. Not sure if relevant but the servers are EC2 instances that I connect to over RDP

rweijnen avatar Sep 11 '22 18:09 rweijnen

Hi,

I have the same issues as described here.

  • Installation not working, error "[!] Failed to connect to Virtual Smart Card, is the driver installed?". This I can "solve" by installing the driver again. This happens on both a virtual and a physical Windows 10 machine.

  • The certificate is not found when using RDP. This happens on a virtual Windows 10 machine but works on a physical Windows 10 machine.

I all cases both the virtual smartcard reader and the certificate are visible in Device Manager. I have not tried Server 2019 since I need this on a workstation. I am using VirtualBox for the VMs.

I hope this can help in solving this issue!

jsdhasfedssad avatar Oct 04 '22 11:10 jsdhasfedssad

At the moment I am at the mercy of the 3rd party driver, and there does appear to be some bugs with the installer and the driver itself. Installing twice seems to resolve the installer issue, but I still have the issue where the virtual card is sometimes not read correctly. If I get the time I will try and look at the 3rd party driver code, but no promises sorry

CCob avatar Nov 09 '22 08:11 CCob