Software⏱️ 3 min readπŸ“… 2026-06-15

How to Fix: How to use hwsim, "Module mac80211_hwsim not found in directory" error

Module mac80211_hwsim not found in directory /lib/modules/... error fix.

Quick Answer: Check if the hwsim kernel module is installed, and if not, install it using your distribution's package manager.

The 'Module mac80211_hwsim not found in directory' error occurs when the Linux system is unable to locate the mac80211_hwsim module, which is required for simulating wireless network interfaces. This issue affects users who need to use hwsim for testing or development purposes.

This error can be frustrating as it prevents the user from successfully using hwsim, leading to delays in project completion or testing cycles.

πŸ” Why This Happens

  • The primary reason for this error is that the mac80211_hwsim module is not installed or compiled on the system. This can happen when the Linux kernel version changes and the old module is no longer compatible.
  • Another possible cause is that the /lib/modules/ directory does not contain the required mac80211_hwsim module, which might be due to a misconfigured package manager or an incomplete kernel installation.

βœ… Best Solutions to Fix It

Compiling and installing the mac80211_hwsim module manually

  1. Step 1: Step 1: Update the Linux package index using the command 'sudo apt update' (for Debian-based systems) or 'sudo yum update' (for RPM-based systems). This ensures that the system has access to the latest package list.
  2. Step 2: Step 2: Install the necessary dependencies required for compiling the mac80211_hwsim module. For example, on Ubuntu-based systems, run 'sudo apt install linux-headers-$(uname -r)' to install the kernel headers.
  3. Step 3: Step 3: Download the source code for the mac80211_hwsim module from the Linux kernel repository using 'git clone https://github.com/torvalds/linux.git'. Navigate into the cloned directory and run 'make Modules' followed by 'sudo make modules_install' to compile and install the module.

Using an alternative wireless simulation tool

  1. Step 1: Step 1: Install a different wireless simulation tool, such as 'iw' or 'wpa_supplicant'. These tools can be used instead of hwsim to simulate wireless network interfaces.
  2. Step 2: Step 2: Configure the chosen tool according to its documentation and requirements. This may involve creating configuration files or setting environment variables.

🎯 Final Words

To resolve the 'Module mac80211_hwsim not found in directory' error, try compiling and installing the mac80211_hwsim module manually or using an alternative wireless simulation tool. If you encounter any issues during the process, refer to the Linux kernel documentation or seek assistance from online forums or communities.

Did this fix your problem?

If not, try searching for specific error codes.

πŸ” Search Error Database

❓ Frequently Asked Questions