1

I have installed windows subsystem for linux with ubunut version 20.04 in windows 10 from microsoft store .I tried to install netextender software in that subsystem through terminal.But I get below error message in that.

libkmod: ERROR ../libkmod/libkmod-module.c:1668 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory

I checked with ubuntu os laptop by entering command lsmod but that gives list of modules,but that not available in windows subsystem for linux.When i search regarding this issue,it shows some kernel issue in windows like that.But i cant understand and why this not working.Can anyone help for this issue?

0

1 Answer 1

1

Short Answer

You are likely running WSL1. lsmod requires WSL2.

Explanation

Start with wsl -l -v (from PowerShell or CMD) to confirm your WSL version. You'll probably see something like:

  NAME                   STATE           VERSION
* Ubuntu                 Running         1

One of the primary differences between WSL1 and WSL2:

  • WSL1 is a "translation layer" that attempts to convert Linux syscalls to the Windows kernel's API.
  • WSL2 is a "virtualized" environment that runs under a real Linux kernel.

So, for example, when the ls command gets a list of files:

  • Under WSL1, Windows provides that list of files using the Windows API to get the files in the WSL rootfs.
  • Under WSL2, the Linux kernel is using the ext4 filesystem in a virtual disk to retrieve the list of files. For files on Windows drives (e.g. /mnc/c), it uses the 9P network protocol to obtain the files.

It's really pretty amazing just how much WSL1 is able to do given this. But there are limitations. lsmod is one of them. While WSL1 does provide certain /proc mapping (such as processes), the concept of "kernel modules" doesn't make much sense to do with a Windows mapping.

It might be possible to list Windows drivers, but that wouldn't really provide any benefit.

Convert to WSL2

Assuming you already have WSL2 enabled on Windows, you can convert your Ubuntu instance to WSL2 using:

wsl --set-version Ubuntu 2

While this command is pretty safe, I would still recommend backing up your instance first with:

wsl --export Ubuntu backup.tar

As with the initial wsl command, this is a Windows command, so it will need to be run from PowerShell or CMD.

Installing/Enabling WSL2

If you do not have WSL2 enabled, you can do so by following Steps 2-5 of this doc.

Enabling WSL2 does not update already installed instances, so you will still need to do the conversion step (wsl --set-version) above.

Limitations

But note that the kernel provided with WSL already has all available modules compiled in, so the result of lsmod will just be an empty list.

You can compile your own kernel with loadable modules if you'd like. Please see the WSL Linux kernel Github and the WSL Doc for how to load WSL with your custom kernel.

But hopefully that won't be required for Netextender.

4
  • when i run this command wsl -l -v,it shows - Command 'wsl' not found, but can be installed with: sudo apt install wsl.shoud i run this command and install wsl? Oct 4, 2021 at 15:26
  • @user3157334 (Side note: Good timing) Run the wsl command from PowerShell or CMD. I'll edit the answer to clarify. Oct 4, 2021 at 15:26
  • when run wsl in powershell,same above response comes. Oct 4, 2021 at 15:29
  • @user3157334 Double-check that. The error message "Command xxx not found, but can be installed" is a bash shell message. I can't think of any way you would see that response in PowerShell. If the command weren't found in PowerShell, you'd get, "The term 'xxxxx' is not recognized as a name of a cmdlet, function, script file, ..." You might have entered WSL from PowerShell with just a wsl command. In that case, just type exit (or Ctrl+D) to exit WSL back to PowerShell. Oct 4, 2021 at 15:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .