How to connect a Wi-Fi adapter to a virtual machine

Working with network interfaces in a virtual environment often becomes a challenging task for system administrators and enthusiasts. Standard emulation tools typically offer NAT or bridged mode, which utilize the host system's physical interface card. However, there are situations where guest OS should work with the adapter independently of the main system.

The problem is that a virtual machine doesn't see the computer's physical USB devices by default. It communicates only with the virtual hardware emulated by the hypervisor. For the guest operating system to directly access the Wi-Fi card, it's necessary to configure USB device forwarding or use specific network modes.

In this article, we'll look at two main ways to solve the problem. The first method involves using the Network Bridge, which is suitable for most standard tasks. The second, more complex, involves directly connecting a USB adapter, which is necessary for pentesting and low-level networking.

How network interfaces work in virtualization

Before you begin configuring, it's important to understand the fundamental difference between network card emulation and physical device passthrough. Hypervisors such as VirtualBox or VMware Workstation, create a virtual network adapter (usually an Intel PRO/1000) that software associates with the host's physical adapter. In this mode, the guest system is unaware of the existence of a real Wi-Fi module.

For tasks that require airtime monitoring, hardware-level MAC address remapping, or packet injection, standard emulation is insufficient. A mode that allows the guest OS to gain direct control over the network is required. USB controllerThis allows native drivers to run inside a virtual machine, ignoring the host system drivers.

⚠️ Warning: When forwarding a USB device directly, the host operating system (your main computer) will immediately lose connection to the adapter. The device will be completely taken over by the virtual machine.

The method you choose depends on your goals. If you just need internet access within the virtual machine, network settings are sufficient. If you plan to run aircrack-ng or analyze handshakes, you can't do without USB forwarding.

Preparing the host system and installing extensions

The first step is to install the extension pack, which adds support for USB 2.0 and 3.0. Without this component, the virtual machine will only see the device as USB 1.1, which often results in unstable operation or the adapter not appearing in the list of available adapters.

For users Oracle VM VirtualBox You need to download the Extension Pack from the official website that matches your software version. After downloading, open the file, and the system will prompt you to install the extension. VMware USB support is built into the basic installer, but requires activation in the specific machine settings.

  • 📀 Download the latest version of the Extension Pack for your hypervisor version.
  • 🔌 Make sure that virtualization and USB controller support is enabled in BIOS/UEFI.
  • 💾 Install Guest Additions or VMware Tools inside the guest OS for better integration.

It's also worth checking whether the device in question is being used by other programs. If you have Wi-Fi management software installed from the router manufacturer, it may be blocking access to the adapter. In this case, it's best to temporarily remove the drivers or disable the device in the host's Device Manager before starting the virtual machine.

Setting up USB forwarding in VirtualBox

Connection process in the environment VirtualBox This requires several sequential steps. First, you need to shut down the virtual machine. Then, go to Settings, select the "USB" section, and enable the USB 3.0 (xHCI) controller. If this option is unavailable, the Extension Pack is not installed.

Next, you need to create a filter. By clicking the "+" icon with a green plus sign, you will see a list of all USB devices connected to the host. Find your Wi-Fi adapter in the list by name (for example, Realtek, Ralink or TP-Link) and select it. This will create a rule that will cause VirtualBox to automatically "snatch" the device from the host when the virtual machine starts.

After the guest OS starts, the device should be detected as new hardware. The system will require drivers to be installed. Important: you must install the following within the virtual machine: the same drivers, as for the physical machine. Without them, the adapter will be seen as an unknown device.

☑️ Setting up VirtualBox

Completed: 0 / 1

Configuring the network in VMware Workstation

In the company's products VMware The logic is similar, but the interface is different. In the virtual machine menu, select VM → Removable DevicesFind your Wi-Fi adapter in the list and click Connect (Disconnect from Host)This action will force the device to switch to the virtual machine.

To automate the process, you can set up rules in the menu Virtual Machine Settings → USB ControllerHere you can set up automatic connection when a device appears. This is convenient if you frequently reconnect the adapter or use a laptop with a docking station.

