LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Linux Answers > Networking
User Name
Password

Notices

By MikeZila at 2005-06-13 20:40
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.

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

Ready? Let's do it.

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.

Now 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 a hold 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. 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.

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.

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 your system 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!

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
sleep 2
iwconfig
chmod it executable and run it as root to bring your wireless up. If after several entries of "iwconfig" you still don't get your SSID set, try entering the config command again manually. Your card may not have started up in time to catch the command in the script. Just enter...

Code:
iwconfig wlan0 essid yourssidgoeshere
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.

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!

by martinj on Thu, 2005-06-16 11:58
This crashes my PC. I am running IPW2100

I do apt-get install ndiswrapper-modules-2.6.8-2-386

apt-get install ndiswrapper-utils
ndiswrapper -i w70n51.inf
ndiswrapper -l and it says the hardware is found
I do
apt-get install wireless-tools
ok
I do cd // and
insmod lib/modules/`uname -r`/misc/ndiswrapper.ko
and then it crashes

by MikeZila on Thu, 2005-06-16 13:57
This means that your drivers are probably bad.

Try removing the driver you installed by...

Code:
ndiswrapper -e drivername (no .inf at the end)
And then try loading the .ko again. If it loads without any crashes, then you have bad drivers.

by martinj on Fri, 2005-06-17 12:58
Thanks for the reply. I insted used ipw2100-source. Thanks though for the guide.

by Rutnut on Tue, 2005-06-21 03:13
Good tutorial but when I get to the point of typing in:

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

it gives me the reply

insmod: can't read 'lib/modules/2.6.10-5-386/misc/ndiswrapper.ko': No such file or directory

What can I do?

Regards

by MikeZila on Tue, 2005-06-21 05:43
See if you can find the final manually by cd'ing to that place. If you come to a directory you don't have, tell me what one.

What directories are in "/lib/modules/"?

Did you remember the starting " / "?

Also, post the output of "uname -r".

by obarthelemy on Tue, 2005-06-21 22:57
Hi.

Same problem here: all goes well up until

debian:/home/olivier/dlink# insmod /lib/modules/2.6.8-2-686/misc/ndiswrapper.ko
insmod: error inserting '/lib/modules/2.6.8-2-686/misc/ndiswrapper.ko': -1 Invalid module format

IMPORTANT REMARK: there is an error in your article, the first time you quote the above command (after 'the old-school way', you forgot the leading '/' before 'lib/modules...'. Took me 10 minutes to figure it out. It's hard to be a newbie again

That aside, I am at:

debian:/home/olivier/dlink# iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

eth1 no wireless extensions.

sit0 no wireless extensions.

------------------------------------------------------------------------------------------------

debian:/home/olivier/dlink# ndiswrapper -l
Installed ndis drivers:
gplus driver present, hardware present

-------------------------------------------------------------------------------------------------

It seems I'm on the brink of having it work, but i'm at a loss. Any help would be greatly appreciated.

I'm on a fresh netinst (french), didn't do the alternate kernel trick since I don't mind crashing this newly-installed test install, i did apt-get update, wireless-modules (v1.1-2) and utils (v1.1-4) installed fine and required ndiswrapper-utils (through synaptics). There is only one ndiswrapper.ko in /lib, so this must be the right one ?

The link the the driver for my dlink g520+ on the ndiswrapper page was dead, so i installed the latest one (ftp://ftp.dlink.de/dwl-products/dwl-...iber_Firmware/ which is v 04, ndiswrapper validated 02 which is no longer available), winXP version. That doesn't seem to be the problem so I haven't tried any other.

This is frustrating. I'm quite good at setting up win XP, and his is my 6th try at getting a Linux install to work for me. I try about every 6 months, but never managed to get everything I need working in 10 hours. I'm trying this time on a i810 motherboard to minimize driver problems... Next item on the install list will be VNC, if I can get past the wireless issue, since I can't live with a network cable running in the middle of my flat Install does seem to get better each time (last time i had graphical bugs on the same PC), but up to now, no cigar. I do pick up some Linux knowledge each time ;-)

Any help would be greatly appreciated, I'm stuck.

Thanks a lot and congratulations for a very well-written and useful guide !

Olivier

by obarthelemy on Tue, 2005-06-21 23:15
debian:/home/olivier/dlink# uname -r
2.6.6-1-386

I can see a problem here, because the .ko file is in 2.6.8-2-686:

debian:/lib# find -name ndiswrapper.ko
./modules/2.6.8-2-686/misc/ndiswrapper.ko

debian:/home/olivier/dlink# insmod /lib/modules/2.6.6-1-386/misc/ndiswrapper.ko
insmod: can't read '/lib/modules/2.6.6-1-386/misc/ndiswrapper.ko': No such file or directory

debian:/lib# insmod /lib/modules/2.6.8-2-686/misc/ndiswrapper.ko
insmod: error inserting '/lib/modules/2.6.8-2-686/misc/ndiswrapper.ko': -1 Invalid module format

Oh well ...

by MikeZila on Tue, 2005-06-21 23:20
You said that you didn't get the kernel at the begining of the guide? Are you using a kernel of the exact same version number? If not, then that's the spanner in the works. Modules have to match up exactly with their kernels in order to even load in most cases.

I know I'll be corrected, but in my experience trying to load a module for another kernel version has lead to nothing but trouble.

By the way...

I jumped the gun a bit when I posted this as a LinuxAnswer, but it's original forum thread is here, and it's much more updated and corrected than this one.

by MikeZila on Tue, 2005-06-21 23:22
Jeeze. Beat me to your own question!

If you're worried about the kernel upgrade, don't be. It's totally safe. If it doesn't work your old kernel is safe, sound, and ready for booting.

by Rutnut on Wed, 2005-06-22 09:23
I remember that I couldn't install ndiswrapper-module, apt-get coulddn't find it and synaptics couldn't either.

So where do I get it from

Regards


  



All times are GMT -5. The time now is 03:43 PM.

Main Menu

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration