Here's a quick recipe that works for Debian old stable (Squeeze) and newer, based on DKMS. Open a root terminal and give the command
Code: Select all
# aptitude install ndiswrapper-dkms
Next, locate the Windows XP driver for your device (it has an .inf extension), and (still in the same root terminal session) use the commands
Code: Select all
# ndiswrapper -i /full/path/to/WinXP/Driver/driver.inf
# ndiswrapper -m
# modprobe ndiswrapper
Read on if the above doesn't work, or if you're interested in the long story...
First off, let's admit that all is not well with Ndiswrapper. Closed-source drivers ("binary blobs") in Linux are under fire, and so is the Ndiswrapper programme that uses them. Some newer wireless adapters use the 802.11n (draft) protocol and/or the 5GHz band; these either don't yet work in Ndiswrapper or have only unsuitable drivers for Windows Vista, Windows 7 or (heaven forbid) Windows 8. There have also been problems getting WPA/WPA2 personal security to work with Ndiswrapper.
Fortunately, Ndiswrapper is needed less and less, as new and improved open source drivers become available for devices with popular chipsets like Atheros (ath5k, ath9k), Ralink (rt2x00, 2810) and Broadcom (wl for recent 43xx devices). This alone is worth an upgrade to a recent kernel, e.g. from backports. Alternatively, a wireless bridge or game adapter (they're the same thing) may be a cost-effective way to connect a (desktop) computer to a wireless network via the Ethernet port, without having to worry about Linux-compatible wireless modules.
But if you must install Ndiswrapper, consult Documents/Wiki on http://ndiswrapper.sourceforge.net/joomla/ for a list of supported devices. Even if your wireless device is not listed there, it may still have a chipset that is supported; you'll only know for sure by trying...
All commands to follow must be given in a terminal with root privileges; the order of the commands is crucial, so don't skip a step!
- 1. First, install/compile the Ndiswrapper kernel module.
Starting with Debian old stable (Squeeze), DKMS can do the work for youwhich will pull in all needed sources and dependencies in the process.Code: Select all
# aptitude install ndiswrapper-dkms
Alternatively, if you're still using old-old-stable (Lenny) or when you don't want to use the DKMS scripts, you must install/compile by handEither way, you should now have the ndiswrapper.ko kernel module available in the /lib/modules/... tree for your current kernel. DKMS automatically reacts when installing a new kernel version; the manual procedure must be redone in that case.Code: Select all
# aptitude install module-assistant ndiswrapper-source ndiswrapper-utils # m-a prepare # m-a a-i ndiswrapper
- 2. Mount the CD that came with your device, or log in at the manufacturer's website, and preferably find the Windows XP driver for it (Windows Vista, Windows 7 or 8 drivers may not work).
Important: if you're running a 64-bit system ("AMD64" kernel) then you'll need a 64-bit Windows driver; a 32-bit version of the driver will not work in a 64-bit OS (even though it appears to install OK in Ndiswrapper).
The driver will be called something like <name>.inf; there may also be a companion .sys file in the same or the parent directory. If you're getting the driver from somewhere else, make sure to also get that companion file (when present) and put it in a directory that retains the relationship with the directory the .inf file is in (e.g. its parent directory, when appropriate). Write down the full path to the driver, like /media/cdrom/Driver/WINXP/<name>.inf.
- 3. Install the driver (still as root) into Ndiswrapper withof course substituting the path in your own setup. That last command may also show an alternative driver, like ssb or b43. This poses a bit of a problem that we deal with in item 5. Assuming that you don't have this problem, continue with the next item.
Code: Select all
# ndiswrapper -i /media/cdrom/Driver/WINXP/<name>.inf # ndiswrapper -m # ndiswrapper -l
- 4. Insert the module (still as root) withThere should be no error messages from the modprobe command. If necessary, add ndiswrapper to /etc/modules for automatic insertion at boot. Next insert the wireless device, if you haven't already, and watch what happens with one or more of the commands
Code: Select all
# modprobe ndiswrapper
These commands should show the presence of the new wireless interface, like wlan0 (or ra0, etc), although not yet configured... but that's another story.Code: Select all
# iwconfig # iwlist scan # ifconfig
- 5. But what if that new wireless interface of the previous step doesn't show? This could happen when the ndiswrapper module isn't loaded early enough in the boot sequence, allowing another kernel module like ssb or b43 to take over. What to do?
Well, it could be that one of those additional modules is in fact a driver for your wireless device! This could be true for b43, in which case you wouldn't need ndiswrapper... but often the b43 driver doesn't work, so you do need ndiswrapper. If there is no other device using that module, then blacklisting it in /etc/modprobe.d/blacklist(.conf) could be tried: just add the module name, like ssb to the blacklist file with an editor. Note that blacklisting only takes effect after the command (as root)If blacklisting is no option (only experience will tell) then putting ndiswrapper in /etc/modules may cause it to load earlier, but it may also be necessary to force that alternative driver (and drivers dependent on it) to load after the ndiswrapper driver. Using ssb as an example, make a little script /usr/local/bin/wirelessCode: Select all
# update-initramfs -u
and make this script executable (as root) with the commandCode: Select all
#!/bin/sh rmmod ssb ndiswrapper modprobe ndiswrapper modprobe ssb
then call for it to be executed in /etc/rc.local or (if that's too late in the boot sequence) in a file like /etc/init.d/bootmisc.sh. In both cases, just add a line likeCode: Select all
# chmod a+x /usr/local/bin/wireless
to that file. You may have to experiment a bit until it works; for an example see the 11 May 2008 post by hellfire[bg] in this thread.Code: Select all
/usr/local/bin/wireless
For those of you living on the bleeding edge of experimental kernels, have a look at this August 2012 post, http://forums.debian.net/viewtopic.php? ... 60#p449757, by mushroomboy for another way of getting rid of that pesky ssb module.
Have fun!
This HOWTO has benefited from numerous suggestions by Debian users, especially the comments by mzilikazi are appreciated. Thx