Thursday, March 12, 2009

Wi-fi in Linux

The most common method of getting the wireless card to work in linux is to use ndiswrapper to install the drivers made for windows. The reason that getting wireless to work in linux distros is so difficult is because the vendors do not manufacture drivers for linux and hence there are no out of the box solutions but only hacks. Initially I encountered a lot of errors while installing wireless drivers on linux. However, after the initial struggle, I managed to compile a series of simple steps that have to be followed in order to get the wireless driver in linux without much head-ache.This served as a reference to me for installing them again and again and again. In this post, I am going to share with you these steps. They are presented in a simple, abstract manner that is the same across all distros and manufacturers (systems). However, the concrete steps to be taken may vary among distros (say debian and open suse) and among manufacturers (say hp and dell). Installation Sequence:
  1. Pre-requisites
    1. Kernel Headers and gcc
      • In order to install any non-trivial software on your system, you need to have the kernel headers and a gcc compiler installed. Please refer to my earlier post for that.

    2. Ndiswrapper
      • First download the ndiswrapper source code, here
      • Now, you need to extract the downloaded file somewhere, say your home folder.

    3. Specific windows driver
      • Next you need to download the specific windows driver for your system. Please note that this is system specific. For example for hp the windows wireless driver can be found by searching, here

    4. Cab extract
      • Open the terminal and type
            $cabextract --help
        if you get something like command not found then you need to install cabextract (next step) else you can skip to the actual installation given below.
      • Download cabextract from here
      • Install cabextract on the command line by typing in the following commands in the terminal
            $sudo ./configure
            $sudo make 
            $sudo make install
      • In regular usage, just enter cabextract and the name of the cabinet or executable file you want to extract. cabextract will extract all files in all cabinets to the current directory, preserving any internal directory structure, file permissions and file dates. For further details see here.

  2. Actual Installation
    1. Type in following commands for installing ndiswrapper
          $cd ndiswrapper<version>
          $make uninstall
          $make install
    2. The following commands installs the actual wi-fi driver
          $cd (into the folder that contains the extracted .exe file)
          $ndiswrapper -i filename.inf
          $ndiswrapper -l
    3. Final steps before you see the blinkenlights ;-).
          $depmod -a (if no error then continue)
          $modprobe -r b44
          $modprobe -r b43
          $modprobe -r b43legacy
          $modprobe -r ssb
          $modprobe -r ndiswrapper
          $modprobe ndiswrapper
    4. Adding an alias for ndiswrapper
          $ndiswrapper -m


Anonymous said...

I have dell inspiron 1440 with broadcom 4315 chip. I have followed the above steps, but it didn't worked. I am at lost what to do. Please help.

Abdullah Abdul Khadir said...

What operating system are you using? And did you get the windows driver for your system? Maybe you can get it from the dell web site.

Post a Comment