It seems that you are trying to load kernel modules that are not available in the default WSL2 kernel. The WSL2 kernel is a custom Linux kernel from Microsoft that contains all of its drivers compiled in. While it has support for modules, it does not ship with any, as you can see from the configuration file<sup>1</sup>.
If you want to enable the overlay and br_netfilter modules, you will need to build your own WSL2 kernel from the source code<sup>2</sup>. You can follow the instructions in the README file<sup>3</sup> to download and compile the kernel using the WSL2 configuration. You will also need to install some build dependencies<sup>4</sup>. After building the kernel, you can install the modules with sudo make modules_install
and then load them with sudo modprobe
.
Alternatively, you can try using a pre-built WSL2 kernel that has the modules enabled, such as the one from this GitHub repository<sup>5</sup>. You can download the latest release and follow the installation steps in the README file<sup>6</sup>. However, please note that this is not an official Microsoft kernel and it may not be compatible with your WSL2 version or settings.
I hope this helps you to enable the kernel modules you need. If you have any other questions, please feel free to ask. 😊