Giter Site home page Giter Site logo

Comments (8)

lisbravo avatar lisbravo commented on September 15, 2024 5

I manage to get it working:
-First I just compiled a kernel with ms defaults
sudo make KCONFIG_CONFIG=Microsoft/config-wsl
-Copied
/usr/src/4.19.57-microsoft-standard/arch/x86/boot/compressed/vmlinux.bin
to
C:\Users\lbrav\kernel
-Added a .wslconfig file in C:\Users\lbrav\ with
[wsl2] #kernel=C:\\Users\\lbrav\\kernel\\vmlinux.bin
-Restart WSL
wsl --shutdown wsl -d Ubuntu

from usbip-wsl2-instructions.

Luigi90900 avatar Luigi90900 commented on September 15, 2024 1

Remove the # in front of kernel=C:\...\kernel\vmlinux.bin. The # comments out the line so it gets ignored. I did the same thing before realizing that.

My .wslconfig is:

[wsl2]
kernel=C:\\Users\\Luigi90900\\kernel\\vmlinux.bin
swap=0

from usbip-wsl2-instructions.

rpasek avatar rpasek commented on September 15, 2024

Hi psykhon,
I'm pretty sure it does but I haven't confirmed 100% that it's loading the new kernel. If you look carefully you'll notice that this method is simply modprobing in kernel modules that we've built, not building the drivers into the kernel.

One thing that had me stumped for a while is that WSL 2 seems to only run the exact named version as installed. If you acquired the source using git, if you make changes to files that are not ignored by git, the Linux build process will append a + to the name of the kernel to indicate that your build is dirty. For example you may see at the end of the Linux build:
DEPMOD 4.19.43-microsoft-standard+

To get around this you could do:
sudo make LOCALVERSION= (note my previous edit of this comment is wrong)

I found this information on https://stackoverflow.com/questions/19333918/dont-add-to-linux-kernel-version

from usbip-wsl2-instructions.

lisbravo avatar lisbravo commented on September 15, 2024

By now I can confirm that make install does not loads the new kernel
https://github.com/MicrosoftDocs/WSL/releases/tag/18947
still havent had any success runing a new kernel in this way but I'll get back to you when I manage to do it

from usbip-wsl2-instructions.

ConnorChristie avatar ConnorChristie commented on September 15, 2024

Thank you @lisbravo! Installing the custom kernel by using the wsl2 config worked like a treat. Then I was able to install the kernel modules and finally run the startusb.sh without seeing any errors!

from usbip-wsl2-instructions.

CalebGreer avatar CalebGreer commented on September 15, 2024

I tried to run the command for compiling a kernel with ms defaults

sudo make KCONFIG_CONFIG=Microsoft/config-wsl

it gives me this output:

***
*** Configuration file "Microsoft/config-wsl" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
scripts/kconfig/Makefile:69: recipe for target 'syncconfig' failed
make[2]: *** [syncconfig] Error 1
Makefile:534: recipe for target 'syncconfig' failed
make[1]: *** [syncconfig] Error 2
Makefile:633: recipe for target 'include/config/auto.conf.cmd' failed
make: *** [include/config/auto.conf.cmd] Error 2```

I have run the configurator so I am not sure what the next step in fixing this would be

from usbip-wsl2-instructions.

theseankelly avatar theseankelly commented on September 15, 2024

It's been a couple weeks since I did this, but I think I followed the instructions in the primary readme (take care to check out the correct branch, per issue number #3).

Specifically, these steps (again, use the actual version/git tag that matches your kernel at the moment, mine is 4.19.104-microsoft-standard, git tag 4.19.104-microsoft-standard

/usr/src/4.19.104-microsoft-standard$ sudo cp /proc/config.gz config.gz
/usr/src/4.19.104-microsoft-standard$ sudo gunzip config.gz
/usr/src/4.19.104-microsoft-standard$ sudo mv config .config
/usr/src/4.19.104-microsoft-standard$ sudo make menuconfig

Instead of make KCONFIG_CONFIG=Microsoft/config-wsl. In theory using the current config from proc/config.gz from within WSL should be the WSL defaults.

Anyway, the key was to copy the kernel out of WSL and then point WSL At it in .wslconf per @lisbravo 's comment.

from usbip-wsl2-instructions.

pagkly avatar pagkly commented on September 15, 2024

Hi @theseankelly and @lisbravo I could not get it to work.
I already tried checkout v4.19.84 and it would show something @CalebGreer had posted being
*** Configuration file "Microsoft/config-wsl" not found!

When I checkout 4.19.84-microsoft-standard it showed something like

user@DESKTOP-KDJ7PIR:/usr/src/4.19.84-microsoft-standard$ sudo git checkout 4.19.84-microsoft-standard
M       Microsoft/config-wsl
HEAD is now at db998769a92e Merge tag 'v4.19.84' into linux-msft-wsl-4.19.y
user@DESKTOP-KDJ7PIR:/usr/src/4.19.84-microsoft-standard$

and sudo make KCONFIG_CONFIG=Microsoft/config-wsl works
and show this at the end

  DEPMOD  4.19.84-microsoft-standard+
sh ./arch/x86/boot/install.sh 4.19.84-microsoft-standard+ arch/x86/boot/bzImage \
        System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.19.84-microsoft-standard+ /boot/vmlinuz-4.19.84-microsoft-standard+
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.19.84-microsoft-standard+ /boot/vmlinuz-4.19.84-microsoft-standard+
update-initramfs: Generating /boot/initrd.img-4.19.84-microsoft-standard+
W: mkconf: MD subsystem is not loaded, thus I cannot scan for arrays.
W: mdadm: failed to auto-generate temporary mdadm.conf file.
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.19.84-microsoft-standard+ /boot/vmlinuz-4.19.84-microsoft-standard+
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.19.84-microsoft-standard+ /boot/vmlinuz-4.19.84-microsoft-standard+

but whenever I startusb.sh

modprobe: FATAL: Module usbip-core not found in directory /lib/modules/4.19.84-microsoft-standard
modprobe: FATAL: Module vhci-hcd not found in directory /lib/modules/4.19.84-microsoft-standard

I did @lisbravo
[wsl2] #kernel=C:\\Users\username\\kernel\\vmlinux.bin
%userprofile%\.wslconfig and %userprofile%\kernel\vmlinux.bin and shutdown and restart wsl as well but startusb.sh still shows something like that.

usbip is working good and I have set up everything on the windows side. just left with the compiling

from usbip-wsl2-instructions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.