In testing under a Linux VM I've come across a VERY reproduceable problem with using SmartCards (in particular PIV).
Readers that can return a list of their speeds will fail before even getting to see a card
When reading data from a PIV (particularly large data objects using extended APDU), the usb layer will fail
Both of these errors state that the USB device suddenly became unavailable and recovery may or may not occur.
Attached is sample code that will compile under Linux w/ GCC if you have the pcsc-lite development libraries.
Affected VMWare hosts:
Affected Linux guests:
Distros tested: Gentoo, Ubuntu, Fedora
PC/SC Lite version independent
Multiple kernels under one distro tested
Both bleeding-edge and stable libusb tested
Known Affected VMWare Software:
VMWare Player 2 and 2.5
VMWare Workstation 6
VMWare Server
This is not using the Virtual SmartCard layer that passes an emulated CCID device to the OS (which doesn't work in Linux, even with the vendor/product added to PC/SC).
Readers tested:
Many PIV vendors' cards were tested...
Compile test tool w/ command like:
gcc -o pcsc_get_data -I /usr/include/PCSC -lpcsclite pcsc_get_data.c
./pcsc_get_data
The utility will use the first reader, wait til a card is inserted (or use already-inserted), select the PIV applet, read the PIV Auth cert off of it.