How to enable WiFi in Kali Linux on a virtual machine

Beginning information security professionals often encounter difficulties when trying to set up a wireless connection in a virtual environment. Virtualization Creates an isolated layer between the physical hardware and the operating system, rendering standard connection methods ineffective. Unlike a physical installation, where drivers interact directly with the hardware, a virtual machine requires device passthrough or network interface emulation.

The main difficulty is that the guest system by default sees only a virtual network adapter that emulates a wired connection. Kali LinuxAs a specialized distribution for pentesting, it requires a special approach to working with WiFi. If you plan to simply use the internet for updates, configuring NAT can solve the problem, but for security audits, you need to forward a real physical adapter.

In this guide, we will cover all the nuances of network configuration in detail. Wireless adapters with Atheros and Ralink chipsets are most compatible with monitoring mode in virtual environments. We'll cover setup methods for various hypervisors and troubleshoot common errors most users encounter when first starting out.

Features of WiFi operation in a virtual environment

Understanding virtualization architecture is critical to successful setup. A hypervisor, whether VirtualBox or VMware, intercepts requests from the guest OS and relays them to the host. The standard NAT (Network Address Translation) mechanism allows the machine to access the network through the host's primary adapter, but hides the presence of a wireless interface from the guest.

For security audit tasks such as packet sniffing or deauthentication For clients, regular internet access isn't enough. You need direct control over the card, including the ability to switch to monitor mode. Virtual machines don't provide this functionality by default without special USB redirection.

There are two main scenarios for using WiFi in Kali:

  • 📡 Network access: required to install updates, tools, and work with repositories.
  • 🛡️ Security Audit: requires direct access to hardware for packet injection and etheric scanning.
  • 💻 Access point emulation: creating a rogue AP for testing corporate network vulnerabilities.

It's important to distinguish between these goals, as the methods for achieving them are radically different. If you only need the internet, setting up a network bridge or NAT is sufficient. However, if your goal is professional pentesting, you'll have to tinker with USB filters and drivers.

📊 What is your purpose for using WiFi in Kali Linux?
Internet access only for updates
Security audit and traffic interception
Creating access points
Studying the operation of networks

Preparing the hypervisor and installing add-ons

Before attempting to enable the wireless module, you must ensure that the hypervisor itself and additional components are installed correctly. VirtualBox a critical step is installation Extension Pack, which adds support for USB 2.0 and 3.0. Without this package, adapter forwarding will not be possible.

After installing the main extension pack, you should check that the Guest Additions are also installed within Kali. This ensures proper operation of video drivers and shared folders and improves overall system stability. The installation process is usually automated in modern versions of the distribution, but a manual check won't hurt.

Follow these steps to prepare the environment:

  • 🔌 Download and install Oracle VM VirtualBox Extension Pack from the official website.
  • 🖥️ Start the virtual machine and make sure USB permissions are enabled.
  • 📦 In the Kali terminal, run the command sudo apt update && sudo apt install -y virtualbox-guest-x11.
  • 🔄 Reboot the system with the command reboot to apply the changes.

After rebooting, check the status of services. If you are using VMware WorkstationVMware Tools, which are similar, must also be installed for network functions to function correctly. Ignoring this step often results in the system simply not detecting connected devices.

☑️ Checking hypervisor readiness

Completed: 0 / 4

Setting up USB device forwarding

The most reliable way to access WiFi in a virtual machine is to forward a physical USB adapter. Built-in WiFi modules (Mini-PCIe or M.2) in laptops are virtually impossible to forward through VirtualBox, so using an external USB dongle is the industry standard.

To configure it, you need to turn off the virtual machine, go to its settings and open the section USBHere, you need to enable the controller (preferably USB 3.0) and add a new filter. All available devices connected to the host will appear in the list. Select your WiFi adapter.

Please note the following points when setting up filters:

  • 🔍 Accurately identify the device by the manufacturer name (e.g. Realtek, Atheros).
  • ⚡ Use USB 3.0 for maximum throughput and stability.
  • ❌ Do not connect the adapter to the host system while the VM is starting to avoid driver conflicts.

⚠️ Attention: Once you add the filter and start the machine, the adapter will disappear from the device manager of the host system (Windows/Linux). This is normal behavior: the device is now fully controlled by Kali Linux.

Once Kali Linux is running, open the terminal and enter the command lsusbYou should see your device in the list. If it appears, the forwarding was successful, and you can proceed to installing the drivers.

What should I do if my device is not showing up in the USB list?

If the device isn't visible, try changing the connection port (use USB 2.0 ports instead of 3.0, or vice versa). Also, check if the device is being used by another process on the host machine. In rare cases, restarting the USB service in the hypervisor helps.

