Last active
February 27, 2026 06:31
-
-
Save rikka0w0/5a1dd9891efe6a7046ef879c3f3be879 to your computer and use it in GitHub Desktop.
Enable USBIP on WSL2 (Ubuntu)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file has been truncated, but you can view the full file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment