If you haven’t heard about it, you will. Ubuntu Linux is a rather streamlined distribution, based on Debian. Out of the box, it comes with Open Office, GNOME, and more toys than you can shake a stick at.
What follows is a rather brief howto to make ndiswrapper and wpa_supplicant work with Ubuntu Linux. It’s not for the faint of heart.
First, you’re going to need your kernel sources, which Ubuntu doesn’t offer by default. Since I didn’t have a wired network to plug into, I burned all of the following to a CD, then did my work on the machine I was going to set up. (which I am now posting from yay!).
Get the kernel sources which match your installation. Open a terminal, then run
%uname -rYou should see something like:
2.6.8.1-2-386This means you’re using kernel 2.6.8.1. Get linux-kernel-headers-`uname -r` from your local Ubuntu mirror.
Now, get your Windows XP drivers. You can’t have a .EXE. You need the .inf, .sys files, and the like. Figure how to get them, and copy them to a safe place. I like /etc/ndis, because I’m lazy.
%sudo mkdir /etc/ndis; sudo cp /media/cdrom0/xpdrivers/* /etc/ndisNow, get ndiswrapper.
Copy it to some location, either ~/src, /usr/src, whatever – it’s not for me to judge your administrative beliefs.
%mkdir ~/src; gzip -dc /media/cdrom0/ndiswrapper-0.11.tar.gz | (cd ~/src; tar xvf -) %cd ndiswrapper-0.11 %make %sudo make installNow, install your ndiswrapper support (the XP drivers)
%sudo ndiswrapper -i /etc/ndis/WHATEVER.inf
If the system has a card that works with one of the loaded drivers, you should see the following message in the system log (dmesg):
wlan0: ndiswrapper ethernet device xx:xx:xx:xx:xx:xx
Use iwconfig to configure the wireless adaptor. First, locate the wireless interface:
%sudo iwconfigThis will print the wireless interface (e.g., wlan0).
Add it to your boot-time loadable modules with:
%sudo ndiswrapper -mIf you are using WEP, you’re basically done. Read the README in the ndiswrapper distribution to set your ESSID, key, etc. Those of us in WPA-PSK land… read on.
You need WPA? Not a problem!
Untar it as we have above…
%gzip -dc /media/cdrom0/wpa_supplicant-0.2.5.tar.gz | (cd ~/src; tar xvf -)Now, we need to add configuration support for ndiswrapper. These steps are very important – if you fail to do this, it won’t work. Finally, build and install wpa_supllicant with ndiswrapper support:
%cd ~/src/wpa_supplicant-0.2.5 %make mkconfig %echo “CONFIG_DRIVER_NDISWRAPPER=y” >> .config %make %sudo cp wpa_cli wpa_supplicant /usr/local/binNow, make a WPA configuration file for wpa_supplicant. Let’s call this file /etc/wpa_supplicant.conf Note that my example is for WPA-PSK. There are other forms of WPA. You can find them outlined in the README within the wpa_supplicant
package.
I’ll assume you know vi, or replace it with an editor of your choice.
The config is rather simple:
ctrl_interface=/var/run/wpa_supplicantnetwork={
ssid=”MYSSID” # Or whatever your SSID is
psk=”NO MORE SECRETS” # Or whatever your password is
key_mgmt=WPA-PSK
proto=WPA
}
Save this file and exit.
Now start up dhcp (if you use dhcp), and wpa_supplicant.
dhclient wlan0 & wpa_supplicant -Dndiswrapper -iwlan0 -c/etc/wpa_supplicant.conf -ddThis will spew a load of stuff to the screen. Don’t worry. Give it about a minute or so and you should be on the network!
If not, check your SSID and any errors from dhclient and wpa_supplicant. It might be easier to start the two in seperate terminals.
The killer – how to make it work automagically with Ubuntu and Debian:
Edit /etc/network/interfaces and add the following:
auto wlan0 iface wlan0 inet dhcp wireless_mode managed pre-up modprobe ndiswrapper || true pre-up /usr/local/bin/wpa_supplicant -Dndiswrapper -B -i$IFACE -c/etc/wpa_supplicant.conf name Wireless LAN card netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.1.1 dns-nameservers 192.168.0.1 wireless_essid YOUR_SSIDNote that I have a modprobe for ndiswrapper, just in case it didn’t load. The pre-up script calls wpa_supplicant, as we have above, with it’s configuration, which will then finally load the dhcp client.
Your wireless network will now work with ‘ifup wlan0’.
Welcome to wireless networking with non-native drivers, WPA encryption, and it’ll work automagicially. Note that you will most likely have to rebuild ndiswrapper when you upgrade your kernel, until it becomes ‘stock’. Aparrently, recent versions of Ubuntu do have ndiswrapper installed, but that does little good if you’re not already on the ‘net.
[Edit: This guide, written in September, 2004, is now out of date.
It has been brought to my attention that wpa_supplicant is now installable from the Ubuntu “universe”. To enable the universe repository, merely edit /etc/apt/sources.list and remove the hashs before the line reading:
deb http://archive.ubuntu.com/ubuntu warty universeThen, execute:
apt-get install wpa_supplicantAlso of note is that Ubuntu is now distributing ACX100, an open source driver whic hattempts to provide native support for Texas Instruments ACX100/ACX110 based wireless cards. You will have to manuall remove this driver if you have an ACX100/ACX110 card, as it will result in ndiswrapper not working. A simple way to fix this is to add ‘pre-up rmmod acx_pci’ to your interfaces.
Happy Ubuntu-ing!]