Fatal Module V4l2loopback Not Found in Directory [Fix]
This error affects various versions of Linux and WSL on Windows
- 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 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
- Check the source from which the kernel was installed.
- Do the same for v4l2loopback.
- 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
- Open Terminal.
- Next, run the following command to check if the system is up to date:
sudo pacman -Syu
- Install linux-headers with this command:
sudo pacman -S linux-headers
- 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
- In the command line enter the following:
aptitude search linux-modules-extra*
- After that, install the latest module by using this command:
sudo aptitude install linux-modules-extra-5.4.0-81-generic
- 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
- Open your config file.
- Ensure that it has the following lines:
boot.kernelModules = [ "v4l2loopback" ];
boot.extraModulePackages = [ pkgs.linuxPackages.v4l2loopback ]; - Open environment.systemPackages file.
- Make sure the following lines are present:
linuxPackages.v4l2loopback
v4l-utils
How to install V4L2Loopback on Linux?
Ubuntu
- Ensure you have the necessary dependencies installed:
sudo apt-get update
sudo apt-get install build-essential git - Clone the repository with
git clone https://github.com/umlaeute/v4l2loopback.git
- Change to the correct directory:
cd v4l2loopback
- Build it with these commands:
make
sudo make install - Load the kernel module:
sudo modprobe v4l2loopback
Arch
- Run the following to install base-devel:
sudo pacman -S base-devel
- Now download v4121loopback:
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si - Install it with yay:
yay -S v4l2loopback-dkms
- 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.