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?

  • 2
    Debian on WSL is not exactly the same thing...I am not much surprised about the IPv6 tidbit. – Rui F Ribeiro Apr 20 '18 at 13:35

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.

  • 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? – Momo Senpai Apr 20 '18 at 14:17
  • 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. – Stephen Kitt Apr 20 '18 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.