December 3, 2026
I Got Tired of Typing 6 Commands Every Reboot, So I Built a One-Click Wi-Fi Button for WSL π.
How I got my USB Wi-Fi adapter working inside WSL with monitor mode, and turned the whole mess into a tiny Windows app
By Krithick
5 min read
- 1 How I got my USB Wi-Fi adapter working inside WSL with monitor mode, and turned the whole mess into a tiny Windows app
- 2 π The problem: WSL can't see your USB devices
- 3 π οΈ The manual fix (a.k.a. the 6-command ritual)
- 4 1οΈβ£ Find the adapter (Windows, PowerShell)
- 5 2οΈβ£ Share it (one time, needs admin)
How I got my USB Wi-Fi adapter working inside WSL with monitor mode, and turned the whole mess into a tiny Windows app
Picture this. You plug in your shiny external Wi-Fi adapter, open Ubuntu in WSL, type iw devβ¦ and get absolutely nothing. π
Windows sees the adapter. Windows loves the adapter. But WSL? WSL acts like it has never heard of USB in its life.
I fixed it once with a pile of commands. Then I restarted my laptop, and had to do it all again. And again. So I did what any lazy-but-stubborn security person does: I automated it into one button. Let me show you how. π
π The problem: WSL can't see your USB devices
I use WSL (Windows Subsystem for Linux) to run Linux security tools on my Windows laptop. No dual boot, no heavy VM, just Ubuntu running right next to Windows.
The catch: WSL can't see USB devices plugged into Windows out of the box. That includes my TP-Link Archer T2U Plus, a USB Wi-Fi adapter with a Realtek RTL8821AU chip.
For wireless testing, that's a dealbreaker. Your laptop's built-in Wi-Fi is owned by Windows. You want a separate adapter that Linux fully controls, including monitor mode (listening to all Wi-Fi traffic around you, not just your own connection).
π οΈ The manual fix (a.k.a. the 6-command ritual)
A friend of mine had this working and shared his scripts with me (legend π). The fix uses usbipd-win, an open-source tool that shares USB devices from Windows to WSL 2 over the USB/IP protocol. Microsoft's own WSL docs recommend it.
Here's the ritual, step by step.
1οΈβ£ Find the adapter (Windows, PowerShell)
powershell
usbipd listusbipd listLook for your device. Mine shows up as VID:PID 2357:0120 with a BUSID like 1-1.
2οΈβ£ Share it (one time, needs admin)
powershell
usbipd bind --busid 1-1usbipd bind --busid 1-1This marks the device as "shareable". You only do this once, but it needs an administrator prompt.
3οΈβ£ Attach it to WSL
powershell
usbipd attach --wsl --busid 1-1usbipd attach --wsl --busid 1-1Now the adapter disappears from Windows and appears inside Linux. Check it with lsusb in Ubuntu.
4οΈβ£ Feed the driver its firmware (Ubuntu)
The Realtek driver needs a firmware file to start. Here's the sneaky part: the WSL kernel doesn't look inside your Ubuntu's /lib/firmware. It runs outside your distro, so you have to put the firmware somewhere it can see, and tell it where to look.
bash
# Copy the firmware to a shared WSL location
sudo mkdir -p /mnt/wsl/tplink-firmware/rtw88
sudo cp /lib/firmware/rtw88/rtw8821a_fw.bin /mnt/wsl/tplink-firmware/rtw88/
# Tell the kernel to look there for firmware
echo -n /mnt/wsl/tplink-firmware | sudo tee /sys/module/firmware_class/parameters/path# Copy the firmware to a shared WSL location
sudo mkdir -p /mnt/wsl/tplink-firmware/rtw88
sudo cp /lib/firmware/rtw88/rtw8821a_fw.bin /mnt/wsl/tplink-firmware/rtw88/
# Tell the kernel to look there for firmware
echo -n /mnt/wsl/tplink-firmware | sudo tee /sys/module/firmware_class/parameters/path5οΈβ£ Load the driver
bash
sudo modprobe rtw88_8821ausudo modprobe rtw88_8821au6οΈβ£ Check for the wireless interface
bash
iw deviw devIf everything went right, you get a new interface. Mine is called wlxa842a160ef71 (Linux names it after the adapter's MAC address). π
And thenβ¦ you reboot, and do all six steps again. π©
π€― The two bugs that cost me hours
Before I could even automate it, two things broke on me. If you're on Ubuntu, these will probably hit you too.
π§© Bug #1: The firmware was compressed
My cp command failed. Why? Because Ubuntu doesn't ship rtw8821a_fw.bin. It ships rtw8821a_fw.bin.zst, a compressed version. (Kali and Debian ship it uncompressed in a package called firmware-realtek, which doesn't exist on Ubuntu.)
The fix: install zstd and unpack it.
bash
sudo apt install zstd
sudo zstd -d /lib/firmware/rtw88/rtw8821a_fw.bin.zst \
-o /mnt/wsl/tplink-firmware/rtw88/rtw8821a_fw.binsudo apt install zstd
sudo zstd -d /lib/firmware/rtw88/rtw8821a_fw.bin.zst \
-o /mnt/wsl/tplink-firmware/rtw88/rtw8821a_fw.binπ§© Bug #2: The driver didn't exist
Next error:
modprobe: FATAL: Module rtw88_8821au not foundmodprobe: FATAL: Module rtw88_8821au not foundMy WSL kernel was 6.18.33.2, and it simply didn't include this driver. My friend's working setup was on a newer kernel. One command fixed it:
powershell
wsl --update
wsl --shutdownwsl --update
wsl --shutdownAfter the update I was on 6.18.58.1, and the driver loaded straight away. β
π Golden rule: if
modprobesays the module isn't found, checkuname -rand update WSL before trying anything fancy.
β‘ The fix for the fix: Wi-Fi WSL Connect
Once everything worked by hand, I built Wi-Fi WSL Connect, a tiny native Windows app with one job.
Click Connect, and it:
- β
finds the adapter in
usbipd list - β shares it if needed (one-time admin prompt)
- β keeps the WSL VM awake, so the adapter doesn't get dropped
- β
prepares the firmware (handles the
.zstproblem automatically) - β attaches the adapter and loads the driver
- β waits until the wireless interface actually appears, then turns green
Click Disconnect, and the adapter goes back to Windows.
It's a single .exe built in C#. No Python, no extra runtime. It just needs usbipd-win installed.
π Lessons from building it
My first versions did not go smoothly:
- Attempt 1: a Python app. Worked, but I wanted a real Windows app, not a script.
- Attempt 2: PowerShell with a GUI. Double-clicked itβ¦ nothing happened. Turns out Windows PowerShell 5.1 chokes on non-ASCII characters (like β or β) in scripts saved without a BOM. It silently fails to parse. π
- Attempt 3: C# WinForms. It ran, then crashed with
Method not found: String.Split(Char, StringSplitOptions). I'd compiled against newer APIs that don't exist in the .NET Framework 4.8 that ships with Windows 11. Switching to the older method overloads fixed it. - The distro name bug.
wsl -l -voutput has weird spacing and encoding, so my parsed name didn't match and WSL saidWSL_E_DISTRO_NOT_FOUND. Now the app just uses your default distro.
Four rewrites for one button. Worth it. π
πΆ Proof it works: connecting to Wi-Fi from WSL
With the adapter attached, I connected to my own phone hotspot right from Ubuntu using nmcli (NetworkManager's command-line tool):
bash
sudo nmcli device wifi connect <hotspot-BSSID> --ask
ip asudo nmcli device wifi connect <hotspot-BSSID> --ask
ip a
The adapter got an IP from the hotspot, inside WSL, completely separate from Windows' own Wi-Fi. π
π‘ And nowβ¦ monitor mode
The real goal. Four commands:
bash
sudo ip link set wlxa842a160ef71 down
sudo iw dev wlxa842a160ef71 set type monitor
sudo ip link set wlxa842a160ef71 up
iw devsudo ip link set wlxa842a160ef71 down
sudo iw dev wlxa842a160ef71 set type monitor
sudo ip link set wlxa842a160ef71 up
iw dev
There it is: type monitor, channel 1, 20 dBm. A USB Wi-Fi adapter in monitor mode, running inside WSL on a Windows laptop. π₯
To switch back, run the same lines with managed instead of monitor.
π‘ If NetworkManager is managing the adapter, it may fight you. Run
sudo nmcli device set <iface> managed nofirst.
π― Final thoughts
This started as a small annoyance: six commands after every reboot. It turned into a deep dive into USB/IP, kernel firmware paths, compressed firmware and .NET Framework quirks.
Now my whole wireless lab starts with one click on a Windows laptop. Sometimes the best security tool isn't a new exploit. It's removing the friction that stops you from practising. π
π If this saved you a few hours of debugging, give it a clap!
π Follow me @krithickcyber for more red team, bug bounty and AI-powered security writeups.