Use Debian, Ubuntu seems to be quite outdated (ie. SSH is too old for FIDO2) Install it through M$ shop/whatever
Turning on systemd (source: https://learn.microsoft.com/en-us/windows/wsl/systemd)
At /etc/wsl.conf
:
[boot]
systemd=true
Then restart WSL:
wsl --shutdown
- Forget about mounting Windows bootdrive partition - won't work
Check name of drive in PowerShell using wmic
:
wmic diskdrive list brief
Caption DeviceID Model Partitions Size
SanDisk Extreme USB Device \\.\PHYSICALDRIVE1 SanDisk Extreme USB Device 2 64017354240
HFM001TD3JX013N \\.\PHYSICALDRIVE0 HFM001TD3JX013N 8 1024203640320
Mount to WSL:
wsl --mount \\.\PHYSICALDRIVE1
dmesg
should show new drive/partitions
Passthrough using usbip
(source: https://learn.microsoft.com/en-us/windows/wsl/connect-usb)
Install USBIPD-WIN:
winget install --interactive --exact dorssel.usbipd-win
List USB devices:
>usbipd list
Connected:
BUSID VID:PID DEVICE STATE
1-1 1050:0407 Urządzenie wejściowe USB, Czytnik Microsoft Usbccid Smart... Shared
1-3 0b05:19b6 Urządzenie wejściowe USB Not shared
Then attach to USB key on host ie. (need admin rights):
usbipd bind -b 1-1
And attach this to WSL (done automagically no need for usbip magic in WSL guest):
usbipd attach --wsl --busid 1-1
usbipd: info: Using WSL distribution 'Debian' to attach; the device will be available in all WSL 2 distributions.
usbipd: info: Using IP address 172.25.224.1 to reach the host.