I have been trying to set up v4l2loopback on an EC2 instance and get the error - modprobe: FATAL: Module v4l2loopback not found in directory /lib/modules/5.4.0-1041-aws on sudo modprobe v4l2loopback.
Trying to load videodev using sudo modprobe videodev also returns the same module not found error.
I tried installing Linux headers for this but to no success. Any leads?
kernels for cloud VMs are most often stripped of anything unnecessary in a cloud environment for space (and implicitly speed) reasons (and put in a share of security reasons as well).
now most virtualized hardware that is running in some unknown datacenter has absolutely no requirement for hardware drivers (apart from the small set of drivers to run the "virtual hardware"). Also audio and multimedia applications are exceedingly rare under these circumstances - thus the image vendors strip away audio drivers and the v4l2 framework.
in order to use the
v4l2loopbackmodule, you need a kernel that comes with the v4l2-framework. since the vendored images lack it, you need to configure and compile such a kernel yourself (and make sure it persists). just installing the kernel-headers is not enough.here's an excerpt of the relevant info of the kernel-configuration that should give you a v4l2loopback-compatible kernel: