Ubuntu – How to configure WiFi adaptor to monitor mode

capturewireless

I have just successfully installed a driver (athk9_htc) for TP-Link TL-WN722N (a USB WiFi adaptor) in Ubuntu 14.04.1. My goal is to capture the WiFi traffic with Wireshark.

I try to configure the adaptor to monitor mode by running: sudo iwconfig wlan1 mode monitor
However it give me an error message:

Error for wireless request "Set Mode" (8B06):
    SET failed on device wlan1; Device or resource busy.

How can I set it to monitor mode?

Edited:
I do not agree this is a duplicated question. Actually I have found that thread before I asked this question. However there are two responses in that thread, but not any verified answer. If I do not ask this question again, how can I get the answer? Also the answer given by @chili555 is different to the responses in that thread, and I verified this answer is working. If the question is duplicated, should not it be adding a comment in that thread to indicate that a verified answer is here, instead of indicating an answered question is a duplicated question?

Best Answer

It may work if you first bring the interface down:

sudo ifconfig wlan1 down
sudo iwconfig wlan1 mode monitor

Check:

iwconfig

Not every device and driver combination are capable of monitor mode.