≡ Menu

Ubuntu Linux Install and Configure Ndiswrapper and wpa_supplicant

Q. How do I install NdisWrapper and wpa_supplicant under Ubuntu Linux?

A. NdisWrapper is a free software driver wrapper that enables the use of Microsoft Windows drivers for wireless network devices such as PCI cards, USB modems on Linux / Unix-like operating systems.

Ndiswrapper works by implementing the Windows kernel and NDIS APIs, and dynamically linking the driver to this implementation.

You need to install following softwares:

  • ndiswrapper-common : Common scripts required to use the utilities
  • ndiswrapper-utils : Userspace utilities for the ndiswrapper linux

Step # 1: Download and install ndiswrapper

You can download .deb ndiswrapper packages here

Alternatively, you can install the same using apt-get command:
$ apt-cache search ndiswrapper-utils
Output (note version number 1.9):

ndiswrapper-utils-1.9 - Userspace utilities for the ndiswrapper linux kernel module

Now install it:
$ sudo apt-get install ndiswrapper-common ndiswrapper-utils-1.9

Step # 2: Copy .INF and .SYS files

You need to copy .INF and .SYS files from CD / floppy disk provided with your device. You can also obtain driver from manufactures web site.

Step # 3: Install Driver

To install driver, enter:
$ sudo ndiswrapper -i driver-name.inf
Verify that driver was installed:
$ ndiswrapper -l
Finally, install ndiswrapper driver
$ sudo modprobe ndiswrapper

Step # 4: Verify wireless interface

Use iwconfig to see your wireless interface:
$ iwconfig
Sample output:

lo        no wireless extensions.
eth0      no wireless extensions.
wlan0     IEEE 802.11g  ESSID:"payalhome"
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:1B:2F:A3:4C:9A
          Bit Rate=54 Mb/s   Sensitivity=-200 dBm
          RTS thr=2346 B   Fragment thr=2346 B
          Power Management:off
          Link Quality:29/100  Signal level:-77 dBm  Noise level:-96 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Make sure your driver get loaded each time you boot your computer:
$ sudo ndiswrapper -m

Step # 5: Install wpa_supplicant

Wireless networks do not require physical access to the network equipment in the same way as wired networks. This makes it easier for unauthorized users to passively monitor a network and capture all transmitted frames. In addition, unauthorized use of the network is much easier. In many cases, this can happen even without user’s explicit knowledge since the wireless LAN adapter may have been configured to automatically join any available network. So configure your wireless router for WPA or WPA2 security (refer router documentation for more information).

wpa_supplicant is Wi-Fi Protected Access client and can be install by entering following command:
$ sudo apt-get install wpasupplicant wpagui

  • /etc/wpa_supplicant.conf - Default configuration file

Scan your network

Type the following command to scan your network
$ iwlist wlan0 scan
Sample output:

wlan0     Scan completed :
          Cell 01 - Address: 00:1A:2F:A4:4C:9A
                    ESSID:"payalhome"
                    Protocol:IEEE 802.11g
                    Mode:Managed
                    Frequency:2.462 GHz (Channel 11)
                    Quality:37/100  Signal level:-72 dBm  Noise level:-96 dBm
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Extra:bcn_int=100
                    Extra:atim=0
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : WEP-40
                        Pairwise Ciphers (1) : TKIP
                        Authentication Suites (1) : PSK
                    IE: WPA Version 1
                        Group Cipher : WEP-40
                        Pairwise Ciphers (1) : WEP-40
                        Authentication Suites (1) : PSK

Step # 6a: Configure Wireless card for WPA authentication

Open /etc/wpa_supplicant.conf file:
$ gksudo gedit /etc/wpa_supplicant.conf
OR
$ gksudo vi /etc/wpa_supplicant.conf
Append configuration as follows:

network={
        ssid="YOUR-NETWORK-ESSID"
        proto=WPA
        key_mgmt=WPA-PSK
        pairwise=TKIP
        group=TKIP
        psk="YOUR-PASSWORD"
}

Save and close the file.

