Required guidances on building a kernel module like v4l2loopback on WSL2 and BTW how to access kernel headers on WSL2 environment?

UsdkDhin 0 Reputation points
2024-04-18T08:17:50.7+00:00

I have the source code of v4l2loopback kernel module that works in Ubuntu 20 in a laptop.

Now I am trying to compile the same code in Ubuntu 20 but inside WSL2. For that I am using this:

make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

The problem is that /lib/module/ is empty.

So I tried getting the headers using:

sudo apt search linux-headers-`uname -r`

Sorting... Done
Full Text Search... Done

But nothing get's populated in the modules folder

Is there anything I need to do in order that folder contains all required modules?

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,845 questions
0 comments No comments
{count} votes