## page was renamed from WifiDocs/Ndiswrapper #pragma section-numbers on ||<>|| = Introduction = [[https://launchpad.net/ubuntu/+source/ndiswrapper|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. 1. The driver provided by default in Ubuntu is not working out. 1. The proprietary driver provided by the card vendor is not working out. 1. Test ndiswrapper performance versus alternative driver(s). 1. Test hardware failure for your card. = 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- SERR- 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 [[https://launchpad.net/ubuntu/+source/ndisgtk|ndisgtk]]. This interface allows you to install, uninstall, and automatically start your ndiswrapper drivers very easily. == Installing ndiswrapper from the Ubuntu repositories == === 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 . 1. 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 [[http://help.ubuntu.com/ubuntu/desktopguide/C/add-applications.html|read this guide]]. === Installing packages with internet access on another computer === 1. For 12.04 Precise Pangolin a. [[http://packages.ubuntu.com/precise/misc/ndiswrapper-common]] a. [[http://packages.ubuntu.com/precise/misc/ndiswrapper-utils-1.9]] a. [[http://packages.ubuntu.com/precise/net/ndisgtk]] 1. For 10.04 Lucid Lynx a. [[http://packages.ubuntu.com/lucid/misc/ndiswrapper-common]] a. [[http://packages.ubuntu.com/lucid/ndiswrapper-utils-1.9]] a. [[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 }}} ''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''. === 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, [[http://help.ubuntu.com/starterguide/C/ch02.html|read this guide]]. <> = Configuration = == Disable Free Drivers == === bcm43xx === If the driver for your [[https://help.ubuntu.com/community/WifiDocs/Driver/bcm43xx|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 }}} /!\ 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. === 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. == D-link DWL-G122 USB wireless device == 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. == PCI Wireless Adapter == 1. Open a Terminal ('''Applications''' | '''Accessories''' | '''Terminal'''), type {{{lspci}}} and press the return/enter key. 1. Look through the output of the {{{lspci}}} command for an entry for your wireless card. 1. Once you have identified your card, note down the contents of the first column, which should look like ''0000:00:0c.0''. 1. Now, type {{{lspci -n}}} into the Terminal and press return. 1. 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''. == USB Wireless Adapter == 1. Open a Terminal ('''Applications''' | '''Accessories''' | '''Terminal'''), type {{{lsusb}}} and press the return/enter key. 1. Look through the output of the {{{lsusb}}} command for an entry for your wireless adapter. 1. Once you have identified your adapter, note down the contents of the chipset ID, this will be in the form ''104c:8400''. == 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). 1. 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 [[https://launchpad.net/ubuntu/+source/cabextract|cabextract]] and [[https://launchpad.net/ubuntu/+source/unshield|unshield]]. 1. 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. 1. 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. 1. Make sure that the INF file, SYS file and any BIN files are all put into one directory. == Installing Windows driver == /!\ 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. === 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 [[http://lxer.com/module/newswire/view/46385/|here]]. If this works, and you have a network connection, then you can skip to [[#autostart|Automatically loading at Startup]] - ndisgtk will load the driver if it installs correctly. === 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 .inf }}} and 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. ==== 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: 1. Try a different driver such as the drivers for Windows 2000, or another driver matching the PCI ID on the [[http://ndiswrapper.sourceforge.net/mediawiki/index.php/List|ndiswrapper list]]. a. Please see below for common errors and troubleshooting. == 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. == Configuring Wireless Network Settings == === 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. 1. Open the [[NetworkAdmin|Networking Admin tool]] ('''System''' | '''Administration''' | '''Networking'''), select the Wireless connection and click '''Properties''', ensure the '''Enable roaming mode''' checkbox is ticked. 1. 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. 1. If the Network requires any further configuration (eg WEP key), a dialog should appear, select the correct settings and paste in your key. 1. 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 [[http://ubuntuforums.org/showpost.php?p=2776815&postcount=1|here]]. 1. Your Wireless Network should now be configured - skip to [[#autostart|Automatically loading at Startup]]. /!\ 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. /!\ 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. /!\ 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. === Configuring Wireless Network Settings using network-admin (NetworkAdmin) === 1. An alternative to using the GNOME nm-applet is open the [[NetworkAdmin|Networking Admin tool]] ('''System''' | '''Administration''' | '''Networking'''), select the Wireless connection and click '''Properties''', ensure the '''Enable roaming mode''' checkbox is unticked. 1. In the Network Name box, select / type the ESSID of your network. 1. In the Password type box, select whether your network password is Hex (eg. 208AB43..) or Ascii (eg. secret). 1. In the Password box, Type / paste your network password. 1. In the Connection Configuration, select the Network configuration type - this is normally DHCP. 1. If your network is configured using Static IP addresses, fill in the IP address of the computer, Subnet mask and Gateway IP address. 1. Click '''OK''' to apply these settings - they will be stored to file {{{/etc/network/interfaces}}}. 1. 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. 1. Your Wireless Network should now be configured - skip to [[#autostart|Automatically loading at Startup]]. Note: During startup, the system will activate the [[NetworkAdmin|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 }}} === 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. 1. 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 [[NetworkAdmin|Networking Admin tool]] settings kept in the file: {{{ /etc/network/interfaces }}} where the Networking tool saves its settings. <> == 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 [[NetworkAdmin|Networking Admin tool]] settings, add an Alias to associate wlan0 to ndiswrapper in modprobe.d :{{{ sudo ndiswrapper -m }}} === 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. /!\ 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. <> = Compiling the latest version of ndiswrapper = ''This section is based on an ndiswrapper page [[http://ubuntuforums.org/showthread.php?p=601226|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 }}} 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. == 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 }}} == Download and unpack the current version == You can find the current version of ndiswrapper [[http://sourceforge.net/project/showfiles.php?group_id=93482|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. == 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|install]] section of this document to finish setting up ndiswrapper. == Build deb packages and install (works only for older versions of ndiswrapper) == 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 [[#configure|Configuration]] section of this document to set up and use your newly installed ndiswrapper package. = 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 [[http://ndiswrapper.sourceforge.net/mediawiki/index.php/Uninstall|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. = Reporting ndiswrapper bugs = == Known issues == == ndiswrapper from Ubuntu repositories == Please report bugs about ndiswrapper from the Ubuntu repositories via the terminal: {{{ ubuntu-bug ndiswrapper-utils-1.9 }}} == ndiswrapper downloaded from upstream == When reporting bugs in ndiswrapper downloaded directly from their website, please report it to them directly via [[http://sourceforge.net/p/ndiswrapper/bugs/]]. Report feature requests to them directly via [[http://sourceforge.net/p/ndiswrapper/feature-requests/]]. Please do not report problems with the upstream release to [[Launchpad]]. = Useful Links = * [[http://sourceforge.net/apps/mediawiki/ndiswrapper/index.php?title=Main_Page|The ndiswrapper Wiki]] * You can also check out [[http://en.wikipedia.org/wiki/Comparison_of_open_source_wireless_drivers| Wikipedia]] for a comparison of free software drivers which don't depend on non-free firmware. * [[http://ubuntuforums.org/showthread.php?t=197102|Automated Ndiswrapper installation]]: an alternative method to install Ndiswrapper and set it up with Network Manager * WifiDocs ---- CategoryNetworking