trustcrypto/onlykey-agent

Does not work with WSL2 usbipd-win workaround

Closed this issue · 1 comments

There is a recent workaround published for enabling USB passthrough to WSL using usbipd-win as outlined here: https://devblogs.microsoft.com/commandline/connecting-usb-devices-to-wsl/

using usbipd-win 1.2.0 I was able to connect my onlykey to WSL2. Doing lsusb from within WSL lists the onlykey as a device. However, when I attempt to connect to it using the onlykey-agent I get connection errors as demonstrated below:

onlykey-agent git@github.com > ~/.ssh/github.pub
2021-12-19 09:45:27,574 ERROR        failed to connect
                  [client.py:203]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/onlykey/client.py", line 194, in _connect
    self._hid.open_path(self.path)
  File "hid.pyx", line 125, in hid.device.open_path
OSError: open failed
2021-12-19 09:45:29,127 ERROR        failed to connect
                  [client.py:203]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/onlykey/client.py", line 194, in _connect
    self._hid.open_path(self.path)
  File "hid.pyx", line 125, in hid.device.open_path
OSError: open failed
2021-12-19 09:45:30,652 ERROR        failed to connect
                  [client.py:203]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/onlykey/client.py", line 194, in _connect
    self._hid.open_path(self.path)
  File "hid.pyx", line 125, in hid.device.open_path
OSError: open failed
2021-12-19 09:45:32,172 ERROR        failed to connect
                  [client.py:203]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/onlykey/client.py", line 194, in _connect
    self._hid.open_path(self.path)
  File "hid.pyx", line 125, in hid.device.open_path
OSError: open failed
2021-12-19 09:45:33,728 ERROR        failed to connect
                  [client.py:203]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/onlykey/client.py", line 194, in _connect
    self._hid.open_path(self.path)
  File "hid.pyx", line 125, in hid.device.open_path
OSError: open failed
2021-12-19 09:45:35,230 ERROR        Connection error (try unplugging and replugging your device): {} not connected: "{}"                 [__init__.py:187]

I am closing this issue because I think it has to do with the WSL Kernel not including proper USB drivers by default and not an issue with the onlykey agent itself. See docs here about compiling new kernel for WSL2: https://github.com/dorssel/usbipd-win/wiki/WSL-support.