


While support for attaching devices over USB/IP exists in Linux (a client), there was no corresponding server support for USB/IP in Windows.This simplifies setup in WSL and avoids requiring users to build the kernel themselves. We updated the configuration options for the WSL Linux kernel to enable USB/IP support.Code for USB/IP support has existed in the Linux kernel since 2009, but several recent changes made it easier to use in WSL. This functionality takes advantage of the USB/IP protocol to forward USB traffic over the virtual network interface between Windows and WSL. Once you are done using the device in WSL, you can either physically disconnect the device or run this command from an administrator command prompt on Windows. Note that depending on your application, you may need to configure udev rules to allow non-root users to access the device. You should see the device you just attached and be able to interact with it using normal Linux tools. usbipd wsl attach -busid įrom within WSL, run lsusb to list the attached USB devices. You’ll be prompted by WSL for a password to run a sudo command. Select the bus ID of the device you’d like to attach to WSL and run this command. It will list all the USB devices connected to Windows. This will keep the WSL 2 lightweight VM active.įrom an administrator command prompt on Windows, run this command. Attaching a deviceįirst ensure a WSL command prompt is open.

Sudo update-alternatives -install /usr/local/bin/usbip usbip /usr/lib/linux-tools/5.4.0-77-generic/usbip 20Īt this point a service is running on Windows to share USB devices, and the necessary tools are installed in WSL to attach to shared devices. On Ubuntu 20.04 LTS, run these commands: sudo apt install linux-tools-5.4.0-77-generic hwdata The instructions below are for Ubuntu - other distributions may require a different usbip client package. Install the latest release of usbipd-win.įrom within WSL, install the user space tools for USB/IP and a database of USB hardware identifiers. You’ll need to be running a WSL 2 distro. Running uname -a from within WSL should report a kernel version of 5.10.60.1 or later.

To get started with this functionality, first ensure you’re running Windows 11 and have installed all WSL updates.
