rpasek / usbip-wsl2-instructions

355 stars 37 forks source link

Thanks - precompiled wsl ubuntu usb kernels now available #26

Open andrewleech opened 3 years ago

andrewleech commented 3 years ago

Hi just wanted to say thanks for your instructions, they were a huge help.

I've set up a gitlab ci auto-building project which should now automatically build any new tagged kernel releases from the WSL official repo with all the USB drivers compiled in. I ended up compiling them directly in rather than as modules because I couldn't find a simple way to get the modules to auto-load at wsl startup (without needing a full systemd install which is a bit of a pain).

For anyone who wants USB kernels on their WSL ubuntu, you can download pre-compiled copies here: https://gitlab.com/alelec/wsl2-usb-kernel/-/releases

The zip package attached to each release contains three deb files and an install script, which will handle installing the deb packages as well as configuring the .wslconfig file automatically to use it. Just cd into the extracted zip folder and run bash ./install.sh

If you find it interesting / useful I'd be more than happy for you to include in your readme but no pressure, really just wanted to share my thanks.

Cheers, Andrew

mx0c commented 2 years ago

Hi, thank you for providing the prebuild kernels. I was able to correctly install the Kernel and load all the modules that are stated in the readme of this repo. However i cannot use the usbip command. It tells me WARNING: usbip not found for kernel 5.10.16.3-microsoft Let me know if you have a solution to my problem.

andrewleech commented 2 years ago

@mx0c to be honest I've been using the kernel vhci support for virtualhere rather than usbip so hadn't run into this.

I've enabled a couple more usbip config settings in the kernel, could you try this new build? https://gitlab.com/alelec/wsl2-usb-kernel/-/releases/linux-msft-wsl-5.10.16.3.2

mx0c commented 2 years ago

sadly it didn't work. I also tried to compile and install the USBIP module according to this: https://raw.githubusercontent.com/TheProgramableTurtle/Files/master/build_usbip.sh now im getting a different error: usbip: error while loading shared libraries: libusbip.so.0: cannot open shared object file: No such file or directory Thanks for your effort.

andrewleech commented 2 years ago

I've just tried myself, is this the full message you saw initially?

WARNING: usbip not found for kernel 5.10.16.3-microsoft

  You may need to install the following packages for this specific kernel:
    linux-tools-5.10.16.3-microsoft-standard-WSL2+
    linux-cloud-tools-5.10.16.3-microsoft-standard-WSL2+

  You may also want to install one of the following packages to keep up to date:
    linux-tools-standard-WSL2+
    linux-cloud-tools-standard-WSL2+

It looks like there's an extra package that needs to be compiled, not just different kernel config settings.

mx0c commented 2 years ago

Yes, that is the error message i also got. I thought so too but couldn't find any information about theses packages and how to install them.

mx0c commented 2 years ago

Copying the built libs to /lib: cd tools/usb/usbip && cp libsrc/.libs/libusbip.so.0 /lib/libusbip.so.0 solved my problem. Thank you for your help. :)