It is worth noting that VMware It often handles high-speed device passthrough better. If VirtualBox returns an error Failed to create a proxy device for the USB device, it makes sense to try running the task in VMware, since their USB stack emulation mechanism is considered more stable for network cards.

⚠️ Note: Virtual machine interfaces are subject to update. Menu item layouts may differ slightly in newer versions of VMware Workstation Pro or Player.

Bridged Adapter mode

If you don't need direct access to the adapter hardware, but just want the virtual machine to have its own IP address on the local network and work via Wi-Fi, use the mode Bridged AdapterIn this case, the virtual network card forwards traffic to the host's physical Wi-Fi adapter, but does not capture it entirely.

Configuration is performed in the "Network" section. Select the "Bridged Adapter" connection type. In the "Name" field, select your physical wireless adapter. Do not select "Host Adapter" or "Automatic" if you have multiple network cards, as this may result in connection loss.

In this mode, the virtual machine becomes a full member of the network. It will receive an IP address from the router, just like the main computer. This is ideal for testing network services, checking port availability, or using file-sharing services.

Parameter NAT Bridged USB Passthrough
Internet access Eat Eat Depends on the OS
Visibility on the local network No Yes Yes
Access to radio broadcasts No No Yes
Changing the MAC address Software Software Hardware

Troubleshooting driver and compatibility issues

The most common problem is the lack of drivers in the guest OS. If you are using Kali Linux or Parrot OSSupport for most adapters is built-in. However, for Windows guests or specific Linux distributions, you'll have to search for drivers manually. The problem is compounded by the fact that older adapters may not have drivers for newer OS versions.

A common error is when a device connects but doesn't work. This may be due to a driver conflict. Try removing the device in the guest OS's Device Manager and updating the hardware configuration. Switching the USB standard from 3.0 to 2.0 in the virtual machine settings also helps, as some older adapters are unstable at higher speeds.

If the adapter keeps disconnecting, check your power saving settings. The virtual machine may be putting the USB port to sleep, thinking it's inactive. In the guest OS power settings, disable the USB root hub from being turned off.

What to do if the adapter is not detected?

If the device doesn't appear in the USB list in VirtualBox settings, try physically disconnecting it and connecting it to a different port. Restarting the VBoxSVC service in Windows or the VirtualBox daemon in Linux can sometimes help. Also, make sure the device isn't being hijacked by another process on the host.

Using the Security Audit Adapter

For information security professionals, connecting a Wi-Fi adapter to a virtual machine is a standard procedure. This allows for isolating hacking and analysis tools from the main work environment. In USB passthrough mode, you can put the card into monitor mode (monitor mode), which cannot be done via a standard network bridge.

After connecting the device, run the command in the Linux guest terminal ip link or ifconfigto make sure the interface has appeared. To switch to monitoring mode, the command is usually used airmon-ng start wlan0If the interface does not appear or the command returns an error, then USB forwarding failed and the guest OS is using an emulated card.

Even with successful USB redirection, an old or cheap adapter may not be able to handle the task. For professional work, chipset-based adapters are recommended. Atheros AR9271 or Ralink RT3070.

⚠️ Warning: Using tools to intercept traffic and attack networks without the owner's written permission is illegal. Use this information only for educational purposes or to audit your own networks.

Why doesn't the virtual machine see the USB Wi-Fi adapter?

Most often, the problem stems from a missing Extension Pack (for VirtualBox) or the device being used by a host system driver. Also, check that the USB controller is enabled in the specific virtual machine's settings.

Is it possible to share Wi-Fi from a virtual machine?

Technically, this is possible if you use USB adapter passthrough and the guest OS supports creating an access point. However, it's easier and more efficient to share Wi-Fi from the host system, as virtualization adds unnecessary overhead in processing network packets.

Which adapter is best for Kali Linux in a virtual machine?

Adapters with external antennas based on Atheros or Ralink chips are considered the optimal choice. They offer better compatibility with Linux drivers and operate reliably in USB passthrough mode, supporting the necessary features for security auditing.

Does virtualization affect Wi-Fi speed?

When using NAT or Bridge mode, the impact is minimal. However, when using USB forwarding and active radio operations (scanning, injection), the host CPU load increases, which may indirectly affect overall system performance, but not necessarily the data transfer rate of the adapter itself.