Installing drivers for wireless adapters

Even if the system sees the device, it doesn't guarantee its operation. Many adapters, especially those with chips, Realtek RTL8812AU or RTL8814AU, require manual compilation of drivers, since they may be missing from the standard kernel or may not work correctly.

First you need to determine which chipset is used in your adapter. Command lsusb will display the device ID. Find this ID online or use the compatibility table below to determine if any additional steps are required.

Adapter model Chipset Status in Kali Actions
TP-Link TL-WN722N (v1) Atheros AR9271 Works out of the box Not required
TP-Link TL-WN722N (v2/v3) Realtek RTL8188EU Requires drivers Installing dkms
Alfa AWUS036NHA Atheros AR9271 Full support Not required
Alfa AWUS036ACH Realtek RTL8812AU Requires drivers Compiling from GitHub

Installing drivers often requires kernel headers. Run the command sudo apt install -y linux-headers-$(uname -r)After that, you can clone the driver repository (usually from GitHub) and run the installation script. install.shThe process may take several minutes.

After successful installation, reboot the machine. Check the interface status with the command ip linkIf you see the interface wlan0 If the interface is missing, it means the driver installed correctly. The lack of an interface indicates a compilation error or kernel incompatibility.

Setting up a network via NAT and bridging to access the Internet

If your goal isn't auditing, but simply network access for working with tools, there's no need to bother with USB adapters. Hypervisors provide powerful mechanisms for establishing network access through the host's primary adapter.

Mode NAT is the simplest: the virtual machine receives an IP address from the internal VirtualBox/VMware DHCP server and accesses the Internet via the host's IP. This is sufficient for most tasks. However, if the machine needs to be visible on the local network (for example, to scan other devices), the Network Bridge (Bridged Adapter).

In bridge mode, the virtual network card is "bound" to the host's physical WiFi adapter. For Kali, this appears as having its own MAC address on your home network. Configuration is performed in a configuration file or through the graphical interface:

  1. Open network settings in Kali (top right).
  2. Select "Wired Connected" or similar wired connection.
  3. Go to IPv4 settings and select "Automatic (DHCP)".
  4. Save and reconnect the cable (virtual).

You can check the connection with the command ping 8.8.8.8If the packets are coming through, then the network is configured. In bridge mode

Diagnosis and solution of typical problems

Even with proper configuration, errors can still occur. Users often encounter a situation where the adapter is detected but won't turn on. The command sudo ip link set wlan0 up You may receive the error "Operation not possible due to RF-kill." This means the wireless module is blocked by software or hardware.

To unlock, use the utility rfkillEnter . sudo rfkill listto see the blocking status. If the status is "Soft blocked: yes", run sudo rfkill unblock wifiIn rare cases, physically reconnecting the device through the hypervisor menu (disable the USB filter, wait, and then reconnect) can help.

⚠️ Attention: Network settings interfaces and package names may change in new versions of Kali Linux. If the commands don't work, check the official documentation or the package repository for your distribution.

Another common issue is driver conflicts. If you have multiple adapters installed or old driver remnants, the system may become confused. Clearing the system of unnecessary modules and using the command modprobe -r unloading modules before loading new ones often solves the problem.

Don't forget to check the kernel logs with the command dmesg | grep firmware. Firmware loading errors are a sure sign that the package firmware-realtek or similar is not installed or is damaged. Reinstalling firmware packages often solves the "flickering" interface issue.

Why doesn't the monitor mode work?

Monitor mode may not be enabled due to a driver that supports this feature, or because the interface is busy with the NetworkManager process. Stop the service with the command sudo systemctl stop NetworkManager before launch airmon-ng.

Frequently Asked Questions (FAQ)

Can I use my laptop's built-in WiFi adapter in VirtualBox?

In 99% of cases, no. Integrated adapters connect via the PCIe bus, which VirtualBox can't fully route. You'll need an external USB WiFi adapter that supports monitor mode.

Which WiFi adapter is best for Kali Linux?

Models with Atheros AR9271 (for 2.4 GHz) or Realtek RTL8812AU (for 5 GHz) chips are recommended. They have better support in the Linux kernel and operate reliably in injection mode.

Why doesn't Kali detect the WiFi adapter after USB forwarding?

Most likely, the Extension Pack for VirtualBox or the chipset drivers inside Kali are not installed. Check the command output. lsusb and make sure the device is displayed there.

Do I need to disable NetworkManager to work with WiFi?

For normal use, no. For professional security audits (using airmon-ng, airodump-ng), it's best to temporarily disable the NetworkManager service, as it may conflict with packet capture utilities.