Fatal Module V4l2loopback Not Found in Directory [Fix]

This error affects various versions of Linux and WSL on Windows

Reading time icon 3 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team Read more

Key notes

  • Not having the kernel and v4l2loopback come from the same source can cause this problem.
  • Ensure you have Linux headers and kernel modules installed to fix this issue.
fatal module v4l2loopback not found in directory

Fatal module v4l2loopback not found in directory message can appear when trying to install certain applications on Linux.

The error message will prevent you from installing software, and you won’t be able to proceed unless you fix it, so today we’re going to show you how to do it.

Why does fatal module v4l2loopback not found in directory error occur?

This issue occurs if your kernel and module aren’t installed from the same source, or if Linux headers or kernel modules aren’t installed. Improperly configured system can also cause this issue.

How can I fix the fatal module v4l2loopback not found in the directory error?

1. Install kernel and v4l2loopback from the same source

  1. Check the source from which the kernel was installed.
  2. Do the same for v4l2loopback.
  3. If their sources aren’t the same, install v4l2loopback from a different source by using the following command: sudo apt -t buster-backports install v4l2loopback-dkms

We used Debian and booster-backports as an example, so be sure to adjust your command accordingly.

2. Install linux-headers

  1. Open Terminal.
  2. Next, run the following command to check if the system is up to date: sudo pacman -Syu
  3. Install linux-headers with this command: sudo pacman -S linux-headers
  4. Lastly, verify Linux headers:  pacman -Q linux-headers

These instructions are for Arch, but a similar solution can be applied on Ubuntu. Just run the following command, but be sure to replace the module version accordingly: sudo apt-get install linux-headers-4.14.98-imx

After that, reinstall v4l2loopback.

3. Ensure that kernel modules are installed

  1. In the command line enter the following: aptitude search linux-modules-extra*
  2. After that, install the latest module by using this command: sudo aptitude install linux-modules-extra-5.4.0-81-generic
  3. Check if the problem is gone.

Keep in mind that this is just an example, and the command will differ depending on the kernel module version that you want to install.

In some instances, you might have to reinstall kernel modules to fix this problem.

4. Modify the config file on NixOS

  1. Open your config file.
  2. Ensure that it has the following lines:
    boot.kernelModules = [ "v4l2loopback" ];
    boot.extraModulePackages = [ pkgs.linuxPackages.v4l2loopback ];
  3. Open environment.systemPackages file.
  4. Make sure the following lines are present:
    linuxPackages.v4l2loopback
    v4l-utils

How to install V4L2Loopback on Linux?

Ubuntu

  1. Ensure you have the necessary dependencies installed:
    sudo apt-get update
    sudo apt-get install build-essential git
  2. Clone the repository with git clone https://github.com/umlaeute/v4l2loopback.git
  3. Change to the correct directory: cd v4l2loopback
  4. Build it with these commands:
    make
    sudo make install
  5. Load the kernel module: sudo modprobe v4l2loopback

Arch

  1. Run the following to install base-devel: sudo pacman -S base-devel
  2. Now download v4121loopback:
    git clone https://aur.archlinux.org/yay.git
    cd yay
    makepkg -si
  3. Install it with yay: yay -S v4l2loopback-dkms
  4. Lastly, load the kernel module: sudo modprobe v4l2loopback

Fatal module v4l2loopback not found in the directory is a Linux error it usually appears if kernel modules or headers aren’t installed properly.

This issue can also appear in WSL, and if you’re not familiar with it, we suggest reading our guide on how to install bash on Windows 10. After doing that, you can run Linux GUI apps through bash on Windows.

To learn more about this feature, you might want to read our guide on how to access files in Windows Subsystem for Linux.

Did you find a different solution for this error? If so, share it with us in the comments section.

More about the topics: Linux, WSL