Ndiswrapper

Differences between revisions 2 and 13 (spanning 11 versions)
Revision 2 as of 2006-02-09 22:38:52
Size: 18797
Editor: c-24-125-47-253
Comment: merged forum/hardware/ndiswrapperWithWPA into document
Revision 13 as of 2006-04-20 18:45:07
Size: 13837
Editor: 84
Comment: Major cleanup, Dapper-proofing, general grammar and tidiness
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from WifiDocs/Ndiswrapper
Line 6: Line 7:
If your wireless network card does not have a native linux driver for it you can use the windows drivers with ndiswrapper. Ndiswrapper is a module in linux that allows linux to use the windows driver for wireless cards (in most cases).
 

If you do not know what chipset your wifi card uses, issue the {{{lspci}}}
command in a terminal. It should be listed there. In order to see if your
chipset is known to work with the ndiswrapper module, find your card in the
list [http://ndiswrapper.sourceforge.net/mediawiki/index.php/List here].
That link might even provide you with useful tips to get your specific card
to work, as well as providing a link to the working Windows drivers.

 * Before going any further, are you using a Live CD? If you are, give up now. This won't work.
 * If you are running ubuntu AMD64 bit, go to links section for instructions.

<!> These instructions apply only to the x86 Install CD version of Ubuntu. If you are running Ubuntu for AMD64, please see HowtoUseNdiswrapperOnAmd64Ubuntu for instructions. These instructions '''do not''' apply to Ubuntu for Power PC (PPC) and the Ubuntu Live CDs.

  Even if your wireless network card does not have a native Linux driver, you may still be able to get it working with ndiswrapper. Ndiswrapper is a Linux module which allows Ubuntu to use the Windows driver for wireless cards (in most cases).

  If you do not know the name of the chipset which your wifi card uses, issue the {{{lspci}}} command in a terminal; it should be listed there. In order to see if your chipset is known to work with the ndiswrapper module, find your card in the list [http://ndiswrapper.sourceforge.net/mediawiki/index.php/List here].
  The link may even provide you with useful tips on how to get your specific card to work, as well as providing a link to the working Windows drivers.
Line 21: Line 17:
== Install necessary packages ==
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 to using ndiswrapper which you can use.

=== With internet access on ubuntu pc ===

If you have internet access via some other method while logged into ubuntu, you can  install the apps from the repositories. If you don't know how to install apps then you can read [http://help.ubuntu.com/starterguide/C/ch02.html how to here]
 
{i} ''You may have to add the multiverse and universe repositories which is explained in the link.''

=== With internet access from another pc ===
If you do not have internet access you can go to a pc that has internet access and download these two packages.

 1. For 5.04 Hoary Hedgehog
== Install the necessary packages ==
  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 to using ndiswrapper which you can use.

=== With Internet access on an Ubuntu computer ===

  
If you have Internet access via some other method while logged into Ubuntu, you can install the necessary packages from the Ubuntu repositories. If you don't know how to install applications then you can read [http://help.ubuntu.com/starterguide/C/ch02.html how to here].

{i} ''You may have to enable the multiverse and universe repositories; see AddingRepositoriesHowto''

=== With Internet access on another computer ===

  
If you do not have a working Internet connection, you can use another computer which is connected to the Internet to download the following packages.

  1. For 5.04 Hoary Hedgehog
Line 34: Line 32:
    a. ndisgtk is not in hoary repositories, /!\ not verified but you can try the breezy app to see if it works. See breezy section for link.
 1. For 5.10 Breezy Badger
    a. ndisgtk is not in hoary repositories, /!\ not verified but you can try the Breezy app to see if it works. See Breezy section for link.
  1. For 5.10 Breezy Badger
Line 38: Line 36:
 1. For 6.04 Dapper Drake   1. For 6.04 Dapper Drake
Line 41: Line 39:
    <!> ''At time of writing this dapper was not released so links may change. You can look [http://packages.ubuntu.com/dapper/ here] and search for the packages.''
[[BR]]
  Copy the appropriate files over to a directory on your ubuntu machine ''(a good location is /home/(user_name)/drivers)'' and install them in this order:

<!> ''At the time of writing, Dapper was not released and so links may change. You can look [http://packages.ubuntu.com/dapper/ here] and search for the packages.''


Copy the appropriate files over to a directory on your Ubuntu computer ''(e.g. your Home directory)'' and install them in this order:
Line 53: Line 53:
<!> ''The commands listed above are a general example on how to install a .deb package from the command line. You need to be in the directory where the files were copied to and you need to replace the end with the actual package name you are installing. If you are new to the terminal, I suggest reading the wiki:BasicCommands:BasicCommands page here on the wiki.''


=== With no internet access ===

With out any access you can still install ndiswrapper-utils from the install cd but ndisgtk is not on the disk. Put the disk back in the drive, open up synaptic from System>Admin and search for ndis. If you do not know how to install apps, click on the lifepreserver on the top panel and read Ubuntu X.XX starter guide.
<!> ''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 and you need to replace the file name with the actual name of the package which you are installing. If you are new to the terminal, consider reading BasicCommands.

=== Without Internet access ===

  Without an Internet connection, you can still install ndiswrapper-utils from the install CD. However, ndisgtk is not included on the disk. Put the disk into the drive, start the '''Synaptic Package Manager''' from '''System''' | '''Administration''' and search for 'ndis'. If you do not know how to install applications, go to '''System''' | '''Help''' | '''System Documentation''' and read the ''Ubuntu Desktop Guide''.
Line 63: Line 62:

'''Important: Do NOT use drivers on your CD. They may work and you can try them, but you may experience kernel crashes etc., if the driver on your CD has not been tested.
Instead, you need to download appropriate Windows XP driver for your card from the Wiki entry List. To identify the driver that you need, first identify the card you have with 'lspci' and note the first column such as 0000:00:0c.0 and then find out the PCI ID of the card that with 'lspci -n' corresponding to the first column of 'lspci' output. The PCI ID is third column or fourth in some distributions and of the form '104c:8400'. Now you need to get the Windows driver for this chipset. In the [http://ndiswrapper.sourceforge.net/mediawiki/index.php/list list], find out an entry for the same PCI ID and download the driver corresponding to it ''(don't worry if the link is not under your exact card as many cards you the same chipsets)''. Unpack the Windows driver with unzip/cabextract/unshield tools and find the INF file (.INF or .inf extension) and the SYS file (.SYS or .sys extension). ''(this is important as some drivers have a connection with the .sys file which makes the driver work properly)''
If there are multiple INF/SYS files, you may look in the [http://ndiswrapper.sourceforge.net/mediawiki/index.php/list List] if there are any hints about which of them should be used. Make sure the INF file, SYS file and any BIN files for example, TI drivers use BIN firmware files are all in one directory on your harddrive.'''
  /!\ '''Important:''' Be careful when using the drivers from the CD included with the wireless card. They may work and you can try them, but you could experience kernel crashes and other serious problems if the driver on your CD has not been tested with ndiswrapper.

 You should download a tested Windows XP driver which is suitable for your card from the ndiswrapper list.

 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 ID will be in the third column of the output and will be in the form ''104c:8400''.
 1. Retrieve the Windows driver corresponding to your chipset. Use the information you have just found and the ndiswrapper [http://ndiswrapper.sourceforge.net/mediawiki/index.php/list list] to find and download the correct files for your card, or one which is very similar.
 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 ''cabextract'' and ''unshield''.
 1. If there are multiple INF/SYS files, look in the ndiswrapper [http://ndiswrapper.sourceforge.net/mediawiki/index.php/list list] to see if there are any hints about which of them should be used.
 1. Make sure that the INF file, SYS file and any BIN files are all put into one directory.
Line 70: Line 78:
If you chose the ndisgtk route, after install, click on ''System > Admin > Windows wireless drivers'' and follow through the prompts.

B) ''Some screen
shots of ndisgtk can be found [http://lxer.com/module/newswire/view/46385/ here].''
  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].
Line 77: Line 82:
==== Install the windows driver ====

  {{{
  sudo ndiswrapper -i ~/drivers/{driver}.inf
  }}}

  (assuming the driver is in a directory in your home folder called '''drivers''')

==== checking to make sure it installed correctly. ====

  Run this command:
==== Install the Windows driver ====

In a Terminal, run the following command:


  {{{
  sudo ndiswrapper -i ~/drivers/drivername.inf
  }}}

  (assuming the driver is in a directory in your home folder called ''drivers'', and is named ''drivername.inf'')

ndiswrapper then copies the {{{.inf}}} and {{{sys}}} files into {{{/etc/ndiswrapper/...}}}. Don't forget that the filename you type in is case-sensitive.

==== C
hecking to make sure the driver was installed correctly ====

  Run the following command from a Terminal:
Line 92: Line 101:
  If this is installed correctly you should see:
a
ttachment:IconsPage/IconExample48.png
  If the driver is installed correctly, you should see the following output:
Line 99: Line 107:
  If you do NOT see this message.
   a. try a different driver such as the drivers for win2k or another driver matching the pciid on the [http://ndiswrapper.sourceforge.net/mediawiki/index.php/List ndiswrapper list]
   b. look for additional help at [http://www.ubuntuforums.org the Ubuntu Forums].

==== loading the new module. ====

  First run this command:
  If you don't see this message:
   a. Try a different driver such as the drivers for win2k (Windows 2000), or another driver matching the PCI ID on the [http://ndiswrapper.sourceforge.net/mediawiki/index.php/List ndiswrapper list].
   a. This document has a [#trouble troubleshooting] section which may provide an answer.
   a. Look for additional help. Read HowToGetHelp for more information.

==== Loading the new driver module ====

  Open a Terminal and run the following commands:
Line 108: Line 117:
  }}}
  
  then:
  {{{
Line 115: Line 120:
  With no errors given you can go to the networking tool ''System > Administration > Networking'' and configure your device, or try the command {{{ifconfig}}}. Your wireless card should now appear with an interface name of wlan0. If it doesn't appear here then the driver is not working properly.

=== automatically load at boot-time ===
  If everything works, you need to tell your system to load the module on boot. Two ways you can do this are:
  Then, also in a Terminal, check for error messages:
  {{{
  tail /var/log/messages
  }}}

  If no errors are given, you should be able to configure the network connection with the Networking tool ('''System''' | '''Administration''' | '''Networking'''). Alternatively, open a Terminal and try the commands {{{ifconfig}}} and {{{iwconfig}}}. Your wireless card should hopefully appear with an interface name of ''wlan0''. If it doesn't appear here, then the driver is not working properly.

  During startup, the system will activate the settings kept in the file {{{/etc/network/interfaces}}}, where the Networking tool saves its settings. Edit the file by hand if you 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.

  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
  }}}

  ''For information on getting WPA to work, read the WPAHowto.''

=== Automatically loading at start-up ===
  If everything works, you need to tell your system to load the module when the system starts-up. You can either type the following into the Terminal, which will add the proper line to the ''/etc/modules'' file:
Line 124: Line 145:
  which will add the proper line to the /etc/modules file or you can add it manually by opening the file with this command:   or you can add it manually by opening the file with this command:
Line 130: Line 151:
  and add the word {{{ndiswrapper}}} to the end of this file and save.   and add the word {{{ndiswrapper}}} to the end of this file and save it.

/!\ It is strongly recommended that you make a backup copy of the ''/etc/modules'' file before manually editing it.

[[Anchor(trouble)]]
Line 133: Line 157:
 * If you can not get a working driver, you may want to consider compiling and using the latest ndiswrapper release. Breezy comes with v1.1 As of Jan 2006 v1.8 is the stable release. 
 * 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. Need to uninstall ndiswrapper and make sure you remove the ndiswrapper module that came with ubuntu. Uninstall instructions can be found [http://ndiswrapper.sourceforge.net/mediawiki/index.php/Uninstall here]
 * If you cannot get a working driver, you may want to consider compiling and using the latest ndiswrapper release. Ubuntu Breezy comes with v1.1, and as of Jan 2006 v1.8 is the stable release.
 * ''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 ifconfig eth0 down
}}}
Line 139: Line 168:
 * Tried to install driver from cd-rom
* Tried to install driver from CD-ROM
Line 143: Line 173:
 * Two many driver files copied to folder  * Too many driver files copied to folder
Line 148: Line 178:
   * Sometimes ndiswrapper is used prematuerly. There may be a native driver that comes with Ubuntu that's taking the primary driver position and conflicting with ndiswrapper. For more about this go to the wiki:WirelessTroubleshootingGuide:WirelessTroubleshootingGuide and the step on device drivers.


= Compile latest version of ndiswrapper =


 *
This HOWTO is based on ndiswrapper [http://ndiswrapper.sourceforge.net/mediawiki/index.php/InstallDebian Wiki Page]
 *
This was copied from the forums, page found [http://ubuntuforums.org/showthread.php?p=601226 here]. You can discuss any problems or errors there.
 * It is recommended to remove any sign of ndiswrapper from your pc. There is a module that installs by default with ubuntu. To do this, from a terminal run these commands:
[[BR]]
   * 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.


= Compiling the latest version of ndiswrapper =

''This section is based on an ndiswrapper [http://ndiswrapper.sourceforge.net/mediawiki/index.php/InstallDebian wiki page], and was copied from the Ubuntu Forums. The original post can be found [http://ubuntuforums.org/showthread.php?p=601226 here]. Please discuss any problems or errors you experience there.''

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:
Line 166: Line 195:
== Install kernel headers: == == Install kernel headers ==

  From a Terminal, run:
Line 172: Line 202:
and dependencies:   and run the following for the dependencies:
Line 178: Line 208:
== Download the current version ==

  You will find the current version of ndiswrapper [http://sourceforge.net/project/showfiles.php?group_id=93482 here].

== Untar ==
  Mo
ve to the file where you downloaded the file and run these commands. On the second command replace {{{[current version]}}} with the actual version of the file you downloaded.
== Download and unpack the current version ==

  You can find the current version of ndiswrapper [http://sourceforge.net/project/showfiles.php?group_id=93482 here].

  Using the Terminal, change to the directory where you saved the downloaded file and run the following commands:
Line 190: Line 219:
== Build deb packages: ==
 With the second command, replace {{{[current version]}}} with the actual version of the file you downloaded.

== Build deb packages and install ==

  Run the following from the Terminal:
Line 196: Line 228:
  }}}

== Install ==

  {{{
Line 204: Line 231:
  Now go back to the [#install install] section to set up and use your newly installed ndiswrapper package.

= WPA setup =

== Pre-amble ==
  (quoting notzac): I've been bashing at this for the last few hours as I just got myself a shiny new wireless router and wanted to use WPA-PSK rather than WEP. I don't pretend to be any sort of guru at this; I spent most of my time reading FAQs and Wiki entries; swore at my computer for a while when it didn't work and then just started experimenting. I've finally got what appears to be a fairly nice configuration that works great for me - I'm writing it up in the hopes that it helps someone else.


== Assumptions ==

  1. You can already access the network/internet -without- WPA or other encryption.
  1. You're using an ndiswrapper-based driver (probably not essential, but you'll have to modify a few of the commands if you're using madwifi or one of the native drivers - YMMV).
  1. Your wireless card comes up with an interface name of 'wlan0' (if not, you'll need to modify my examples to suit).
  1. You want to use WPA-PSK with either TKIP or AES/CCMP.
  1. Your router (or whatever) provides IP address details via DHCP (not essential, but you'll have to modify one of the files beyond my examples).
  1. Your router or WAP broadcasts its SSID (if not, [#anthony see Anthony's] notes at the bottom of this page).
    1. You're comfortable editing files and working with badly-written HOWTOs. :)


== The procedure ==

  First up, you'll need the wpasupplicant package. It's in the Universe repository, so you'll need to have that in your sources.list file. If you've already installed this package, I recommend that you reinstall; use these commands to get rid of it:
  {{{
  sudo killall wpasupplicant
  sudo dpkg --purge wpasupplicant
  }}}
  Now install a fresh copy:
  {{{
  sudo apt-get install wpasupplicant
  }}}
<!> If you compiled and installed a newer version of ndiswrapper then it's possible you will need to compile and install a newer version of wpasupplicant.

  After you've got it installed, start by modifying the "default" file -- I'm not sure why to be honest, but the installer told me to start there and I did:
  {{{
  sudo vi /etc/default/wpasupplicant
  }}}

attachment:IconsPage/IconExample48.png
  Here's what mine looks like; modify yours to taste:

  {{{
  # /etc/default/wpasupplicant
  # WARNING! Make sure you have a configuration file!
  ENABLED=1

  # Useful flags:
  # -D <driver> Wireless Driver
  # -i <ifname> Interface (required, unless specified in config)
  # -c <config file> Configuration file
  # -d Debugging (-dd for more)
  # -w Wait for interface to come up

  # OPTIONS="-w"
  }}}

  Save and exit.

  Next, you'll need to sort your pre-shared key out. My router allows me to input the passphrase that makes up the key itself; I originally tried putting this passphrase in as the wireless key, which failed to work altogether for fairly obvious reasons. Hindsight is wonderful like that. Take the passphrase that you used in your router or WAP and use wpa_passphrase to generate the key. You use this command in the following format:
  {{{
  wpa_passphrase <ssid> <passphrase>
  }}}
  So the command I ran looks something like this:
  {{{
  wpa_passphrase MyHomeWireless SuperSecretPassphrase
  }}}
attachment:IconsPage/IconExample48.png
  ... which gives you an output something like:

  {{{
  network={
        ssid="MyHomeWireless"
        #psk="SuperSecretPassphrase"
        psk=e42ac2538ef03f906d37332a0df4446150e04cdcdd392e 309486075065a70a1f
  }
  }}}
  Copy all that - we'll need in a moment. You now need to put that in to a configuration file for wpa_supplicant, which you first need to create. Given that you'll have the keys to your wireless access in this file, a little extra precaution is in order. Use the following commands to create and then open the file for editing:
  {{{
  sudo touch /etc/wpa_supplicant.conf
  sudo chmod 600 /etc/wpa_supplicant.conf
  sudo vi /etc/wpa_supplicant.conf
  }}}

attachment:IconsPage/IconExample48.png
  Using the output of wpa_passphrase we copied earlier as a base, you'll need to tell wpa_supplicant a few more details about your network. Here's what my copy of this file looks like when complete, with the sample data:

  {{{
  network={
        ssid="MyHomeWireless"
        #psk="SuperSecretPassphrase"
        psk=e42ac2538ef03f906d37332a0df4446150e04cdcdd392e 309486075065a70a1f
        key_mgmt=WPA-PSK
        proto=WPA
  }
  }}}

  Save and exit.

  You should probably test this now - here's a good command to copy/paste to your cli (this will only work if you fulfill the assumptions of this HOWTO):
  {{{
  sudo ifconfig wlan0 up && sudo /usr/sbin/wpa_supplicant -Bw -Dndiswrapper -iwlan0 -c/etc/wpa_supplicant.conf && sudo dhclient wlan0
  }}}
  If that doesn't get you to the point where you can ping other hosts on your network, something is most likely wrong with wpa_supplicant (I'm assuming that it hasn't got anything to do with DHCP). Run these two commands:
  {{{
  sudo dhclient -r wlan0 && sudo ifconfig wlan0 down && sudo killall wpa_supplicant
  sudo ifconfig wlan0 up && sudo /usr/sbin/wpa_supplicant -w -Dndiswrapper -iwlan0 -c/etc/wpa_supplicant.conf -dd
  }}}
  This will give you a bunch of debugging output, and someone who is much more skilled than I might be able to help you out. Sorry, but this HOWTO isn't going to help you much more, as it's beyond my ken completely.

  If you got lucky and you -are- able to ping hosts on your network, now is the time to automate it. It's actually really easy. Run this command first to bring the wireless link down cleanly:
  {{{
  sudo dhclient -r wlan0 && sudo ifconfig wlan0 down && sudo killall wpa_supplicant
  }}}
  You need to tell your network interface configuration file how to deal with the wireless config nicely; here's what you need to put in for your wireless card (again, if you don't completely fulfill the assumptions of this HOWTO, you'll need to change a few things). Open up /etc/network/interfaces:
  {{{
  sudo vi /etc/network/interfaces
  }}}
  ... here's the part you'll need to add/modify in yours for the wireless:

  {{{
  auto wlan0
  iface wlan0 inet dhcp
  pre-up /usr/sbin/wpa_supplicant -Bw -Dndiswrapper -iwlan0 -c/etc/wpa_supplicant.conf
  post-down killall -q wpa_supplicant
  }}}

  Save and exit.

  We're all done! Wireless will now come up on boot (assuming that your computer already detects the card and loads the drivers for it already), and you can start/stop the wireless link with the following two commands:

  {{{
  sudo ifup wlan0
  sudo ifdown wlan0
  }}}


[[Anchor(anthony)]]
== If your router does not broadcast the SSID ==

  I recommend you do not broadcast the ssid for added security. It's just one more thing your potential intruder has to guess.

  First, set
  {{{
  ap_scan=2
  }}}
  This means, don't bother scanning (since it's not broadcasting anyway right), use the first network block.

  Since your router isn't broadcasting, you have to add some more detail about the encryption, in particular whether it's TKIP or CCMP(also known as AES).

  You also have to specify '''scan_ssid=1''', which means this router does not broadcast.

attachment:IconsPage/IconExample48.png
  Here is a sample of my network block:
  {{{
  network={
        ssid="myrouterssid"
        scan_ssid=1
        psk="topsecret"
        key_mgmt=WPA-PSK
        proto=WPA
        auth_alg=OPEN
        pairwise=TKIP
        group=TKIP
 }
  }}}

Enjoy using your network securely :)

= links =

[http://ndiswrapper.sourceforge.net/mediawiki/index.php/Main_Page ndiswrapper wiki]

[https://wiki.ubuntu.com/forum/hardware/ndiswrapperWithWPA?highlight=%28ndis%29 ndiswrapper with wpa encryption]

[https://wiki.ubuntu.com/HowtoUseNdiswrapperOnAmd64Ubuntu?highlight=%28ndiswrapper%29 Ndiswrapper on amd64 box]

wiki:WifiDocs/WifiDocs


  Now go back to the [#install install] section of this document to set up and use your newly installed ndiswrapper package.

= Useful Links =

[http://ndiswrapper.sourceforge.net/mediawiki/index.php/Main_Page The ndiswrapper Wiki]

HowtoUseNdiswrapperOnAmd64Ubuntu

WifiDocs


= Frequently Asked Questions =

  An FAQ page has been created for ndiswrapper. You can read or add your question at WifiDocs/Driver/Ndiswrapper/FAQ
Line 385: Line 247:
CategoryDocumentation CategoryNetworking CategoryDocumentation CategoryNetworking CategoryNetworking

1. Introduction

Info <!> These instructions apply only to the x86 Install CD version of Ubuntu. If you are running Ubuntu for AMD64, please see HowtoUseNdiswrapperOnAmd64Ubuntu for instructions. These instructions do not apply to Ubuntu for Power PC (PPC) and the Ubuntu Live CDs.

  • Even if your wireless network card does not have a native Linux driver, you may still be able to get it working with ndiswrapper. Ndiswrapper is a Linux module which allows Ubuntu to use the Windows driver for wireless cards (in most cases).

    If you do not know the name of the chipset which your wifi card uses, issue the lspci command in a terminal; it should be listed there. In order to see if your chipset is known to work with the ndiswrapper module, find your card in the list [http://ndiswrapper.sourceforge.net/mediawiki/index.php/List here]. The link may even provide you with useful tips on how to get your specific card to work, as well as providing a link to the working Windows drivers.

2. Install Repository Version

2.1. Install the necessary packages

  • 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 to using ndiswrapper which you can use.

2.1.1. With Internet access on an Ubuntu computer

  • If you have Internet access via some other method while logged into Ubuntu, you can install the necessary packages from the Ubuntu repositories. If you don't know how to install applications then you can read [http://help.ubuntu.com/starterguide/C/ch02.html how to here].

(i) You may have to enable the multiverse and universe repositories; see AddingRepositoriesHowto

2.1.2. With Internet access on another computer

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 and you need to replace the file name with the actual name of the package which you are installing. If you are new to the terminal, consider reading BasicCommands.

2.1.3. Without Internet access

  • Without an Internet connection, you can still install ndiswrapper-utils from the install CD. However, ndisgtk is not included on the disk. Put the disk into the drive, start the Synaptic Package Manager from System | Administration and search for 'ndis'. If you do not know how to install applications, go to System | Help | System Documentation and read the Ubuntu Desktop Guide.

Anchor(install)

2.2. Set up and install drivers

  • Warning /!\ Important: Be careful when using the drivers from the CD included with the wireless card. They may work and you can try them, but you could experience kernel crashes and other serious problems if the driver on your CD has not been tested with ndiswrapper.

  • You should download a tested Windows XP driver which is suitable for your card from the ndiswrapper list.
  • Open a Terminal (Applications | Accessories | Terminal), type lspci and press the return/enter key.

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

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

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

  • 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 ID will be in the third column of the output and will be in the form 104c:8400.

  • Retrieve the Windows driver corresponding to your chipset. Use the information you have just found and the ndiswrapper [http://ndiswrapper.sourceforge.net/mediawiki/index.php/list list] to find and download the correct files for your card, or one which is very similar.

  • 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.

  • If there are multiple INF/SYS files, look in the ndiswrapper [http://ndiswrapper.sourceforge.net/mediawiki/index.php/list list] to see if there are any hints about which of them should be used.

  • Make sure that the INF file, SYS file and any BIN files are all put into one directory.

2.2.1. ndisgtk instructions

  • 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].

2.2.2. Command line instructions

2.2.2.1. Install the Windows driver

In a Terminal, run the following command:

  •   sudo ndiswrapper -i ~/drivers/drivername.inf

    (assuming the driver is in a directory in your home folder called drivers, and is named drivername.inf)

ndiswrapper then copies the .inf and sys files into /etc/ndiswrapper/.... Don't forget that the filename you type in is case-sensitive.

2.2.2.2. Checking to make sure the driver was installed correctly

  • 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
    If you don't see this message:
    1. Try a different driver such as the drivers for win2k (Windows 2000), or another driver matching the PCI ID on the [http://ndiswrapper.sourceforge.net/mediawiki/index.php/List ndiswrapper list].

    2. This document has a [#trouble troubleshooting] section which may provide an answer.
    3. Look for additional help. Read HowToGetHelp for more information.

2.2.2.3. Loading the new driver module

  • 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

    If no errors are given, you should be able to configure the network connection with the Networking tool (System | Administration | Networking). Alternatively, open a Terminal and try the commands ifconfig and iwconfig. Your wireless card should hopefully appear with an interface name of wlan0. If it doesn't appear here, then the driver is not working properly.

    During startup, the system will activate the settings kept in the file /etc/network/interfaces, where the Networking tool saves its settings. Edit the file by hand if you 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.

    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

    For information on getting WPA to work, read the WPAHowto.

2.2.3. Automatically loading at start-up

  • If everything works, you need to tell your system to load the module when the system starts-up. You can either type the following into the Terminal, which will add the proper line to the /etc/modules file:

      sudo ndiswrapper -m
    or you can add it manually by opening the file with this command:
      sudo gedit /etc/modules

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

Warning /!\ It is strongly recommended that you make a backup copy of the /etc/modules file before manually editing it.

Anchor(trouble)

3. Troubleshooting

  • If you cannot get a working driver, you may want to consider compiling and using the latest ndiswrapper release. Ubuntu Breezy comes with v1.1, and as of Jan 2006 v1.8 is the stable release.
  • 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 ifconfig eth0 down

3.1. Some common errors

  • Tried to install 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.

4. Compiling the latest version of ndiswrapper

This section is based on an ndiswrapper [http://ndiswrapper.sourceforge.net/mediawiki/index.php/InstallDebian wiki page], and was copied from the Ubuntu Forums. The original post can be found [http://ubuntuforums.org/showthread.php?p=601226 here]. Please discuss any problems or errors you experience there.

  • 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

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 [http://sourceforge.net/project/showfiles.php?group_id=93482 here]. Using the 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]
  • With the second command, replace [current version] with the actual version of the file you downloaded.

4.3. Build deb packages and install

  • 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 [#install install] section of this document to set up and use your newly installed ndiswrapper package.

5. Useful Links

[http://ndiswrapper.sourceforge.net/mediawiki/index.php/Main_Page The ndiswrapper Wiki]

HowtoUseNdiswrapperOnAmd64Ubuntu

WifiDocs

6. Frequently Asked Questions

  • An FAQ page has been created for ndiswrapper. You can read or add your question at WifiDocs/Driver/Ndiswrapper/FAQ


CategoryDocumentation CategoryNetworking CategoryNetworking

WifiDocs/Driver/Ndiswrapper (last edited 2008-08-06 16:19:19 by localhost)