Redirected from page "NdiswrapperIpn2220"

Clear message

1. Introduction

Ndiswrapper is a Linux module which allows Ubuntu to use the Windows driver for wireless cards. One may want to use ndiswrapper for a number of reasons:

  1. No open source driver provided in the Ubuntu repositories.
  2. The driver provided by default in Ubuntu is not working out.
  3. The proprietary driver provided by the card vendor is not working out.
  4. Test ndiswrapper performance versus alternative driver(s).
  5. Test hardware failure for your card.

2. Installation

  • If you do not know the name of the chipset which your wifi card uses, issue the following command in a terminal:

    lspci -vvnn

    An example partial output would be:

    03:00.0 Network controller [0280]: Atheros Communications Inc. AR9287 Wireless Network Adapter (PCI-Express) [168c:002e] (rev 01)
            Subsystem: Foxconn International, Inc. Device [105b:e034]
            Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
            Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
            Latency: 0, Cache Line Size: 64 bytes
            Interrupt: pin A routed to IRQ 17
            Region 0: Memory at c0600000 (64-bit, non-prefetchable) [size=64K]
            Capabilities: <access denied>
            Kernel driver in use: ath9k
            Kernel modules: ath9k

  • Ubuntu comes with the necessary ndiswrapper module pre-installed, but it needs the ndiswrapper-utils package to get it working. There is also a graphical interface for ndiswrapper that you can use called ndisgtk. This interface allows you to install, uninstall, and automatically start your ndiswrapper drivers very easily.

2.1. Installing ndiswrapper from the Ubuntu repositories

2.1.1. Installing packages With internet access on the Ubuntu computer

  1. If you already have Internet access via some other method while logged into Ubuntu, ensure the multiverse and universe repositories are enabled. For more on this, please see AddingRepositoriesHowto .

  2. Install the ndisgtk package from the Ubuntu repositories.

    sudo apt-get install ndisgtk

    If you don't know how to install applications then you can read this guide.

2.1.2. Installing packages with internet access on another computer

  1. For 12.04 Precise Pangolin
    1. http://packages.ubuntu.com/precise/misc/ndiswrapper-common

    2. http://packages.ubuntu.com/precise/misc/ndiswrapper-utils-1.9

    3. http://packages.ubuntu.com/precise/net/ndisgtk

  2. For 10.04 Lucid Lynx
    1. http://packages.ubuntu.com/lucid/misc/ndiswrapper-common

    2. http://packages.ubuntu.com/lucid/ndiswrapper-utils-1.9

    3. http://packages.ubuntu.com/lucid/ndisgtk

    Copy the appropriate files over to a directory on your Ubuntu computer (e.g. your Home directory) and install them in this order:

    sudo dpkg -i ndiswrapper-common_*.deb
    sudo dpkg -i ndiswrapper-utils-*.deb
    sudo dpkg -i ndisgtk_*.deb

    Info <!> The commands listed above are a general example of how to install a .deb package from the command line. You need to be in the directory where the files were copied to. If you are new to the terminal, consider reading BasicCommands.

2.1.3. Installing Packages without internet access

  • Without an Internet connection, you can still install ndiswrapper-utils from the Desktop CD. If you installed from that, the repository in which ndiswrapper-utils is found is on the CD, but not within the live session. You need to boot into your new Ubuntu installation and then reinsert the Desktop CD. You will be asked if you want to add the packages on the CD to your list of repositories. Put the CD into the drive, click System > Administration > Synaptic Package Manager and search for ndis. If you don't know how to install applications, read this guide.

3. Configuration

3.1. Disable Free Drivers

3.1.1. bcm43xx

  • If the driver for your bcm43xx card doesn't work for you, then you should disable it, because it will conflict with ndiswrapper. To disable it, add:

    blacklist bcm43xx

    for each driver to the modprobe blacklist.

    echo -e "blacklist bcm43xx\nblacklist b43\nblacklist b43legacy\nblacklist ssb" | sudo tee -a /etc/modprobe.d/blacklist

    Warning /!\ For Versions 10.04 and later, the filename has changed to blacklist.conf. Alternatively, one my edit the file:

    /etc/modprobe.d/blacklist

    and add:

    blacklist bcm43xx
    blacklist b43
    blacklist b43legacy
    blacklist ssb
    to the end of the file. Note: This only effects what is loaded at startup, so you will have to reboot to have the bcm43xx drivers disabled.

3.1.2. Atheros

  • If you have an Atheros based card, remember to blacklist:

    ath_pci
    ath_hal
    ath9k
    since ndiswrapper won't work if ath_hal is still loaded.

  • For 10.04 and on, this device uses the rt73usb driver. To check that the driver rt73usb is loaded, enter the command

    lsmod | grep rt73usb

    and check that the output includes a line starting with rt73usb , which means that the driver is loaded.However, if one wanted to use ndiswrapper, one would want to also blacklist:

    rt2500usb
    then restart.

3.3. PCI Wireless Adapter

  1. Open a Terminal (Applications | Accessories | Terminal), type lspci and press the return/enter key.

  2. Look through the output of the lspci command for an entry for your wireless card.

  3. Once you have identified your card, note down the contents of the first column, which should look like 0000:00:0c.0.

  4. Now, type lspci -n into the Terminal and press return.

  5. Find the PCI ID for your device. Your device will be referred to in the output of the command by the identifier which you just made a note of, e.g. 0000:00:0c.0. The PCI (chipset) ID will be in the third column of the output and will be in the form 104c:8400.

3.4. USB Wireless Adapter

  1. Open a Terminal (Applications | Accessories | Terminal), type lsusb and press the return/enter key.

  2. Look through the output of the lsusb command for an entry for your wireless adapter.

  3. Once you have identified your adapter, note down the contents of the chipset ID, this will be in the form 104c:8400.

3.5. Downloading Windows Drivers

  1. Retrieve the Windows driver corresponding to your chipset: Use the ID information you have just found to find and download known working Windows driver files for your wireless adapter, or one which is very similar (same chipset ID).
  2. Unpack the Windows driver by using the unzip, cabextract and/or unshield tools (run from the Terminal), and find the INF file (.INF or .inf extension) and the SYS file (.SYS or .sys extension). You may first need to install cabextract and unshield.

  3. If there are multiple INF/SYS files, one may want to investigate further to see if there are any hints about which of them should be used.
  4. If you have Windows drivers on a CD and can't extract the INF file or the Bin files you can try installing the drivers on a Windows computer. Then look in Start button - Control Panel - System - Hardware tab - Device Manager button. Look for the device under Network adapters. Once you have located the network adapter see what driver is being used by double clicking on the adapter in the list. The Driver tab 'should' have a Driver Details button. The driver and path will be listed; it will usually be in the folder:

    C:/WINDOWS/system32/DRIVERS
    To be sure, do a search for the file. The BIN file and INF file are usually the same name in the C:/WINDOWS/system32 folder. After you locate all the files copy to flash drive or burn to cd to move to Ubuntu computer for installation using Ndiswrapper.
  5. Make sure that the INF file, SYS file and any BIN files are all put into one directory.

3.6. Installing Windows driver

  • Warning /!\ It is best to download Windows drivers directly from an OEM website (ex. Dell, HP, etc.), and not a third party (ex. dropbox, etc.). As well, keep track of which specific version of the Windows driver you test with ndiswrapper.

3.6.1. Installing Windows driver using ndisgtk (ndiswrapper graphical interface)

  • If you chose to install ndisgtk, the graphical interface for ndiswrapper, after installation click on System | Administration | Windows wireless drivers and follow the instructions on-screen. For an idea of what to expect, some screenshots of ndisgtk can be found here. If this works, and you have a network connection, then you can skip to Automatically loading at Startup - ndisgtk will load the driver if it installs correctly.

3.6.2. Installing Windows driver using command line

  • In a Terminal, change to the directory where your .inf was extracted to and run the following command:

    sudo ndiswrapper -i <DRIVERNAME>.inf

    and <DRIVERNAME> is replaced with the name of the file. As well, ndiswrapper then copies the .inf and sys files into /etc/ndiswrapper/.... Don't forget that the filename you type in is case-sensitive.

3.6.2.1. Check to make sure the driver was installed correctly

  1. Run the following command from a Terminal:

    ndiswrapper -l

    If the driver is installed correctly, you should see the following output:

    Installed ndis drivers:
    {name of driver} driver present, hardware present

    or:

    {name of driver} : driver installed
    device ({Chipset ID}) present
    If you don't see this message:
  2. Try a different driver such as the drivers for Windows 2000, or another driver matching the PCI ID on the ndiswrapper list.

    1. Please see below for common errors and troubleshooting.

3.7. Load the new driver module

  • If ndiswrapper correctly associates the driver to the wireless adapter, you are now ready to load the driver into memory, and try to establish a network connection. Open a Terminal and run the following commands:

    sudo depmod -a
    sudo modprobe ndiswrapper

    Then, also in a Terminal, check for error messages:

    tail /var/log/messages

    Alternatively, open a Terminal and try the commands:

    ip addr
    iwconfig

    Your wireless card should appear with an interface name of wlan0. If it doesn't appear here, then the driver is not working properly. If no errors are given, you should now be able to configure the network connection.

3.8. Configuring Wireless Network Settings

3.8.1. Configuring Wireless Network Settings using nm-applet (GNOME front end for Network Manager)

  1. If this applet is installed, it makes wireless network connection to multiple networks (roaming) easier - this is useful if you use your laptop to connect to wireless networks at more than one location.
  2. Open the Networking Admin tool (System | Administration | Networking), select the Wireless connection and click Properties, ensure the Enable roaming mode checkbox is ticked.

  3. Click the Network Manager icon (computers icon in the top right corner of system tray), your network ESSID should be shown in the drop-down list. Select your network by clicking on it.
  4. If the Network requires any further configuration (eg WEP key), a dialog should appear, select the correct settings and paste in your key.
  5. The Network Manager applet uses Keyring Manager to store your passwords - so a second dialog will open after this, asking to create a master password for the keyring manager. Note that you will be requested to enter the Master Keyring password each time you logon - there is a solution to avoid entering a password each time here.

  6. Your Wireless Network should now be configured - skip to Automatically loading at Startup.

    Warning /!\ If using this method the wireless network keeps dropping packets, or the wireless connection stopped responding after a few minutes, try using the network-admin method below.

    Warning /!\ nm-applet does not use the standard NetworkAdmin file /etc/network/interfaces to store the Wireless Network settings, so you will not be able to use ifup and ifdown commands to start / stop the Network adapter. Starting / Stopping ndiswrapper:

    sudo modprobe ndiswrapper
    sudo modprobe -r ndiswrapper
    can be used instead. This may make it harder to diagnose connection problems.

    Warning /!\ nm-applet requires an entry in /etc/modules to start ndiswrapper on system startup. However this setting needs to be removed if using manual configuration (network-admin), as ndiswrapper will be started by network-admin by the alias command in /etc/modprobe.d/ndiswrapper only.

3.8.2. Configuring Wireless Network Settings using network-admin (NetworkAdmin)

  1. An alternative to using the GNOME nm-applet is open the Networking Admin tool (System | Administration | Networking), select the Wireless connection and click Properties, ensure the Enable roaming mode checkbox is unticked.

  2. In the Network Name box, select / type the ESSID of your network.
  3. In the Password type box, select whether your network password is Hex (eg. 208AB43..) or Ascii (eg. secret).
  4. In the Password box, Type / paste your network password.
  5. In the Connection Configuration, select the Network configuration type - this is normally DHCP.
  6. If your network is configured using Static IP addresses, fill in the IP address of the computer, Subnet mask and Gateway IP address.
  7. Click OK to apply these settings - they will be stored to file /etc/network/interfaces.

  8. For completeness, In the Network Settings dialog click Save and type a memorable name for the network you have configured. This can be used to manually select between multiple networks.

  9. Your Wireless Network should now be configured - skip to Automatically loading at Startup.

Note: During startup, the system will activate the Networking Admin tool settings kept in the file /etc/network/interfaces, where the Networking tool saves its settings. You may diagnose these network settings by activating and deactivating the wireless network interface from the Terminal, which shows some diagnostic messages:

sudo ifdown wlan0
sudo ifup wlan0

You may diagnose the network adapter status with commands:

ip addr
iwconfig
dmesg
tail /etc/var/messages

3.8.3. Configuring Wireless Network Settings using the command line

  1. If the above methods did not produce a working Wireless Network connection, you can Edit the Network Interfaces file by hand and diagnose your network using the command line. You can discover settings with iwconfig beyond those on offer with the Networking tool. Also, the order of the wireless settings can be very important. If you discover that issuing iwconfig commands in a certain order on the command line is necessary, make sure the file asserts the settings in the same order.

  2. Test /etc/network/interfaces by activating and deactivating the wireless network interface from the Terminal, which shows some diagnostic messages:

    sudo ifdown wlan0
    sudo ifup wlan0

    You may diagnose the network adapter status with commands:

    ip addr
    iwconfig
    dmesg
    tail /etc/var/messages

    Please note that during startup, the system will activate the Networking Admin tool settings kept in the file:

    /etc/network/interfaces
    where the Networking tool saves its settings.

3.9. Automatically loading at start-up

  • If everything works, you need to tell your system to load the module when the system starts-up. Depending on the method of network manager you are using, will require a different setup. In order to configure ndiswrapper for use with the Networking Admin tool settings, add an Alias to associate wlan0 to ndiswrapper in modprobe.d :

    sudo ndiswrapper -m

3.9.1. Network Manager applet only

  • If you are using the nm-applet to configure Wireless Network, ndiswrapper will not be started by the network manager alias setting. In order to ensure the ndiswrapper module is loaded at system startup. First, make a backup copy of the file:

    /etc/modules

    before manually editing it. Then, edit the /etc/modules file to add an entry for ndiswrapper at the end of the file. In Ubuntu:

    gksudo gedit /etc/modules

    In Kubuntu:

    kdesu kate /etc/modules

    and add the word ndiswrapper to the end of this file and save it.

    Warning /!\ nm-applet requires entry in /etc/modules to start ndiswrapper on system startup. However this setting should be removed if using manual configuration (network-admin), as ndiswrapper will be started by network-admin alias command in /etc/modprobe.d/ndiswrapper and having the entry in etc/modules may cause the wireless network driver to not start properly.

4. Compiling the latest version of ndiswrapper

  • This section is based on an ndiswrapper page here. It is recommended that you first remove any sign of ndiswrapper from your computer. There is a module which installs by default with Ubuntu. To remove this, from a Terminal run the following commands:

    sudo modprobe -r ndiswrapper
    sudo apt-get --purge remove ndiswrapper-utils
    sudo rm -r /etc/ndiswrapper/
    sudo rm -r /etc/modprobe.d/ndiswrapper
    sudo rm /lib/modules/$(uname -r)/kernel/drivers/net/ndiswrapper/ndiswrapper.ko

    Info <!> Before you begin to compile your own ndiswrapper, please note that whenever you update your kernel you will need to recompile. However, it shouldn't be necessary to remove the previous traces of ndiswrapper, as detailed above when you reinstall.

4.1. Install kernel headers

  • From a Terminal, run:

    sudo apt-get install linux-headers-$(uname -r)

    and run the following for the dependencies:

    sudo apt-get install dh-make fakeroot gcc-3.4 build-essential

4.2. Download and unpack the current version

  • You can find the current version of ndiswrapper here. Then, in a terminal change to the directory where you saved the downloaded file and run the following commands:

    tar xvfz ndiswrapper-[current version].tar.gz
    cd ndiswrapper-[current version]

    Replace [current version] with the actual version of the file you downloaded.

4.3. Install Ndiswrapper

  • The most current version of ndiswrapper (since at least version 1.19) can no longer be compiled into a .deb package. To work around this, do the following while in your ndiswrapper directory (see above):

    sudo make uninstall
    sudo make

    It is advised that your run in fakeroot for the following:

    fakeroot
    sudo make install

    If any errors occur during these steps, please try installing again. It may be required for you to run in fakeroot during the entire process. When everything has installed without error, return to the install section of this document to finish setting up ndiswrapper.

4.4. Build deb packages and install (works only for older versions of ndiswrapper)

  • Info <!> You may want to use an older version of ndiswrapper to get your wireless card working. If for some reason you can not get the above steps working, then download a version before 1.16 for the following to apply. Run the following from the Terminal:

    fakeroot debian/rules binary-modules
    fakeroot debian/rules binary-utils
    cd ..
    sudo dpkg -i ndiswrapper-modules-[your kernel]_[current version]-1_i386.deb ndiswrapper-utils_[current version]-1_i386.deb

    Now go back to the Configuration section of this document to set up and use your newly installed ndiswrapper package.

5. Troubleshooting

  • If you cannot get a working driver, you may want to consider compiling and using the latest ndiswrapper release and changing the Windows driver version you tested with.
  • Can not modprobe ndiswrapper, fatal error given.
    • This error is usually given when ndiswrapper is compiled and installed. You have a bad installation or you didn't remove the module that came with Ubuntu. You need to uninstall ndiswrapper and make sure you remove the ndiswrapper module that came with Ubuntu. Instructions on how to uninstall ndiswrapper can be found here.

  • If you cannot connect, make sure eth0 (or any other network interface that may be in use) is down/deactivated. The command to take eth0 down is:

    sudo killall dhclient
    sudo ip link set eth0 down
  • Tried to install Windows driver from CD-ROM.
    • The files need to be on your hard drive, they can not be loaded from the cd-rom.
  • Not all files are copied over to the hard drive.
    • Not all files from the drive are needed. You basically need a .inf and a .sys file. Some drivers also use a .bin file but there shouldn't be any other file type needed.
  • Too many driver files copied to folder.
    • You should only have 1 .inf and 1 .sys file in the directory on your hard drive.
  • Can't get driver.inf file to install - file not found.
    • You have to be in the directory where the .inf file is or specify the full path to the file.
  • Another driver loads and binds to the device.
    • Sometimes ndiswrapper is used prematurely. There may be a native driver that comes with Ubuntu which is taking the primary driver position and conflicting with ndiswrapper. For more information on this, go to the WirelessTroubleShootingGuide and view the step on device drivers and ndiswrapper.

6. Reporting ndiswrapper bugs

6.1. Known issues

6.2. ndiswrapper from Ubuntu repositories

  • Please report bugs about ndiswrapper from the Ubuntu repositories via the terminal:

    ubuntu-bug ndiswrapper-utils-1.9

6.3. ndiswrapper downloaded from upstream

7. Useful Links


CategoryNetworking

WifiDocs/Driver/Ndiswrapper (last edited 2015-03-13 00:40:56 by 5e00a246)