个人工具

“UbuntuHelp:WifiDocs/Driver/Ndiswrapper”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第2行: 第2行:
 
{{Languages|UbuntuHelp:WifiDocs/Driver/Ndiswrapper}}
 
{{Languages|UbuntuHelp:WifiDocs/Driver/Ndiswrapper}}
  
 
 
=== Using Ndiswrapper (an automated installation for Broadcom 4318 Wireless) ===
 
 
I know it's not usual to direct people from the wiki to a forum but here's the best way to get ndiswapper setup with Network Manager.  It's quick and easy and automated, also there is a supportive forum in case you run into issues.
 
 
[http://ubuntuforums.org/showthread.php?t=197102 HERE IS the Best Automated ndiswrapper installation I've ever found! ]
 
  
  
第15行: 第8行:
 
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).
 
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).
  
<!> These instructions apply only when using the x86 Alternate CD. 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 Desktop CDs.''
+
<!> These instructions apply only when using the x86 Alternate CD. If you are running Ubuntu for AMD64, please see [[UbuntuHelp:WifiDocs/NdiswrapperOnAMD64|NdiswrapperOnAMD64]] for instructions. These instructions '''do not''' apply to Ubuntu for Power PC (PPC) and the Ubuntu Desktop CDs.''
  
  
第21行: 第14行:
 
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.
 
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.
  
== Install Necessary Software ==
+
== Installation ==
  
 
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.
 
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.
第28行: 第21行:
 
Note: for Ubuntu 6.06 (Dapper), ndiswrapper-utils is included on the standard installation CD. You can install the package from the CD and skip to section 2.2...
 
Note: for Ubuntu 6.06 (Dapper), ndiswrapper-utils is included on the standard installation CD. You can install the package from the CD and skip to section 2.2...
  
=== With Internet access on an Ubuntu computer ===
+
=== Installing Packages (With Internet access on the Ubuntu computer) ===
  
 
If you already have Internet access via some other method while logged into Ubuntu:
 
If you already have Internet access via some other method while logged into Ubuntu:
第34行: 第27行:
 
1. Ensure the multiverse and universe repositories are enabled; see AddingRepositoriesHowto''
 
1. Ensure the multiverse and universe repositories are enabled; see AddingRepositoriesHowto''
  
2. Install the ''ndiswrapper'' and ''ndisgtk'' packages from the Ubuntu repositories. 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].
+
2. Install the ''ndisgtk'' package from the Ubuntu repositories. 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].
 +
 
 +
[[Anchor(install)]]
  
=== With Internet access on another computer ===
+
=== Installing Packages (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.
+
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. (See note about bug below)
  
==== Edgy Eft (6.10) ====
+
==== Feisty Fawn (7.04) and Edgy Eft (6.10) ====
 +
** For 7.04 Feisty Fawn
 +
a. [http://packages.ubuntu.com/feisty/misc/ndiswrapper-common]
 +
a. [http://packages.ubuntu.com/feisty/misc/ndiswrapper-utils-1.9]
 +
a. [http://packages.ubuntu.com/feisty/net/ndisgtk]
 +
** For 6.10 Edgy Eft
 
a. [http://packages.ubuntu.com/edgy/misc/ndiswrapper-common]
 
a. [http://packages.ubuntu.com/edgy/misc/ndiswrapper-common]
 
a. [http://packages.ubuntu.com/edgy/misc/ndiswrapper-utils-1.8]
 
a. [http://packages.ubuntu.com/edgy/misc/ndiswrapper-utils-1.8]
第51行: 第51行:
 
sudo dpkg -i --force-depends ndisgtk_*.deb
 
sudo dpkg -i --force-depends ndisgtk_*.deb
 
</nowiki></pre>
 
</nowiki></pre>
 +
 +
<!> Note: There is a known bug in the Debian package, detailed [http://forums.debian.net/viewtopic.php?p=100586&sid=f09bad1b17b5f4c62f1c4e68d044b8bf in this thread]. If you install from these packages, the kernel module may not get installed, so you may get the error ''FATAL: Module ndiswrapper not found'' when you run ''modprobe ndiswrapper''. To avoid this problem, it's best to compile from the source available at  [http://ndiswrapper.sourceforge.net/]. This is fairly simple but requires the build-essentials package to be installed. You can install this offline using ''apt-cdrom'' from the command line or the synaptic package manager with the ubuntu install CD.
  
 
<!> ''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.
 
<!> ''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.
第61行: 第63行:
 
a. [http://packages.ubuntu.com/breezy/misc/ndiswrapper-utils]
 
a. [http://packages.ubuntu.com/breezy/misc/ndiswrapper-utils]
 
a. [http://packages.ubuntu.com/breezy/net/ndisgtk]
 
a. [http://packages.ubuntu.com/breezy/net/ndisgtk]
 
  
 
Copy the appropriate files over to a directory on your Ubuntu computer (e.g. your Home directory) and install them in this order:
 
Copy the appropriate files over to a directory on your Ubuntu computer (e.g. your Home directory) and install them in this order:
第69行: 第70行:
 
</nowiki></pre>
 
</nowiki></pre>
  
<pre><nowiki>  
+
<pre><nowiki>
 
sudo dpkg -i ndisgtk_*.deb
 
sudo dpkg -i ndisgtk_*.deb
 
</nowiki></pre>
 
</nowiki></pre>
第75行: 第76行:
 
<!> ''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.
 
<!> ''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.
  
=== Without Internet access ===
+
=== 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.
+
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.
  
 
If you installed using the Dapper Alternate CD, those packages except ndisgtk are included on it.
 
If you installed using the Dapper Alternate CD, those packages except ndisgtk are included on it.
  
 
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].
 
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].
 +
 +
[[Anchor(configure)]]
 +
 +
== Configuration ==
  
 
=== Disable Free Drivers ===
 
=== Disable Free Drivers ===
Dapper comes with the open source bcm43xx driver. If this driver doesn't work for you, then you should disable it, because it will conflict with ndiswrapper. To disable it, add <code><nowiki>blacklist bcm43xx</nowiki></code> to the modprobe blacklist.
+
Firstly, Dapper comes with the open source bcm43xx driver, see [[UbuntuHelp:WifiDocs/Driver/bcm43xx]]. If this driver doesn't work for you, then you should disable it, because it will conflict with ndiswrapper. To disable it, add <code><nowiki>blacklist bcm43xx</nowiki></code> to the modprobe blacklist.
 
<pre><nowiki>
 
<pre><nowiki>
 
echo 'blacklist bcm43xx' | sudo tee -a /etc/modprobe.d/blacklist
 
echo 'blacklist bcm43xx' | sudo tee -a /etc/modprobe.d/blacklist
第91行: 第96行:
 
Note: This only effects what is loaded at startup, so you will have to reboot to have the bcm43xx driver disabled. If you have an atheros based card, remember to blacklist not only ath_pci, but also ath_hal, since ndiswrapper won't work if ath_hal is still loaded.
 
Note: This only effects what is loaded at startup, so you will have to reboot to have the bcm43xx driver disabled. If you have an atheros based card, remember to blacklist not only ath_pci, but also ath_hal, since ndiswrapper won't work if ath_hal is still loaded.
  
[[Anchor(install)]]
 
  
=== Set up and install drivers ===
+
=== Identifying Wireless Adapter ===
  
 
/!\ '''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.
 
/!\ '''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.  
+
You should download a tested Windows XP driver which is suitable for your card from the ndiswrapper list.
 
+
==== PCI Wireless Adapter ====
 
* Open a Terminal ('''Applications''' | '''Accessories''' | '''Terminal'''), type <code><nowiki>lspci</nowiki></code> and press the return/enter key.
 
* Open a Terminal ('''Applications''' | '''Accessories''' | '''Terminal'''), type <code><nowiki>lspci</nowiki></code> and press the return/enter key.
 
* Look through the output of the <code><nowiki>lspci</nowiki></code> command for an entry for your wireless card.
 
* Look through the output of the <code><nowiki>lspci</nowiki></code> 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''.
 
* Once you have identified your card, note down the contents of the first column, which should look like ''0000:00:0c.0''.
 
* Now, type <code><nowiki>lspci -n</nowiki></code> into the Terminal and press return.
 
* Now, type <code><nowiki>lspci -n</nowiki></code> 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''.
+
* 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''.
* 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.
+
==== USB Wireless Adapter ====
 +
* Open a Terminal ('''Applications''' | '''Accessories''' | '''Terminal'''), type <code><nowiki>lsusb</nowiki></code> and press the return/enter key.
 +
* Look through the output of the <code><nowiki>lsusb</nowiki></code> command for an entry for your wireless adapter.
 +
* 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 ===
 +
* Retrieve the Windows driver corresponding to your chipset: Use the ID information you have just found and the ndiswrapper [http://ndiswrapper.sourceforge.net/joomla/index.php?/component/option,com_openwiki/Itemid,33/id,list/ list] to find and download the correct windows driver files for your wireless adapter, or one which is very similar (same chipset ID).
 
* 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''.
 
* 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.
+
* If there are multiple INF/SYS files, look in the ndiswrapper [http://ndiswrapper.sourceforge.net/joomla/index.php?/component/option,com_openwiki/Itemid,33/id,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.
 
* Make sure that the INF file, SYS file and any BIN files are all put into one directory.
  
==== Graphical instructions ====
+
=== Installing Windows driver ===
 +
 
 +
==== 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 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].
  
==== Command line instructions ====
+
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.
  
===== Install the Windows driver =====
+
==== Installing Windows driver using command line ====
  
 
In a Terminal, run the following command:
 
In a Terminal, run the following command:
第127行: 第139行:
 
ndiswrapper then copies the <code><nowiki>.inf</nowiki></code> and <code><nowiki>sys</nowiki></code> files into <code><nowiki>/etc/ndiswrapper/...</nowiki></code>. Don't forget that the filename you type in is case-sensitive.
 
ndiswrapper then copies the <code><nowiki>.inf</nowiki></code> and <code><nowiki>sys</nowiki></code> files into <code><nowiki>/etc/ndiswrapper/...</nowiki></code>. Don't forget that the filename you type in is case-sensitive.
  
===== Checking to make sure the driver was installed correctly =====
+
===== Check to make sure the driver was installed correctly =====
  
 
Run the following command from a Terminal:
 
Run the following command from a Terminal:
第137行: 第149行:
 
<pre><nowiki>
 
<pre><nowiki>
 
Installed ndis drivers:
 
Installed ndis drivers:
{name of driver} driver present, hardware present
+
{name of driver} driver present, hardware present
 +
</nowiki></pre>
 +
or
 +
<pre><nowiki>
 +
{name of driver} : driver installed
 +
device ({Chipset ID}) present
 
</nowiki></pre>
 
</nowiki></pre>
  
第145行: 第162行:
 
a. Look for additional help. Read HowToGetHelp for more information.
 
a. Look for additional help. Read HowToGetHelp for more information.
  
===== Loading the new driver module =====
+
 
 +
=== 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:
 
Open a Terminal and run the following commands:
第158行: 第178行:
 
</nowiki></pre>
 
</nowiki></pre>
  
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 <code><nowiki>ifconfig</nowiki></code> and <code><nowiki>iwconfig</nowiki></code>. 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.  
+
Alternatively, open a Terminal and try the commands <code><nowiki>ifconfig</nowiki></code> and <code><nowiki>iwconfig</nowiki></code>. Your wireless card should 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 <code><nowiki>/etc/network/interfaces</nowiki></code>, where the Networking tool saves its settings.  Edit the file by hand if you discover settings with <code><nowiki>iwconfig</nowiki></code> beyond those on offer with the Networking tool.  Also, the ''order'' of the wireless settings can be very important.  If you discover that issuing <code><nowiki>iwconfig</nowiki></code> commands ''in a certain order'' on the command line is necessary, make sure the file asserts the settings in the same order.
+
If no errors are given, you should now be able to configure the network connection.
  
Test <code><nowiki>/etc/network/interfaces</nowiki></code> by activating and deactivating the wireless network interface from the Terminal, which shows some diagnostic messages:
+
=== Configuring Wireless Network Settings ===
 +
 
 +
==== Configuring Wireless Network Settings using nm-applet (GNOME front end for Network Manager) ====
 +
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.
 +
 
 +
*** Open the Networking Admin tool ('''System''' | '''Administration''' | '''Networking'''), select the Wireless connection and click '''Properties''', ensure the '''Enable roaming mode''' checkbox is ticked.
 +
*** 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.
 +
*** If the Network requires any further configuration (eg WEP key), a dialog should appear, select the correct settings and paste in your key.
 +
*** 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].
 +
*** Your Wireless Network should now be configured - skip to [[autostart Automatically loading at Startup]]
 +
 
 +
 
 +
/!\ Using this method of configuration with the TNET1450 driver, the wireless network kept dropping packets and the wireless connection stopped responding after a few minutes - if you encounter similar problems use the network-admin method below.
 +
 
 +
/!\ nm-applet does not use the standard Network Admin file <code><nowiki>/etc/network/interfaces</nowiki></code> 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 (Network Admin) ====
 +
This is an alternative, more native method to using the GNOME nm-applet.
 +
*** Open the Networking Admin tool ('''System''' | '''Administration''' | '''Networking'''), select the Wireless connection and click '''Properties''', ensure the '''Enable roaming mode''' checkbox is unticked.
 +
*** In the Network Name box, select / type the ESSID of your network
 +
*** In the Password type box, select whether your network password is Hex (eg. 208AB43..) or Ascii (eg. secret)
 +
*** In the Password box, Type / paste your network password
 +
*** In the Connection Configuration, select the Network configuration type - this is normally DHCP.
 +
*** If your network is configured using Static IP addresses, fill in the IP address of the computer, Subnet mask and Gateway IP address.
 +
*** Click '''OK''' to apply these settings - they will be stored to file <code><nowiki>/etc/network/interfaces</nowiki></code>
 +
*** 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.
 +
*** Your Wireless Network should now be configured - skip to [[autostart Automatically loading at Startup]]
 +
 
 +
Note: During startup, the system will activate the Network Admin settings kept in the file <code><nowiki>/etc/network/interfaces</nowiki></code>, 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:
  
 
<pre><nowiki>
 
<pre><nowiki>
第168行: 第220行:
 
sudo ifup wlan0
 
sudo ifup wlan0
 
</nowiki></pre>
 
</nowiki></pre>
 +
 +
You may diagnose the network adapter status with commands:
 +
<pre><nowiki>
 +
ifconfig
 +
iwconfig
 +
 +
dmesg
 +
tail /etc/var/messages
 +
</nowiki></pre>
 +
 +
==== Configuring Wireless Network Settings using command line ====
 +
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.
 +
 +
Test ''/etc/network/interfaces'' by activating and deactivating the wireless network interface from the Terminal, which shows some diagnostic messages:
 +
 +
<pre><nowiki>
 +
sudo ifdown wlan0
 +
sudo ifup wlan0
 +
</nowiki></pre>
 +
 +
You may diagnose the network adapter status with commands:
 +
<pre><nowiki>
 +
ifconfig
 +
iwconfig
 +
 +
dmesg
 +
tail /etc/var/messages
 +
</nowiki></pre>
 +
 +
Note: During startup, the system will activate the Network Admin settings kept in the file ''/etc/network/interfaces'', where the Networking tool saves its settings.
  
 
''For information on getting WPA to work, read the WPAHowto.''
 
''For information on getting WPA to work, read the WPAHowto.''
  
==== Automatically loading at start-up ====
+
[[Anchor(autostart)]]
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 <code><nowiki>/etc/modules</nowiki></code> file:
+
=== 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
  
 +
Configure ndiswrapper for use with the Network Admin settings - this adds an Alias to associate wlan0 to ndiswrapper in modprobe.d
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo ndiswrapper -m
 
sudo ndiswrapper -m
 
</nowiki></pre>
 
</nowiki></pre>
  
or you can add it manually by opening the file with this command:
+
==== 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.
 +
Ensure the ndiswrapper module is loaded at system startup:
 +
Edit <code><nowiki>/etc/modules</nowiki></code> file to add an entry for ndiswrapper at the end of the file
  
 
In Ubuntu,
 
In Ubuntu,
第193行: 第283行:
  
 
and add the word <code><nowiki>ndiswrapper</nowiki></code> to the end of this file and save it.
 
and add the word <code><nowiki>ndiswrapper</nowiki></code> to the end of this file and save it.
 +
 +
/!\ nm-applet requires entry in <code><nowiki>/etc/modules</nowiki></code> 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 <code><nowiki>/etc/modprobe.d/ndiswrapper</nowiki></code> and having the entry in <code><nowiki>etc/modules</nowiki></code> may cause the wireless network driver to not start properly
  
 
/!\ It is strongly recommended that you make a backup copy of the <code><nowiki>/etc/modules</nowiki></code> file before manually editing it.
 
/!\ It is strongly recommended that you make a backup copy of the <code><nowiki>/etc/modules</nowiki></code> file before manually editing it.
第229行: 第321行:
  
 
<pre><nowiki>
 
<pre><nowiki>
sudo modprobe -r ndiswrapper  
+
sudo modprobe -r ndiswrapper
sudo apt-get --purge remove ndiswrapper-utils  
+
sudo apt-get --purge remove ndiswrapper-utils
sudo rm -r /etc/ndiswrapper/  
+
sudo rm -r /etc/ndiswrapper/
 
sudo rm -r /etc/modprobe.d/ndiswrapper
 
sudo rm -r /etc/modprobe.d/ndiswrapper
 
sudo rm /lib/modules/$(uname -r)/kernel/drivers/net/ndiswrapper/ndiswrapper.ko
 
sudo rm /lib/modules/$(uname -r)/kernel/drivers/net/ndiswrapper/ndiswrapper.ko
第258行: 第350行:
  
 
<pre><nowiki>
 
<pre><nowiki>
tar xvfz ndiswrapper-[current version].tar.gz  
+
tar xvfz ndiswrapper-[current version].tar.gz
 
cd ndiswrapper-[current version]
 
cd ndiswrapper-[current version]
 
</nowiki></pre>
 
</nowiki></pre>
第275行: 第367行:
 
It is advised that your run in fakeroot for the following:
 
It is advised that your run in fakeroot for the following:
 
<pre><nowiki>
 
<pre><nowiki>
fakeroot  
+
fakeroot
 
sudo make install
 
sudo make install
 
</nowiki></pre>
 
</nowiki></pre>
第283行: 第375行:
 
=== Build deb packages and install (works only for older versions of ndiswrapper) ===
 
=== Build deb packages and install (works only for older versions of ndiswrapper) ===
  
<!> Please note: This is technically outdated material. However, in certain circumstances it may be required that you 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.  
+
<!> Please note: This is technically outdated material. However, in certain circumstances it may be required that you 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:
 
Run the following from the Terminal:
 
<pre><nowiki>
 
<pre><nowiki>
fakeroot debian/rules binary-modules  
+
fakeroot debian/rules binary-modules
fakeroot debian/rules binary-utils  
+
fakeroot debian/rules binary-utils
 
cd ..
 
cd ..
 
sudo dpkg -i ndiswrapper-modules-[your kernel]_[current version]-1_i386.deb ndiswrapper-utils_[current version]-1_i386.deb
 
sudo dpkg -i ndiswrapper-modules-[your kernel]_[current version]-1_i386.deb ndiswrapper-utils_[current version]-1_i386.deb
 
</nowiki></pre>
 
</nowiki></pre>
  
Now go back to the [[install install]] section of this document to set up and use your newly installed ndiswrapper package.
+
Now go back to the [[configure Configuration]] section of this document to set up and use your newly installed ndiswrapper package.
  
 
== Useful Links ==
 
== Useful Links ==
  
[http://ndiswrapper.sourceforge.net/mediawiki/index.php/Main_Page The ndiswrapper Wiki]
+
* [http://ndiswrapper.sourceforge.net/mediawiki/index.php/Main_Page The ndiswrapper Wiki]
 +
 
 +
* [http://ubuntuforums.org/showthread.php?t=197102 Automated Ndiswrapper installation]: an alternative method to install Ndiswrapper and set it up with Network Manager
  
HowtoUseNdiswrapperOnAmd64Ubuntu
+
* [[UbuntuHelp:WifiDocs/NdiswrapperOnAMD64|NdiswrapperOnAMD64]]
  
WifiDocs
+
* WifiDocs
  
 
----
 
----

2007年11月21日 (三) 17:28的版本



Introduction

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

<!> These instructions apply only when using the x86 Alternate CD. If you are running Ubuntu for AMD64, please see NdiswrapperOnAMD64 for instructions. These instructions do not apply to Ubuntu for Power PC (PPC) and the Ubuntu Desktop CDs.


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

Installation

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.

NOTE: in Edgy, you must install the ndiswrapper-utils-1.8 package instead of just ndiswrapper-utils. and then proceed with installation using the command ndiswrapper-1.8 instead of ndiswrapper. See https://launchpad.net/distros/ubuntu/+source/ndiswrapper/+bug/59983 for bug report. and https://help.ubuntu.com/community/WifiDocs/Driver/Ndiswrapper/edgy for help installing. Note: for Ubuntu 6.06 (Dapper), ndiswrapper-utils is included on the standard installation CD. You can install the package from the CD and skip to section 2.2...

Installing Packages (With Internet access on the Ubuntu computer)

If you already have Internet access via some other method while logged into Ubuntu:

1. Ensure the multiverse and universe repositories are enabled; see AddingRepositoriesHowto

2. Install the ndisgtk package from the Ubuntu repositories. If you don't know how to install applications then you can read this guide.

Anchor(install)

Installing Packages (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. (See note about bug below)

Feisty Fawn (7.04) and Edgy Eft (6.10)

    • For 7.04 Feisty Fawn

a. [1] a. [2] a. [3]

    • For 6.10 Edgy Eft

a. [4] a. [5] a. [6]

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 --force-depends ndisgtk_*.deb

<!> Note: There is a known bug in the Debian package, detailed in this thread. If you install from these packages, the kernel module may not get installed, so you may get the error FATAL: Module ndiswrapper not found when you run modprobe ndiswrapper. To avoid this problem, it's best to compile from the source available at [7]. This is fairly simple but requires the build-essentials package to be installed. You can install this offline using apt-cdrom from the command line or the synaptic package manager with the ubuntu install CD.

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

Older Releases

    • For 6.06 Dapper Drake

a. [8] a. [9]

    • For 5.10 Breezy Badger

a. [10] a. [11]

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

If you installed using the Dapper Alternate CD, those packages except ndisgtk are included on it.

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.

Anchor(configure)

Configuration

Disable Free Drivers

Firstly, Dapper comes with the open source bcm43xx driver, see UbuntuHelp:WifiDocs/Driver/bcm43xx. If this driver doesn't work for you, then you should disable it, because it will conflict with ndiswrapper. To disable it, add blacklist bcm43xx to the modprobe blacklist.

echo 'blacklist bcm43xx' | sudo tee -a /etc/modprobe.d/blacklist

(Or just edit the /etc/modprobe.d/blacklist file and add blacklist bcm43xx 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 driver disabled. If you have an atheros based card, remember to blacklist not only ath_pci, but also ath_hal, since ndiswrapper won't work if ath_hal is still loaded.


Identifying Wireless Adapter

/!\ 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.

PCI Wireless Adapter

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

USB Wireless Adapter

  • Open a Terminal (Applications | Accessories | Terminal), type lsusb and press the return/enter key.
  • Look through the output of the lsusb command for an entry for your wireless adapter.
  • 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

  • Retrieve the Windows driver corresponding to your chipset: Use the ID information you have just found and the ndiswrapper list to find and download the correct windows driver files for your wireless adapter, or one which is very similar (same chipset ID).
  • 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 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.

Installing Windows driver

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 autostart Automatically loading at Startup - ndisgtk will load the driver if it installs correctly.

Installing Windows driver using command line

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.

Check 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

or

{name of driver} : driver installed
device ({Chipset ID}) present

If you don't see this message: a. Try a different driver such as the drivers for Windows 2000, or another driver matching the PCI ID on the 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.


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 ifconfig and 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)

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.

      • Open the Networking Admin tool (System | Administration | Networking), select the Wireless connection and click Properties, ensure the Enable roaming mode checkbox is ticked.
      • 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.
      • If the Network requires any further configuration (eg WEP key), a dialog should appear, select the correct settings and paste in your key.
      • 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.
      • Your Wireless Network should now be configured - skip to autostart Automatically loading at Startup


/!\ Using this method of configuration with the TNET1450 driver, the wireless network kept dropping packets and the wireless connection stopped responding after a few minutes - if you encounter similar problems use the network-admin method below.

/!\ nm-applet does not use the standard Network Admin 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 (Network Admin)

This is an alternative, more native method to using the GNOME nm-applet.

      • Open the Networking Admin tool (System | Administration | Networking), select the Wireless connection and click Properties, ensure the Enable roaming mode checkbox is unticked.
      • In the Network Name box, select / type the ESSID of your network
      • In the Password type box, select whether your network password is Hex (eg. 208AB43..) or Ascii (eg. secret)
      • In the Password box, Type / paste your network password
      • In the Connection Configuration, select the Network configuration type - this is normally DHCP.
      • If your network is configured using Static IP addresses, fill in the IP address of the computer, Subnet mask and Gateway IP address.
      • Click OK to apply these settings - they will be stored to file /etc/network/interfaces
      • 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.
      • Your Wireless Network should now be configured - skip to autostart Automatically loading at Startup

Note: During startup, the system will activate the Network Admin 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:

ifconfig
iwconfig

dmesg
tail /etc/var/messages

Configuring Wireless Network Settings using command line

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.

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:

ifconfig
iwconfig

dmesg
tail /etc/var/messages

Note: During startup, the system will activate the Network Admin settings kept in the file /etc/network/interfaces, where the Networking tool saves its settings.

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

Anchor(autostart)

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

Configure ndiswrapper for use with the Network Admin settings - this adds 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. Ensure the ndiswrapper module is loaded at system startup: Edit /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

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

Anchor(trouble)

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

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 WifiDocs/WirelessTroubleShootingGuide and view the step on device drivers and ndiswrapper.


Compiling the latest version of ndiswrapper

This section is based on an ndiswrapper wiki page, and was copied from the Ubuntu Forums. The original post can be found 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

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

Install Ndiswrapper

The most current version of ndiswrapper (since at least version 1.19) can no longer be compiled into a .deb package. There is a way around this, however. Just 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)

<!> Please note: This is technically outdated material. However, in certain circumstances it may be required that you 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.

Useful Links

  • WifiDocs