<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    First, thanks for the help and the swift reply :).<br>
    <br>
    So I should note that the yubikey works fine when accessed directly
    on the host, it only fails in the guest.<br>
    <br>
    The virtualization software used by QubesOS is Xen. However, I found
    out that it uses a "USB proxy"[0] to protect the system from DMA
    attacks. They call it a "USB device passthrough using USBIP as a
    protocol, but qrexec as link layer" (qrexec is qube's cross-vm
    communication layer). What this means is that they tunnel a single
    USB device from the host to the guest using the USBIP protocol
    (instead of assigning the whole bus to the guest).<br>
    <br>
    I tried using usbmon with wireshark as you suggested to find out
    more. The logs of the guest and host are attached (they are the same
    session). I'm not too sure what to make of it though. Clearly, the
    usb doesn't seem to answer in time to the Get Slot Status request.
    It looks like it times out after 100ms in both the guest and the
    host. Is it possible that the USB proxy would add latency, causing
    the timeout ? And if so, how can I increase this timeout ? I figured
    DEFAULT_COM_READ_TIMEOUT is where the timeout is defined, but it is
    specified as 3000ms in the source, whereas I timeout after 100ms, so
    I guess the timeout I'm seeing comes from somewhere else ?<br>
    <br>
    I also have made another wireshark log of what happens in the host
    when accessing the yubikey directly from there (the scenario where
    the yubikey works) in case that's useful.<br>
    <br>
    I'm contacting the Qubes mailing list, maybe they have more insight
    into what their usb proxy entails.<br>
    <br>
    Again, thanks a lot for the help :)<br>
    <br>
    Robin Lambertz<br>
    <br>
    [0]: <a class="moz-txt-link-freetext"
      href="https://github.com/QubesOS/qubes-app-linux-usb-proxy">https://github.com/QubesOS/qubes-app-linux-usb-proxy</a><br>
    <br>
    <div class="moz-cite-prefix">On 02/14/2017 09:48 AM, Maximilian
      Stein wrote:<br>
    </div>
    <blockquote
      cite="mid:63f0b0bb-2326-a400-a7df-ea6b3af91b70@secunet.com"
      type="cite">
      <pre wrap="">On 14.02.2017 01:53, Robin Lambertz wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hello,
</pre>
      </blockquote>
      <pre wrap="">Hi

</pre>
      <blockquote type="cite">
        <pre wrap="">I'm trying to get my Yubikey NEO to work with GPG in an archlinux VM on
Qubes OS. Unfortunately, it seems that PCSCD is unable to work with my
yubikey, it doesn't appear when running pcsc_scan.
</pre>
      </blockquote>
      <pre wrap="">This is probably a problem with your virtualisation software. I've found
that certain constellations of VirtualBox do not play nicely together
with non-mass-storage USB usage.

</pre>
      <blockquote type="cite">
        <pre wrap="">ReadUSB returns immediately with the TIMEOUT error (isn't that weird ?),
</pre>
      </blockquote>
      <pre wrap="">Not at all, the first InterruptRead is just to clear the interrupt
endpoint and therefore has a timeout of only 100ms, which expires in
your logs.

</pre>
      <blockquote type="cite">
        <pre wrap="">while the WriteUSB times out after 5 seconds. I'm not sure what to do to
further debug this. Any hint as to what I could do to figure out where
the issue is coming from ?
</pre>
      </blockquote>
      <pre wrap="">You could try to use a different virtualisation software or version,
updating guest additions (in case of VirtualBox). You could try a newer
kernel in the VM guest or a newer version of libusbx/libusb-1.0.


To further debug the problem you could monitor the USB traffic inside
the guest and on the host via usbmon [1]. Most probably you will see USB
traffic coming back from the device on the host, but not inside the guest.


Best regards and good luck,
Maximilian Stein

[1] <a class="moz-txt-link-freetext" href="https://www.kernel.org/doc/Documentation/usb/usbmon.txt">https://www.kernel.org/doc/Documentation/usb/usbmon.txt</a>

_______________________________________________
Pcsclite-muscle mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Pcsclite-muscle@lists.alioth.debian.org">Pcsclite-muscle@lists.alioth.debian.org</a>
<a class="moz-txt-link-freetext" href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>