Skip to content

[feature request] allow loading native linux kernel modules #1893

Closed

Description

@mailinglists35

Please use the following bug reporting template to help produce actionable and reproducible issues. Please try to ensure that the reproduction is minimal so that the team can go through more bugs!

  • A brief description
    There is no support for loading native linux modules nor support to rebuild from source and load under microsoft wsl

  • Expected results
    modprobe should return success exit code

  • Actual results (with terminal output if applicable)
    modprobe returns error:
    ubuntu@wsl:~$ modprobe zfs
    modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.0-43-Microsoft
    /modules.dep.bin'
    modprobe: FATAL: Module zfs not found in directory /lib/modules/4.4.0-43-Microsoft

  • Your Windows build number
    10.0.15063

  • Steps / All commands required to reproduce the error from a brand new installation
    turn on WSL/bash on windows

  • Strace of the failing command
    no need to strace, devs knows well that this is a feature request and not a bug

  • Required packages and commands to install
    none, default packages

See our contributing instructions for assistance.

Activity

  1. aseering commented on Apr 12, 2017

    @aseering
    Contributor

    I'll let the WSL team respond with any further thoughts. But it seems to me that this is "works as expected" given that WSL is intended to implement Linux userspace, not Linux kernelspace?

  2. therealkenc commented on Apr 12, 2017

    @therealkenc

    mailinglists35 - There are no Linux kernel internals for "module zfs" to wire into on WSL. Because, there are no Linux kernel internals.

    Now, wslmodprobe somewindowsdriver.sys... I hope we get to talking about that at some point in the (relatively distant) future.

  3. fpqc commented on Apr 13, 2017

    @fpqc

    The Linux Kernelmode ABI is not stable, so this is probably impossible. WSL's kernelmode does not even resemble the Linux kernel. The whole reason WSL can relatively easily target usermode is that the Linux Kernel maintainers have a specific goal of not breaking the usermode ABI unless totally necessary.

    WSL support for "kernel modules" will come as Microsoft writes compatibility layers between the abstracted hardware, or later eventually from driver writers if Microsoft documents WSL'S driver API and adds it to the Windows Driver Kit and KMDF. But I don't think we are super close to this coming out yet.

  4. stehufntdev commented on Apr 13, 2017

    @stehufntdev

    Unfortunately loading native Linux kernel modules will likely never happen for the reasons mentioned, though it would be pretty cool :). There's some technical details on how WSL works if you are interested on our blog - https://blogs.msdn.microsoft.com/wsl/. I'm going to close this out for now for the reasons discussed.

  5. mailinglists35 commented on Apr 17, 2017

    @mailinglists35
    Author

    thank you all for explanation of why is it not a goal at the present.
    I hope maybe someday this subject will be revisited without somebody else having to reopen a similar issue.

  6. valerysntx commented on Dec 24, 2017

    @valerysntx
    libcontainerd: new containerd process, pid: 744
    WARN[0000] containerd: low RLIMIT_NOFILE changing to max  current=1024 max=65536
    INFO[0001] [graphdriver] using prior storage driver: overlay2
    INFO[0001] Graph migration to content-addressability took 0.00 seconds
    WARN[0001] Your kernel does not support cgroup memory limit
    WARN[0001] Unable to find cpu cgroup in mounts
    WARN[0001] Unable to find blkio cgroup in mounts
    WARN[0001] Unable to find cpuset cgroup in mounts
    WARN[0001] mountpoint for pids not found
    INFO[0001] Loading containers: start.
    WARN[0001] Running modprobe nf_nat failed with message: `modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.0-43-Microsoft/modules.dep.bin'
    modprobe: WARNING: Module nf_nat not found in directory /lib/modules/4.4.0-43-Microsoft`, error: exit status 1
    WARN[0001] Running modprobe xt_conntrack failed with message: `modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.0-43-Microsoft/modules.dep.bin'
    modprobe: WARNING: Module xt_conntrack not found in directory /lib/modules/4.4.0-43-Microsoft`, error: exit status 1
    WARN[0003] Could not load necessary modules for IPSEC rules: Running modprobe xfrm_user failed with message: 
    `modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.0-43-Microsoft/modules.dep.bin'
    modprobe: WARNING: Module xfrm_user not found in directory /lib/modules/4.4.0-43-Microsoft`, error: exit status 1
    
    same issue probably? tying to run wsl + docker ce in windows 1709.16299.125
    containerd version 0.2.4
    Docker version 1.13.1, build 092cba3
    
                                                                                                                                                                                   
    
  7. therealkenc commented on Jul 3, 2020

    @therealkenc

    This submission was the landing zone for kernel modules in WSL1, and at the time was punted to the now defunct UserVoice. Kernel modules are available in WSL2, although you'll have to off-road it as of this writing.

  8. FrankHB commented on Dec 5, 2020

    @FrankHB

    It is worth noting that specific modules should be workable trivially in despite of the differences of kernels, albeit still not implementable in the userland, e.g. modprobe msr. WSL2 does not help when it is intended for the host. (Maybe a new issue?)

  9. amb-iota commented on Mar 28, 2021

    @amb-iota

    In my opinion I've running more machines with Ubuntu and one has got the msr working and one not. I do not really find the difference of the systems as both are using the same kernel version and the same release. The strange difference is the benchmark for hashes. The one system that is able to use msr does it with more than twice the speed and this looks like someone want to make ubuntu and linux slow. I had only just now not the time to find the difference to get out what is different in the both systems. As with a quick view they are both the same. Am I'm right with understanding WSL is some kind of a name for Windows? Because than I would understand this breaking down the speed to make Windows more important.

  10. GitMensch commented on Nov 17, 2022

    @GitMensch

    As I somehow always end in this issue when searching for "kernel modules in wsl2"...
    Can someone please link the WSL2 issue for that and/or a working guide how to build the distributed kernel with module support?

    Side note: Would it be possible to built-in the msr module (instead of loading it dynamically; which is at least my understanding how other modules are currently handled in the distributed WSL2 kernel)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions