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.