Hello and welcome to the first edition of Linux Howtos. Every week I will post a video to Youtube explaining how to do something in Linux. This is an important project because there just is not enough simple, easy to understand, and easy to find documentation for new Linux users out there. This week we are going to be discussing how to use Windows wireless drivers in Linux using ndiswrapper. There are not that many native wireless drivers for Linux because wireless device manufacturers tend not to release specifications to the open source community, so we are forced to use Windows drivers and ndiswrapper. So the first thing we are going to do is we are going to determine what sort of wireless card we are using. So we are going to switch to a root user using the $ su command, and we are going to type in our root password, and what we we are going to do now is we are going to run # lspci which should list all the devices connected to our PCI bus. As you can see right here, this is my wireless card, the Dell Wireless 1390. Another piece of information we are interested in is the device id and the vendor id, so to get that information we are going to run # lspci -n again, this time with the -n switch. Looking at the analogous line, which is right here, we see the device and the vendor id in this column... it's the column with 8 alphanumeric characters separated in the middle by a colon. If you happen to be using a USB device, your device is going to be listed under # lsusb right here, and your device and vendor id are going to be in this column. OK, so once you have written this information down, we're going to open up a web browser, and we are going to download and install ndiswrapper from source. So we are going to go to scroogle here, and we are going to search for ndiswrapper and it should be the first result. And I'm just going to zoom in the text a little bit so that you might be able to see it a little better and we're going to go to download, and we are going to download the latest version from source, the latest stable version. At the time of this video, the latest version is 1.52. So here it is. And we're going to save this to disk. I keep all of my source tarballs in a directory called /usr/src and then I have a different directory for every package. My directory here already exists for ndiswrapper-1.52, if yours doesn't you would just click here to create a new directory, and you would name it after the package ndiswrapper-1.52. Anyway, mine already exists so I'm just going to save this file here. It's a very quick download. So we are going to go back to our terminal and install this. All packages that you get from source should be built as an unprivileged user, so I'm going to switch back to my regular account and I'm going to change directories to the ndiswrapper directory, $ cd /usr/src/ndis*2 and now we're going to untar this. We are going to do that using the $ tar -xzf * command. -x for extract, z for g-zipped file (you can tell because of the extension .gz), and f for what file. Since there's only one file in this directory we can just use a *. Now there should be a new directory that was just extracted. So we're going to change to that directory, and now for this next step you're going to have to make sure that you have the development packages for your distribution installed. We are going to run $ make The development package should include kernel headers, it should include gcc(1), make(1), the entire GNU toolchain, standard libraries, that sort of stuff. Chances are your have it already. This just takes a couple of moments. There we go, all done. We are going to switch back to root, because now we are going to install this. And we are going to do that by simply running # make install And it's as simple as that. We should have a working version of ndiswrapper. The next step is to go back to the ndiswrapper homepage, and we going to download the Windows driver for our device, so we are going to go to Documents/Wiki, and we're going to go to the list of cards that are known to work. Since mine is a Dell, we're just going to go to the C-F list, and then I'm going to do a quick search for my card, which is a 1390. There it is. As you can see, there are 2 possible drivers here. The first one has a major security bug so we are going to download this. I happen to have downloaded it already, because it's a rather large file, but if I hadn't I'd simply click on it, select save to disk, and then I would simply save it in the same directory that I saved the original source tarball, which would be there of course, but I've already done this step. So now we have to go back to the console here. (Ignore this step...) So there's our driver. We are going to make a temporary directory just to deal with extracting this driver. # mkdir temp And we're going to move the .EXE file into the temporary directory, # mv *.EXE temp and we're going to change to the temporary directory, # cd temp here we go. Now, even though this appears to be a Windows Executable file, it's actually just a self-extracting zipfile. So, in Linux here we can simply run # unzip *.EXE and then the name of the file, and we're going to be inflating this. All right. Here are all the files we extracted, so we're going to change to the DRIVER directory. Of course, depending on what your driver happens to be this may be a little bit different. What you're looking for is you're looking for the correct .inf file for your card, and it should be coupled with a .sys file. So now, we're going to run the # ndiswrapper userspace tool that we just installed. If we just type in its name it prints out a list of the available switches and what they do. So to install a driver you use this first switch, -i and then the inf file. So we are going to do # ndiswrapper -i bcmwl5.inf And there. Now we have installed the Windows driver into Linux. And the final step is to run # ndiswrapper -m and what this is going to do is add an alias to a file in the /etc directory that is going to associate this device, wlan0, with the driver we are using, which is ndiswrapper. So at this point we should be able to type # ifconfig wlan0 up and tada, as you can see the wireless device is now working. So now all we have to do is run # iwlist wlan0 s and this is going to scan for available wireless networks. Of course I don't happen to have any at the moment. But there you go, a quick and easy way to install ndiswrapper on your computer.
Welcome to the bulix.org / pastebin. Please don't use this pastebin for illegal purposes, defamation or kitten-squashing.
This pastebin is written using PHP and MySQL and relies on Alex Gorbatchev's syntax hhighlighter (JavaScript based). To avoid spam, you will be required to complete a small mathematical challenge when adding a new paste.
New! Try the pastebin command-line tool: paste.py (requires Python and python-beautifulsoup).
Powered by the Bulix.org Code Pastebin, by Maxime Petazzoni. View pastebin statistics.