Wireless using NDISwrapper and the Windows driver
Quoting ndiswrapper description :- Some
vendors do not release specifications of the hardware or provide a
Linux driver for their wireless network cards. This project implements
Windows kernel API and NDIS (Network Driver Interface Specification)
API within Linux kernel. A Windows driver for wireless network card is
then linked to this implementation so that the driver runs
natively, as though it is in Windows, without binary emulation.
The
main workng parts of ndiswrapper are included in the default Ubuntu
kernel but some extra bits are needed to use it. These are
supplied in the ndiswrapper-utils
package. Also for using the graphical interface, another
package, ndisgtk (a frontend
for ndiswrapper)
is required. If you have a wired internet connection these
can be downloaded and installed using the Synaptic Package Manager
(available from the System
> Administration menu and Search for ndiswrapper this
finds both packages).
This
is by far the easiest method but if you are using a desktop PC some
distance from the router and reliant on WiFi, this is not appropriate -
see next section.
Note
:- This page relates to Ubuntu 7.04 (Feisty Fawn) but should work with
7.10 (Gutsy Gibbon) and 8.04 LTS (Hardy Heron) if none of the methods using a native Linux driver
work - there are slight
differences that apply to Ubuntu 6.06 LTS (Dapper Drake).
Please
see Use Windows driver
to access wireless adapter in Ubuntu 6.06 and
also Using ndiswrapper
etc. when you have no internet connection in Ubuntu 6.06
(which follows). I have tested this method with Ubuntu versions
7.04 and 6.06 only and the wireless adapters I had at the time -
version numbers and other details may be different for other Ubuntu
versions.If the Ubuntu system doesn't have
wired internet access
The package files will want downloading with Windows or on another
computer. A USB memory stick is very useful for transferring
files between computers or between operating systems (though with
Feisty you should have access to your Windows files).
Download
sites :-
These packages may
be installed in Ubuntu simply by double-clicking on the files and
following the prompts.
The Windows Driver File
In
most cases just one file is required, this will have an .inf extension.
This may be obtained from :-
- The
Windows System driver folder for the WiFi adapter
- The
supplied Windows WiFi adapter CDROM
- Download driver
from the internet and unpack it
If you find more
than one .inf
file and not sure which to use then copy both/all onto your transfer
medium. One of them will probably work.
Setting
up ndiswrapper to use the Windows driver in the Graphical Interface
- Firstly,
copy the Windows driver file(s) from your transfer medium to the Ubuntu Desktop
(or somewhere else where you can easily find it).
- Having
installed ndiswrapper-utils
and ndisgtk a
new item will be found at the bottom of the System > Administration
menu. This is Windows
Wireless Drivers. Choose this item to install
the Windows driver and set up the wireless connection.
- The
Wireless Network Drivers
dialog will appear - Click +
Install New Driver
- In the Install Driver
dialog - Select inf file, Location and
navigate to the Windows driver file and Open it - the name
appears in the Location
box - Click Install
- The
driver should appear in the large square box on the left.
There
should also be a message about hardware present. (Don't worry
at
this stage if it says "No" - it may detect it on restart.)
- Click
Configure Network
- In
Network Settings
- Click on Wireless
connection, then Properties
- In
the following Settings
for... dialog untick Enable
roaming mode and enter all your network wireless settings
as in the section above and click OK
- Back
in Network Settings,
tick the box beside Wireless
connection and untick Wired
connection - you will probably see a pop-up at the top of
the screen saying "Network disconnected"
- Close both
dialogs and restart Ubuntu.
If
everything has been entered correctly the Wireless Networking should
work. If not try restarting again. If you used WEP
with an
ascii password, try the hex version of the password - this may be
obtained from your router (Use Windows or another machine if required).
If it still doesn't work there are still possibilities.
- Some
wireless adapters need both the .inf
and .sys
files from the Windows driver (this will require command line)
- Some
do not physically contain the firmware to make them work and this is
installed by the driver. The way round this in Ubuntu is to
extract the firmware files from the Windows driver for Ubuntu to
install.
Installing Windows driver files
using Command Line
Note :-
Command Line (Terminal) entries are shown in RED
- Install
ndiswrapper-utils
if not already installed from previous attempts - as described above (ndisgtk
is not needed when using the command line).
- Create
a directory (folder) off your home directory and name it something
suitable - (we shall use wifi)
and copy the
.inf and .sys
files from your
Windows driver (see above)
- Open a terminal window
and enter the following commands:-
- cd wifi
- sudo
ndiswrapper -i <name>.inf (make
<name> the name of the .inf
file)
- cd /etc/ndiswrapper/
- sudo modprobe ndiswrapper
- sudo echo ndiswrapper >>
/etc/modules
- sudo
iwconfig (from the list get the name of the
wireless connection and if not wlan0,
replace wlan0
with your system's name in the commands below)
- sudo iwlist wlan0 scan
(look for your access point in the list)
- sudo iwconfig wlan0 channel <X> essid
<ESSID> mode Managed (the X and ESSID
should come from the iwlist)
- sudo ifup wlan0
If you have a WEP password set go into the Network dialog (as above)
and set the WEP password etc. Wireless may work now or you
may
need to restart Ubuntu (maybe twice).
Addendum
Use Windows driver to access wireless
adapter in Ubuntu 6.06
If Ubuntu doesn't automatically detect your wireless adapter,
this HowTo describes how to
enable wireless networking with Linux using the driver file from
Windows and the ndiswrapper feature of Linux.
Firstly find and copy the .inf file for
the wireless driver
into a removeable media - eg. USB memory stick, CD or floppy. This may
be from your Windows installation (preferred), the install CD or a
downloaded driver. Try looking in Program Files and
the folder for the make of wireless adapter. If there's more than one .inf
file make copies of all of them to try later.
Boot into Linux
Go to System>Administration>Synaptic Packet Manager
In there choose Settings>Repositories
and choose "Ubuntu 6.06 (LTS) binary - Community maintained Universe"
by ticking the box
Close window
Click on Reload - this will download a new list of
packages available
Click Search and enter "ndisgtk"
Select for download by ticking the box on the left
Do the same for "ndiswrapper-utils"
Click on Apply and the packages will be installed
Go to System>Administration>Windows Wireless
Drivers (a new option we've just added)
Click Install New Driver
Browse to the .inf file you saved earlier and click
Install
The new driver should appear in the list on the left
Choose Configure Network and enter your network
settings ESSID (also called SSID) and WEP Passphrase. Choose "Use DHCP"
and click OK
The wireless connection should now activate.
Using ndiswrapper etc. when you have
no internet connection in Ubuntu 6.06
Although easier to install the necessary packages using a
wired
connection to the 'net, this isn't always practical. This is how to use
another computer or the sams computer running Windows to download the
required files.
Two packages are wanted to use the graphical interface in
Ubuntu to get
wireless working using the Windows driver info. These are ndiswrapper-utils
and ndisgtk The versions I used successfully with
Ubuntu v6.06 (Dapper Drake) were ndiswrapper-utils_1.8-0ubuntu2_i386.deb
and ndisgtk_0.6-0ubuntu1_all.deb.
These are Debian packages and can be installed into Ubuntu by simply
double-clicking on the file icon - making installation easy.
Method
In some cases you may be able to read Windows hard drives from Ubuntu
but if not (and safer anyway) you will need some form of removeable
storage to transfer files between Windows and Ubuntu. I recommend a USB
memory stick - fast and easy - thought anything else, such as CD-RW or
even floppy will do.
Find the installation CD that came with your wireless adapter
or find
the location of the driver files in Windows - usually in the Program
Files folder under either make or device name. Look for .INF
files and copy to your storage device. It may or may not be obvious
which you want or there may only be one. If not obvious and more than
one, copying both/all gives you the opportunity to try more than one if
the first doesn't work.
Now go online and download ndiswrapper-utils_1.8-0ubuntu2_i386.deb
and ndisgtk_0.6-0ubuntu1_all.deb. These may be
obtained form many sources of Ubuntu main or mirror websites eg.
http://mirror.linux.org.mt/mirror/ub...n/ndiswrapper/
and http://mirror.linux.org.mt/mirror/ub...rse/n/ndisgtk/
and choose the files from the list.
Copy these two files to your storage device.
You are now ready to run the Ubuntu live CD (or HD version,
if you've
already installed Ubuntu). Connect or insert your storage device if
required (eg. different PC) and boot up into Ubuntu.
Your storage device should appear on the Ubuntu desktop - or
find it from the Places
Menu. Go into this and find the files you just copied. Double-click on
each file icon (looks kike an open cardboard box) to install ndiswrapper-utils
and ndisgtk, and follow the instructions for each
in turn.
Go to System > Administration > Windows Wireless
Drivers (a new option we've just added)
Click Install Driver
Browse to the .inf file you saved earlier and click
Install
The new driver should appear in the list on the left - if not try
another (if available).
Choose Configure Network and enter your network
settings ESSID (also called SSID) and WEP Passphrase. Choose "Use DHCP"
and click OK
The wireless connection should now activate.
Still not working?
If from doing the above it seems that there is a driver
loaded but not working properly, the next section may help.
Wireless
adapter chipset supported by native Linux driver but driver does not
work properly
In some cases there may be a Linux driver for the wireless adapter
but it does not work. The adapter may be an older version and
not
properly supported. To get round this the native Linux driver
must be
disabled or "blacklisted" as it is called.
With pre
7.10 versions of Ubuntu, this
was the case with my Linksys WPC54G laptop adapter (works with 7.10 - see above).
This is an
early card and although based on the bcm43xx chipset which Ubuntu
supports directly, the built in driver did not work. Nor did
the
above ndiswrapper methods. The native driver was being chosen
in
preference to the Windows driver. Many wireless adapters use
this
chipset and don't work "out of the box". This problem may
occur
with other chipsets too and the following method may work by replacing bcm43xx with your
chipset type number. Also, replace lsbcmnds with with
the name of your Windows driver .inf
file. The following assumes the previous method has been
tried and Windows driver file(s) are in wifi off your home
dir.
Disable native driver and current
implementation of ndiswrapper (resulting from trying the previous
method).
echo
'blacklist bcm43xx |sudo tee -a /etc/modprobe.d/blacklist
sudo rmmod
bcm43xx
sudo rmmod
ndiswrapper
Make sure everything is
up-to-date and install the latest ndiswrapper-utils
sudo
apt-get update
sudo
apt-get upgrade
sudo
apt-get install ndiswrapper-utils
Change
to directory containing Windows driver file and link it to ndiswrapper
cd ~/wifi/
sudo
ndiswrapper -i lsbcmnds.inf
cd
/etc/ndiswrapper/lsbcmnds
sudo
modprobe ndiswrapper
sudo gedit
/etc/modules
This
opens the gedit text editor in "root" mode. Check to see if
ndiswrapper is included and if not add a new line at the bottom
containing ndiswrapper
on a line of it's own. Then Save it back and exit gedit.
Restart
Ubuntu.
Updated 28 May 2008