ConfiguringWindows Subsystem Linux (WSL) to access USB devices.

Been a minute!

Here’s a quick walkthrough to setting up USB device sharing for your WSL distro.

I know it’s nothing fancy but I’m happy to be back to making some posts. Should be many more to come. TBH, I’m not a huge fan of WSL for daily use I prefer full VMs but a driver for a device I was messing with was giving such headaches I got this going instead.

Just to run through it, you can list the distros currently installed with:

wsl -l 

To isntall a new distro you can use the following command:

wsl --install -d Ubuntu-22.04

Now lets install the usbipd application from HERE

Next lets open an administrative PowerShell terminal and check that it installed properly:

usbipd list

This should return a list of USB devices like:

Now lets bind the USB device you want to share

usbipd bind --busid 1-5

It’s ok if you see the USBPcap error, no worries.

Now lets attach the device to the WSL distro:

usbipd attach --wsl --busid 1-5

Now enter the VM and list the USB devices attached:

lsusb

And you should now see the USB device.

Note that while the device is attached to the WSL distro, you won’t be able to use it with the host.

So to detach the USB device use thje following command:

usbipd detach --busid 1-5

Enjoy!

Sources: 1 2

END TRANSMISSION

Leave a Reply