Skip to content

Instantly share code, notes, and snippets.

@rikka0w0
Last active February 27, 2026 06:31
Show Gist options
  • Select an option

  • Save rikka0w0/5a1dd9891efe6a7046ef879c3f3be879 to your computer and use it in GitHub Desktop.

Select an option

Save rikka0w0/5a1dd9891efe6a7046ef879c3f3be879 to your computer and use it in GitHub Desktop.
Enable USBIP on WSL2 (Ubuntu)
# You can also skip the following by downloading kernel modules from the attachments
# Install the build dependencies:
sudo apt install build-essential flex bison dwarves libssl-dev libelf-dev cpio qemu-utils libncurses-dev bc
# Get kernel source:
git clone https://github.com/microsoft/WSL2-Linux-Kernel.git
# Check your kernel version
uname -r
# Example output:
# 6.6.87.2-microsoft-standard-WSL2
# Checkout the correct kernel version (6.6.87.2 in this case)
git checkout linux-msft-wsl-6.6.87.2
# Confirm kernel version:
cat Microsoft/config-wsl | grep CONFIG_LOCALVERSION
# Make sure the output contains:
# CONFIG_LOCALVERSION="-microsoft-standard-WSL2"
# Build (can take a lot of time):
make KCONFIG_CONFIG=Microsoft/config-wsl -j$(nproc)
# Copy kernel modules to a folder
make INSTALL_MOD_PATH="$PWD/modules" modules_install
# Install to system:
sudo cp -v $PWD/modules/lib/modules/6.6.87.2-microsoft-standard-WSL2/kernel/drivers/usb/usbip/* /lib/modules/6.6.87.2-microsoft-standard-WSL2/kernel/drivers/usb/usbip/
# Enable USBIP
sudo modprobe vhci-hcd
sudo modprobe usbip-core
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment