LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-13-2005, 12:55 PM   #1
MikeZila
Member
 
Registered: Jul 2004
Location: Parts Unknown
Distribution: Arch
Posts: 377

Rep: Reputation: 30
Guide to ndiswrapper and Sarge with no compiling


Before we get started...

This is a guide on how to get ndiswrapper working on the newest Debian Sarge without having to compile anything at all. I've done it on two different machines so far, and it worked fine on both. This isn't ment to be a slacker's easy way out, but it works just as well as a genuine compile, and takes about 1/4 the time or effort.

Originally, I was trying to get the ndiswrapper source to compile with the stock Debian Sarge kernel. This didn't work because the kernel headers were absent. Even after installing them, compile failed with obscure errors. Getting the source didn't help either. Still no dice. I read around places and found that the kernel that comes with Debian Sarge has problems with ndiswrapper under certain situations. I made the safe assumption that I somehow had one of these "situations", and set out to get a new kernel.

You need a new kernel, but not to fear. The almighty apt-get has you covered from start to finish.

From this point on are instructions on how to get a new kernel and then get ndiswrapper playing ball with it. If you're unwilling to update your kernel, you can stop reading now. Please note that this kernel upgrade is very easy. There is no compile process and the whole deal takes about fifteen minutes; it isn't the usual kernel compile rigmarole. Also, it's totally safe to do the following. When the new kernel is installed, it makes an additional entry in your boot loader, it doesn't replace your current one. You're not stuck if it doesn't work.

Do you want 386 or 686?

Before we start, you should know that this guide assumes you're using a 686 CPU. Something like a P4, a P4 based Celeron, Pentium3, a PentiumPro, or similar. AMD Athalon people should be okay as well. Those with 64bit processors can try, but I have no idea if it will work. If your using a 586 or older, just replace every 686 in this guide with a 386. Everything will still work the same.

Let's get it started.

Ready? Let's do it.

Time for a new kernel
First, you need to grab a new kernel. One is compiled and waiting for you in the apt repository. Do...
Code:
apt-get install kernel-image-2.6.8-2-686
It will download the deb containing the kernel and work it's magic. Before you know it a new kernel will be all setup and your boot loader will be configured with a new entry to boot it. Cool, huh? Your previous kernel and boot loader entry are preserved so you can boot it anytime you like.

Reboot and choose your new kernel at the bootmenu.

We need wireless-tool and ndiswrapper binaires

First we'll grab the wireless-tools package. This will let us setup our card once it's working. You guessed it, apt-get has us covered.

Code:
apt-get install wireless-tools
The wireless tools will be downloaded and installed. You can check that they are by typing "iwconfig" and seeing if it gives you any output. It won't tell us anything good now, but it'll come in very handy later. Now we need to grab the ndiswrapper itself. Do...

Code:
apt-get install ndiswrapper-modules-2.6.8-2-686
If it suggests you install additional packages (it should suggest ndiswrapper-utils), type "Y" and hit enter to agree. It will download and install the packages. When it's done, try...

Code:
ndiswrapper -l
You should get a notice saying that no drivers are installed. This is normal, as we haven't yet given it the WindowsXP drivers to wrap. If you get a command not found error, then the ndiswrapper-utils package either wasn't suggested during the ndiswrapper-module install, or it failed for some reason. If it wasn't suggested (it was suggested to me), you can just get it yourself with...

Code:
apt-get install ndiswrapper-utils
Now try the "ndiswrapper -l" again. You should get the no drivers notice.

Now it's time to fix that no drivers notice. Get ahold of the WindowsXP drivers for your card. Don't use drivers included on the CD that came with your card, they won't work 99% of the time, and sometimes they cause kernel panics or other nasty things. Best to play it safe and grab the drivers known to work with your card. Go to the official ndiswrapper card list located here. Once you've got them, extract the driver files someplace (it doesn't matter where) and do the following in that directory.

Hook ndiswrapper up with your drivers

You'll need to run a...

Code:
ndiswrapper -i DRIVER.inf
..for a each .inf file required by your card. Usually you only need one. Your card's entry in the ndiswrapper card listing will tell you if you need more than one. I happen to need three. Once you have all the .inf files you need installed, you should do a...

Code:
ndiswrapper -l
...and check the output to make sure you see something like:

Code:
Installed ndis drivers:
lsbcmnds        driver present
lsipnds driver present, hardware present
wmp11nds        driver present
Your drivers will be have different names, and you may have more or less drivers installed. The important thing is that one of them says "hardware present". If you see a "hardware not present" you probably have bad drivers. If you see "cant see hardware", then you don't have wireless-tools. You should have downloaded them earlier in this guide, but if for some reason you didn't, just...

Code:
apt-get install wireless-tools
...and try "ndiswrapper -l" again. If all is well, move on.

Load up the module...sorta

It's time to load the module. Well, sorta. Remember installing the ndiswrapper-module package? It didn't actually install a module, but it did give us an ndiswrapper.ko, and that will work just as well.

You'll do this the old-school way...

Code:
insmod lib/modules/`uname -r`/misc/ndiswrapper.ko
The " ` " marks around "uname -r" aren't the " ' " next to your enter key, they're next to the " 1 " key, at the top left.

Doing this command probably won't give you any output, but it will give you the functionality of the ndiswrapper module. Now try...

Code:
iwconfig
You should now have an entry called "wlan0", and a bunch of information about it. If you see something like this...

Code:
wlan0     IEEE 802.11b  ESSID:off/any
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:40:05:C5:4E:03
          Bit Rate:11 Mb/s   Tx-Power:17 dBm
          RTS thr:2347 B   Fragment thr:2346 B
          Encryption key:off
          Power Management:off
          Link Quality:100/100  Signal level:-69 dBm  Noise level:-256 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:54  Invalid misc:512   Missed beacon:0
...then you're good to go. You may have additional entires without wireless extensions in the output, but this is normal.

Congratulations! Your card is up and running in Linux! Now to get it configured so you can be on your way. It's is simple enough.

Let's tame this beast

At this point I recommend you turn off the ethernet connection. It can cause problems with the wlan0 interface if it's running when you try to configure the wireless card. Do...

Code:
ifdown eth0
If you've been using an ethernet connection to download the packages we've been installing, it will be lost. If for any reason you want it back, just...

Code:
ifup eth0
dhclient eth0
...and you'll be back to normal.

We'll get your new wireless running post haste. First we should make sure your AP (your wireless router or access point) is configured to have open access. Turn off WEP/WAP in your router or AP's configuration for the time being. Now let's set your SSID on the wireless card. It's simple. Do...

Code:
iwconfig wlan0 essid yourssidgoeshere
That will set the ssid. You won't get any feedback, but this is normal. Now run "iwconfig" again and check the ESSID in the top right of the block of information about your wireless card. It should no longer say "off/any", but the SSID you configured it to use. If it doesn't, try the command a few more times. Move your computer a little, do whatever you would normally do to get better signal. If "off/any" changed to your ssid, then you're good to go.

You don't have to bring up the wlan0 interface, but you do need to get an IP. Do...

Code:
dhclient wlan0
A bunch of stuff will go by, and at the end you'll either have errors, a long wait, or an IP on your network. If you get errors, then obviously something is wrong. Check the error and yoursystem logs and hunt down the wrench in the works. If you get a long wait, your card is probably not talking to the router like it should, look in your logs and see if you can find out what's holding things up, it could just be that you aren't getting good signal. If you get no errors, and things finish in a reasonable time, you should be done. Open up a web browser and see if you can get to Google. If it works, then you're cooking with lasers, and everything is kosher. Congratulations!

Making it easy to start

If you want to make bringing up your wireless easy (this guide doesn't configure the ndiswrapper in a way that can be auto-loaded via normal means) dump the following in a text file and name it "loadwireless.sh". (really you can name it anything you want, just keep the .sh at the end) Make sure to put your ssid in place of "yourssidgoeshere"

Code:
#!/bin/sh
ifdown eth0
insmod /lib/modules/`uname -r`/misc/ndiswrapper.ko
sleep 2
iwconfig wlan0 essid yourssidgoeshere
chmod it executable and run it as root to bring your wireless up. After you run the script, you should run "iwconfig" manually a few times to check and see if your SSID is being used. If after several entries of "iwconfig" you still don't get your SSID set, try entering the config command from the script againg manually. Your card may not have started up in time to catch the command in the script. Just enter...

Code:
iwconfig wlan0 essid yourssidgoeshere
Moving your computer a bit (a few inches, not to the other side of the room) helps it get signal with your router, and will make your SSID appear in the "iwconfig" output. After you've got your SSID in, remember to run "dhclient wlan0" or you won't get an IP, and won't have internet.

I'm sure there's a way to get this to be run automatically, but I'm done with my major accomplishments for the day. I'm cool just running this as root once the system is up and running. You don't have to be exclusively logged in as root for it to work, a root console in a normal user session will do fine.

All done!

That's all, folks. Post problems if you have them and I'll try to help you out. I'll do my very best, but keep in mind that I'm not a genius at this, I just happened to discover a correct way via experimentation and research. Like I said, ask and I'll try to help. I'm a nice guy, so don't be afraid to ask, no matter how small or large the question.

Thanks for reading my guide!

Last edited by MikeZila; 06-14-2005 at 10:59 AM.
 
Old 06-14-2005, 11:02 AM   #2
MikeZila
Member
 
Registered: Jul 2004
Location: Parts Unknown
Distribution: Arch
Posts: 377

Original Poster
Rep: Reputation: 30
Guide fixes:
Fixed some spelling and format problems.
Reworded several things to make them easier to follow.
Fixed a problem in the script at the end that would give you "file not found" errors if you weren't at the root of your disk.
Fixed instructions at the end about dhclient.
Added headings to make the guide easier to come back to if you close the window or lose your place.
 
Old 06-16-2005, 08:59 AM   #3
Darkstar
Member
 
Registered: Jan 2002
Location: Elkton, MD
Distribution: Debian 3.1, SimplyMEPIS 3.3.1, Kanotix 2005-03
Posts: 91

Rep: Reputation: 15
Thanks a bunch for this! This is exactly what I have been looking for. Great job!!!
 
Old 06-16-2005, 09:40 AM   #4
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Rep: Reputation: 48
good, I was wondering if there's a way to not have to compile from source. I'll remember this. Thanks!
 
Old 06-16-2005, 02:02 PM   #5
MikeZila
Member
 
Registered: Jul 2004
Location: Parts Unknown
Distribution: Arch
Posts: 377

Original Poster
Rep: Reputation: 30
So, did it work for you guys?
 
Old 06-17-2005, 04:28 PM   #6
Darkstar
Member
 
Registered: Jan 2002
Location: Elkton, MD
Distribution: Debian 3.1, SimplyMEPIS 3.3.1, Kanotix 2005-03
Posts: 91

Rep: Reputation: 15
Worked great for me! I don't think I had any problems at all.

Thanks!
 
Old 06-17-2005, 06:58 PM   #7
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Rep: Reputation: 48
Thanks alot. I tried it today, and it worked wonderfully. I assume a custom kernel would require compiling the source itself?
 
Old 06-17-2005, 09:51 PM   #8
MikeZila
Member
 
Registered: Jul 2004
Location: Parts Unknown
Distribution: Arch
Posts: 377

Original Poster
Rep: Reputation: 30
Yes. If you wanted to compile a kernel with custom options you would have to have the source, configure it, and then compile. Debian doesn't come with kernel source or headers installed, so normally you would have to compile to make ndiswrapper work. This guide showed you how to avoid the whole rigamarole and just get ndiswrapper working.
 
Old 06-18-2005, 04:46 AM   #9
Fernandoch
Member
 
Registered: Mar 2002
Location: Spain
Distribution: Debian, Cent OS, RHEL
Posts: 119

Rep: Reputation: 15
It works

Hi,

I have ndiswrapper and my acer aspire 1363 working perfectly.

MikeZila: you should add a "/" in the command:

insmod lib/modules/`uname -r`/misc/ndiswrapper.ko

It should be: insmod /lib/modules/`uname -r`/misc/ndiswrapper.ko

And that should also be fixed in the site of ndiswrapper.

Regards,

Fernando

Last edited by Fernandoch; 06-18-2005 at 08:55 AM.
 
Old 06-18-2005, 06:17 AM   #10
Tons of Fun
Member
 
Registered: Dec 2004
Location: Orlando, Florida
Distribution: Debian Wheezy / BackTrack 5/ Linux Mint 17
Posts: 379

Rep: Reputation: 37
I am sorry to say that I still do not have my wifi card working. I have tried to get ndiswrapper installed by compiling sources and headers before without success. I followed your guide, and ndiswrapper installed flawlessly . But when I run ndiswrapper -l, it lists the drivers, but I get an "invalid driver!" error. I am using a netgear WG311T PCI card. This card was working with the 30 day trial linuxant drivers on an earlier install, but I really do not want to pay for drivers. I really want to keep this machine non-commercial and 100% open source.
If anyone has any suggestions, I would greatly appreciate it.

Thanks!

 
Old 06-18-2005, 09:07 AM   #11
Fernandoch
Member
 
Registered: Mar 2002
Location: Spain
Distribution: Debian, Cent OS, RHEL
Posts: 119

Rep: Reputation: 15
get the right driver

Hi Tons of Fun,

Check this web:

http://ndiswrapper.sourceforge.net/p...index.php/List

and see if your card is supported.

First of all you have to get a good driver.

Check that page too: http://ndiswrapper.sourceforge.net/p...p/Installation
the part of -- > Install your Windows driver

And this page: http://ndiswrapper.sourceforge.net/p.../index.php/FAQ
the part of --> How do I unpack a Windows driver file in .EXE format?

Good luck,

Fernando.
 
Old 06-18-2005, 09:17 AM   #12
Tons of Fun
Member
 
Registered: Dec 2004
Location: Orlando, Florida
Distribution: Debian Wheezy / BackTrack 5/ Linux Mint 17
Posts: 379

Rep: Reputation: 37
Thanks Fernandoch. I am hitting the links now.
 
Old 06-18-2005, 11:09 AM   #13
MikeZila
Member
 
Registered: Jul 2004
Location: Parts Unknown
Distribution: Arch
Posts: 377

Original Poster
Rep: Reputation: 30
Yes, it's very important to use the drivers they list on their card compatibility page, and not ones from a CD or directly from a Windows installation.
 
Old 06-18-2005, 04:20 PM   #14
Tons of Fun
Member
 
Registered: Dec 2004
Location: Orlando, Florida
Distribution: Debian Wheezy / BackTrack 5/ Linux Mint 17
Posts: 379

Rep: Reputation: 37
The card compatibility page doesn't list any drivers for my card, although the card is listed. I tried using the drivers that came on the CD.
 
Old 06-18-2005, 04:54 PM   #15
leinad
LQ Newbie
 
Registered: Dec 2003
Posts: 26

Rep: Reputation: 15
I am very close to getting my wireless card to work, but I have run into a problem. When i get to the step that is supposed to load the module with
Code:
insmod /lib/modules/`uname -r`/misc/ndiswrapper.ko
I get this error:
Code:
insmod: can't read '/lib/modules/2.6.8-2-686/misc/ndiswrapper.ko': No such file or directory
The misc/ director exists inside of that path. I don't know where ndiswrapper.ko is coming from or if it exists, but I have followed the directions word for word so far.

Anyone have any ideas for me?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie Guide To Compiling A Kernel! DrOzz Linux - General 318 08-20-2008 05:21 AM
DISCUSSION: Guide to NdisWrapper for MN-720 MN-730 Microsoft Wireless Cards in Groovelab LinuxAnswers Discussion 4 10-27-2005 08:56 AM
Guide to Display Chinese in Debain Sarge NanoFxJ Debian 3 04-05-2005 05:21 PM
GUIDE: Installing Linksys WMP54G with NDISWRAPPER-11 barton Slackware 1 11-29-2004 01:40 PM
Compiling Kde Guide? tiger7007 Linux - General 1 05-20-2004 07:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 07:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration