4

When I run lsmod or sudo lsmod, I get an error that says:

libkmod: ERROR ../libkmod/libkmod-module.c:1655 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory
Error: could not get list of modules: No such file or directory

I searched on a lot of forums but am unable to find a solution for this. I'm running Debian on Windows Subsystem for Linux.

I was recently also trying to edit the sysctl.conf file for the purpose of disabling ipv6. I had added the following lines:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

And when I tried sudo sysctl -p, it returned this error:

sysctl: cannot stat /proc/sys/net/ipv6/conf/all/disable_ipv6: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv6/conf/default/disable_ipv6: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv6/conf/lo/disable_ipv6: No such file or directory

I'm not sure if the above 2 errors are connected. I was trying to run Linux shell on Windows. Any solution to the problem?

1
  • 3
    Debian on WSL is not exactly the same thing...I am not much surprised about the IPv6 tidbit. Commented Apr 20, 2018 at 13:35

3 Answers 3

6

In both cases, you’re trying to interact with the kernel. Any Linux environment running on WSL isn’t running a Linux kernel, it’s running on the Windows kernel; so anything tied to the Linux kernel (including modules and system controls) won’t work.

In the IPv6 case, you need to configure the network using Windows’ tools.

3
  • Is there any work around to this? And could there be instances where I would need to probably interact with the kernel in order to perform some important task? Is there a workaround in that case? Commented Apr 20, 2018 at 14:17
  • 1
    The workaround is to run a full Linux environment, e.g. in a VM. There are some things which you can only do with a Linux kernel, just as there are others you can only do with Windows. You need to use the appropriate tool for your requirements; WSL gives you a Linux user-space on Windows, but it isn’t Linux. Commented Apr 20, 2018 at 14:30
  • WSL gives you a Linux user-space on Windows, but it isn’t Linux.@StephenKitt Good👍 Commented Sep 24, 2021 at 6:13
1

Not strictly related to WSL, but you can see this error if your kernel was compiled without loadable module support.

Without module support, /proc/modules doesn't exist, which is what lsmod relies on for most of its information.

If you are compiling your own kernel, the option to look for is CONFIG_MODULES.

0

I got this error because I was trying to do nfs mounts in WSL. You can connect to your drives using windows, then mount them in WSL.

sudo mount -t drvfs G: /mnt/g

For the full answer where I got this from: https://superuser.com/questions/1128634/how-to-access-mounted-network-drive-on-windows-linux-subsystem/1261563#1261563

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.