Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load kernel modules #524

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

terlar
Copy link
Contributor

@terlar terlar commented Jul 31, 2024

WSL now supports kernel modules and come with a bunch configured as m and can be loaded this way. For example vhci-hcd used by usbip has changed from y to m and hence need to be explicitly loaded.

dorssel/usbipd-win#995
microsoft/WSL#11789 (comment)

Unfortunately we cannot use boot.kernelModules since it is gated behind boot.kernel.enable.

terlar added 2 commits July 31, 2024 07:35
WSL now supports kernel modules and come with a bunch configured as `m`
and can be loaded this way. For example `vhci-hcd` used by usbip has
changed from `y` to `m` and hence need to be explicitly loaded.
@terlar terlar force-pushed the load-kernel-modules branch from 02b50d1 to 94010f2 Compare July 31, 2024 05:35
The set of kernel modules to be loaded in the second stage of
the boot process via systemd-modules-load.service.
'';
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we reuse boot.kernelModules here?

Copy link
Contributor Author

@terlar terlar Aug 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is gated behind boot.kernel.enable which we don't want to enable.

Another option is to have something like a boolean wsl.loadKernelModules. That will write the file with the value based on boot.kernelModules. What do you prefer?

@K900
Copy link
Contributor

K900 commented Aug 25, 2024

Wait, how does this even work. Isn't our modprobe looking in the wrong path for this?

@nzbr
Copy link
Member

nzbr commented Aug 25, 2024

Just wanted to ask this, because if I run insmod vhci-hcd it does not find the module file

  root@pulsar
ZS /home/nzbr> insmod vhci-hcd
insmod: ERROR: could not load module vhci-hcd: No such file or directory

@K900
Copy link
Contributor

K900 commented Aug 25, 2024

You want modprobe.

@K900
Copy link
Contributor

K900 commented Aug 25, 2024

But how does it know where to find the WSL modules

@terlar
Copy link
Contributor Author

terlar commented Aug 25, 2024

It is bundled with the kernel as loadable modules as I understand it and this change happened in the latest WSL kernel release (6.6). See release notes

@nzbr
Copy link
Member

nzbr commented Aug 25, 2024

You want modprobe.

It seems that modprobe does not report if it failed though. It'll just run through but then lsmod will still show that no modules are loaded

@K900
Copy link
Contributor

K900 commented Aug 25, 2024

WSL also rolled back to 5.15 for now. I really want to see a test at this point to actually verify it does what it says.

@nzbr
Copy link
Member

nzbr commented Aug 25, 2024

Ah, i have 5.15, that might be why this doesn't work

@terlar
Copy link
Contributor Author

terlar commented Aug 26, 2024

Yes, that is a bit confusing, just discovered they reverted to the older kernel again now when I was looking into it. I have tested this on WSL with the 6.6 kernel and verified it works. But I guess we might as well wait looking into it since the latest WSL went back to the older kernel.

@nzbr nzbr added enhancement New feature or request blocked Something else has to happen before work on this can continue labels Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Something else has to happen before work on this can continue enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants