USB passthrough under WSL

If USB devices such as Logiwheel or Joystick need to be accessed in the SimWB WSL image, you need to passthrough these devices.

USB passthrough under WSL

Once installed, list the available USB devices with: usbipd list
To forward a USB device to WSL, make sure you select the correct device from its BUSID (-d is optional, specifies the WSL instance to attach to if you have multiple instances running): usbipd wsl attach –b 5-4 (-d wsl-name)
The joystick is not identified as such by the usbipd list command, so it is tricky to pick the right device. You may hang your Windows system if you attach the wrong device. For instance, attaching the Windows keyboard or mouse will render Windows unusable. To fix that unplug the mouse or keyboard and re-plug it in. One way to workaround, you can use the usbid list command before and after connecting the device. That way, you can figure out the right device to attach.
You should be able to see the devices you attached by running dmesg
Once the joystick has been attached to WSL, you must make sure that the joydev kernel driver is loaded: modprobe joydev
You can test the joystick under WSL by running the joystick test under Hardware-Tests/Other project