Step # 6b: Configure Wireless card for WPA2 authentication

Open /etc/wpa_supplicant.conf file:
$ gksudo gedit /etc/wpa_supplicant.conf
OR
$ gksudo vi /etc/wpa_supplicant.conf
Append configuration as follows:

network={
        ssid="YOUR-NETWORK-ESSID"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP
        psk="YOUR-PASSWORD"
}

Save and close the file.

Connect to network

Type the following command:
$ sudo wpa_supplicant -d -c/etc/wpa_supplicant.conf -iDEVICE-NAME -Dwext
If your device name is wlan0, enter:
$ sudo wpa_supplicant -d -c/etc/wpa_supplicant.conf -iwlan0 -Dwext

Assign IP address

Finally, you need to assign IP address using DHCP server built into wireless router, simply enter two commands:
$ sudo ifconfig wireless-interface up
$ sudo dhclient wireless-interface
$ host google.com
$ ping nixcraft.com

If your device name is wlan0, enter:
$ sudo ifconfig wlan0 up
$ sudo dhclient wlan0

If every thing works as expected, you can start wpa_supplicant without -d option i.e replace -d by -B for the deamon mode:
$ sudo wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0 -Dwext

Further readings:

Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 18 comments… add one }

  • FErArg April 24, 2008, 7:03 am

    Great Post!

  • phyz June 4, 2008, 1:41 pm

    great post & it works for roaming mode but how about static ip with wpa or wep?

  • James June 5, 2008, 8:09 pm

    Wow, this was a very useful and well written guide. This is only my second day using ubuntu after years of Windows, but thanks to the clarity of your guide I had no trouble getting my wpa-psk card working. (However, before I found this guide I was lost in a swamp of overly complicated procedures and piecemeal advice from various forums.)

  • Ninster July 5, 2009, 3:54 pm

    This was extremely useful, concise but thorough. I had spent 3 days trying to get this to work with a Netgear WN311T using ndiswrapper, and this provided the breakthrough.

    Next step is to make it work automatically on boot.

  • Nitin August 13, 2010, 6:17 am

    Good post indeed. I succeded till step three i.e. i installed the driver. My network does not have any security mode enabled i.e. it is open still ESSID is not scanned by the system. I get the following output. I am new to Linux can anybody help.
    nitin@office2:~$ iwconfig
    lo no wireless extensions.

    eth0 no wireless extensions.

    wlan0 IEEE 802.11g ESSID:off/any
    Mode:Managed Channel:0 Access Point: Not-Associated
    Bit Rate:1 Mb/s Sensitivity=-200 dBm
    RTS thr=2346 B Fragment thr=2346 B
    Power Management:off
    Link Quality:0 Signal level:0 Noise level:0
    Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
    Tx excessive retries:0 Invalid misc:0 Missed beacon:0

    nitin@office2:~$

  • Nitin August 13, 2010, 6:42 am

    Upon scanning the network I get the following output. I want to connect to ‘compex-np27g’

    nitin@office2:~$ iwlist wlan0 scan
    wlan0 Scan completed :
    Cell 01 – Address: 00:80:48:4C:3E:73
    ESSID:”compex-np27g”
    Protocol:IEEE 802.11g
    Mode:Managed
    Frequency:2.412 GHz (Channel 1)
    Quality:56/100 Signal level:-60 dBm Noise level:-96 dBm
    Encryption key:off
    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
    9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
    48 Mb/s; 54 Mb/s
    Extra:bcn_int=100
    Extra:atim=0
    Cell 02 – Address: 00:02:6F:47:AC:1E
    ESSID:”admin”
    Protocol:IEEE 802.11b
    Mode:Managed
    Frequency:2.417 GHz (Channel 2)
    Quality:7/100 Signal level:-91 dBm Noise level:-96 dBm
    Encryption key:off
    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
    Extra:bcn_int=100
    Extra:atim=0
    Cell 03 – Address: 00:1E:40:E7:58:B9
    ESSID:”default”
    Protocol:IEEE 802.11g
    Mode:Managed
    Frequency:2.462 GHz (Channel 11)
    Quality:10/100 Signal level:-89 dBm Noise level:-96 dBm
    Encryption key:off
    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
    24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
    12 Mb/s; 48 Mb/s
    Extra:bcn_int=100
    Extra:atim=0

    nitin@office2:~$

  • milehunter September 7, 2010, 7:03 pm

    Hello. i have ptoblem on step 2. you say to copy the .sys and .inf files ok? but where to paste them? in which directory?

    • nixCraft September 7, 2010, 7:05 pm

      Copy to /tmp and run

      cp /media/cdrom/file.inf /tmp
      sudo ndiswrapper -i driver-name.inf
      
      • milehunter September 7, 2010, 7:31 pm

        i’m new on ubuntu so when i do this: cp /media/cdrom/file.inf /tmp,
        i get this: milehunter@milehunter-laptop:~$ cp /media/cdrom/file.inf /tmp
        cp: αδύνατη η εκτέλεση της stat στο αρχείο «/media/cdrom/file.inf»: No such file or directory

      • manu November 1, 2011, 8:28 pm

        hey after step 3 my ubuntu termina is showing WARNING: All config files need .conf: /etc/modprobe.d/ndiswrapper, it will be ignored in a future releas..what do you mean by that…and how to solve it.

      • mrb March 1, 2014, 7:38 pm

        tried this and all i get is:
        couldn’t open wg311v3.inf: no such file or directory at /usr/sbin/ndiswrapper-1.9 line
        219.
        tried to copy into sbin but says i don’t have permission.
        anyone have any ideas?

  • milehunter September 7, 2010, 7:22 pm

    i’m new on ubuntu so when i do this: cp /media/cdrom/file.inf /tmp,
    i get this: milehunter@milehunter-laptop:~$ cp /media/cdrom/file.inf /tmp
    cp: αδύνατη η εκτέλεση της stat στο αρχείο «/media/cdrom/file.inf»: No such file or directory

  • Hank Marshall November 8, 2011, 7:45 pm

    lo no wireless extensions.
    wlan0 IEEE 802.11g ESSID:off/any
    Mode:Managed Channel:0 Access Point: Not-Associated
    Bit Rate:1 Mb/s Sensitivity=-200 dBm
    RTS thr=2346 B Fragment thr=2346 B
    Power Management:off
    Link Quality:0 Signal level:0 Noise level:0
    Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
    Tx excessive retries:0 Invalid misc:0 Missed beacon:0

    I use WPE with 128 HEX password. Need help to get past step 3.
    ndiswrapper -lall inst ndiswrapper output, per above message.

    Help Help Thank you all

  • Hank Marshall November 8, 2011, 9:11 pm

    lo no wireless extensions.
    wlan0 IEEE 802.11g ESSID:off/any
    Mode:Managed Channel:0 Access Point: Not-Associated
    Bit Rate:1 Mb/s Sensitivity=-200 dBm
    RTS thr=2346 B Fragment thr=2346 B
    Power Management:off
    Link Quality:0 Signal level:0 Noise level:0
    Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
    Tx excessive retries:0 Invalid misc:0 Missed beacon:0

    I use WPE with 128 HEX password. Need help to get past step 3.
    ndiswrapper -lall inst ndiswrapper output, per above message.

    Help Help Thank you all

    • Hank Marshall November 8, 2011, 9:17 pm

      Will I receive any info on this ????

  • Melqyahd February 6, 2012, 12:46 am

    Hi,

    In the step 4, after completing the steps before, when I type “iwconfig” all I get is this:

    lo no wireless extensions.
    eth0 no wireless extensions.

    It doesn’t appear wlan0 in here… Could you help me, please?

    Thanks,
    Melqyahd

  • knt December 13, 2013, 11:45 am

    really i have wireless card with RTL8188CE really tried every ting but its not working

  • Sam January 23, 2014, 2:42 pm

    Hey, assuming you have a network with a duplicate ESSID but on a different channel, how would you configure that on the wpa_supplicant configuration file?

Leave a Comment