Archive for the 'ubuntu' Category

Linksys WPC54G ver. 1.2 with WPA on Hardy

Monday, June 9th, 2008

I’m pleased to say that my old trusty Linksys WPC54G ver 1.2 works without ndiswrapper Hardy Heron. I have been using this card since Hoary, but never “natively”. My last attempt at installing it was under Feisty and I failed. Whether it was me or Feisty being… Well, feisty and uncooperative remains to be determined. You were supposed to do something like this:

sudo aptitude install bcm43xx-fwcutter
sudo bcm43xx-fwcutter -w /lib/firmware/ ~/bcmwl5.sys

Where bcmwl5.sys was the original Windows driver you could obtain from the linksys ftp site. It did not work for me, and I ended up falling back on ndiswrapper like usual which always worked, but was always flaky.

I figured I might as well try the bcm43xx trick under Hardy. Things generally improve over time, and old bugs and quirky behaviors go away - it’s not like Debian where you get a stable release once in a century. Unfortunately, it once again failed miserably. Or rather I failed. Or perhaps, should I say we had a miscommunication. I asked Hardy to use the bcm43xx module and he did exactly that - despite the fact it was the wrong thing to use.

What I didn’t notice was that some sort of a switcharoo took place, and this time around the errors spewed forth by the card were something among the lines of: b43/ucode5.fw” not found. As you can probably see, they did not mention bcm43xx anywhere, but I assume that b43 == bcm43xx. I assumed wrong. They are two different modules. So how do you make the card work under Hardy? Like this:

sudo aptitude install b43-fwcutter

Yep, that’s it.It automatically pull down the relevant firmware, cut it and throw the relevant .fw files into /lib/firmware automagically. It’s that easy. This is what happens when you assume the “well, this worked last time so I’m just gonna keep trying and ignore this very helpful error message right here cause I know better” stance.

My next task was of course to configure the system to use WPA. Ubuntu is nice enough to support it out of the box via the wpa_supplican package - not all distros do though. Etch ships without it, and it took me a while before I figured out why I couldn’t connect. My Gutsy laptop had no issues picking up the Wifi in my house. All I had to do was to pick the network from a list using knetworkmanager, type in my passphrase and I was ready to go. It would be a bit more difficult with this system, because I was building it bare bones, without any window manager.

How do you set up WPA without the GUI? There is a really nice writeup in Ubuntu forums that shows you what you need to do. Let me summarize it here, for future reference.

First you need to convert your pass phrase to an actual hex key. You do this by running the following command:

wpa_passphrase my_ssid "my long passphrase"

If your passphrase is an actual phrase (ie. it contains spaces as it should) you will need to put it in quotation marks. The output will look something like this:

network={
    ssid="my_ssid"
    #psk="12345678"
    psk=fe727aa8b64ac9b3f54c72432da14faed933ea511ecab1 5bbc6c52e7522f709a
}

You are interested in the last line - the psk value. Copy it, save it or hold on to it in some way. Next open up your /etc/network/interfaces and add the following lines to the bottom:

auto wlan0
iface wlan0 inet dhcp
wpa-driver wext
wpa-ssid <your_essid>
wpa-ap-scan 1
wpa-proto WPA
wpa-pairwise TKIP
wpa-group TKIP
wpa-key-mgmt WPA-PSK
wpa-psk <your_calculated_psk_key>

The last line is where you paste in that long hex key we calculated in the previous step. Now running:

sudo ifup wlan0

should bring your wireless up, authenticate and negotiate an IP from the DHCP. The first line, will automate this process so that every time you boot, or insert your card into the machine, it will try to authenticate and connect.

There is one small issue with this setup that I noticed. The LED’s on my card no longer work, but that might be unrelated to this setup. They worked when I was using it under Feisty with ndiswrapper, and it did lit up when I briefly experimented with Debian Etch on this system. But they never switched on under Hardy for some reason. Then again, maybe the card just had it - I’ve been using it for few years now, and it is a little bit “bent” from that one time, I forgot to take it out before putting the laptop in my bag. so perhaps the LED’s just died a natural death. The card still works though.

On Linux Hardware Compatibility

Wednesday, May 7th, 2008

I love how anti-linux advocates and windows fanbois always pick on Linux for hardware compatibility or rather lack of thereof. Just about every rant about Linux I have seen so far includes a gripe about it not supporting new or exotic hardware out of the box. Funny thing is that, neither does Windows.

Here is an experiment, and I encourage everyone to conduct it at their leisure. First, grab your Windows XP CD (preferably the one with SP2 slipstreamed in) and do a clean install on a formated drive. Once it is done, pull up the device manager and count the yellow question marks (these are the devices that failed to initialize because they are not supported out of the box). Try to figure out what they are (good luck on that), and write them down on a piece of paper. Once you do that, grab your favorite Linux distro (I recommend Ubuntu) and repeat the exercise. Once you have your Linux installed, run lshw or equivalent command and see how many of the devices from your “yellow question mark” list were detected and configured during the installation. I suspect that you will be able to cross of at least few of them from your list. Your results may vary

I did this experiment several times on fairly standard, and widely deployed (at least in my company) Inspiron 600m hardware. Both Dapper Drake (6.06) and Gutsy Gibbon (7.10) have booted into fully operational machines and installing optional “proprietary” drivers was as easy as clicking on a button in one of the system menus. Windows XP SP2 on the other hand booted in low resolution mode, and without any working network device forcing me to install 4 or 5 driver packages off an OEM “Drivers & Utilities” CD that was shipped with the machine.

I had very similar experience when I installed Hoary on my old Inspiron 4000 laptop back in the day. Not to mention that one time when I pulled the HD out of the aged 4000 and installed it in an Inspiron 4150 which actually had a different motherboard, different video card, sound card and network devices… And it still worked. Don’t ask me how - but I was using that machine for over two years without a hitch.

These are just the examples which I have documented, but in my experience every time I pitied Linux (or rather Ubuntu) against Windows the former always turned out to be the more robust, and more user friendly (at least during installation and setup) than the later. Perhaps I’m biased, but I implore you to test this yourself.

Note that I didn’t talk about Vista here, because I have yet to do a clean install of that monster. Hardly anyone that I know is running it, and those who are are usually more interested in downgrading to XP than re-installing it when the time comes. Honestly, that’s the sentiment around here. I can’t tell you how many people approached me asking if I can downgrade their Dell or HP computer to XP. But that’s inessential. Perhaps the new OS from Redmond can really match Ubuntu in it’s ability to detect, and configure hardware out of the box. Still, that doesn’t change the fact that Ubuntu had Windows XP (the most widely deployed OS in the world so far) outmatched and outclassed for years now all the while Microsoft fanbois were ragging on Linux for lack of hardware compatibility.

So I ask you, which operating system is better in this area? The main difference between the two is that all the hardware being sold out there is guaranteed to work on Windows. So while a clean install of XP will often have your machine limping in a half crippled, low resolution mode, with no sound, no network connection and no working modem, you can always get it working with the proprietary 3rd party drivers. You just need to find and install them - which may or may not be difficult, depending on whether or not you managed to lose the OEM CD with the drivers.

So what is the main difference between Windows and Linux? Windows always has access to 3rd party drivers - Linux, not so much. Is this something we should blame Linux community, or developers? No, not really - just like we can’t credit Microsoft and their dev teams with making all these drivers. They are made by hardware manufacturers who are at liberty to pick and choose which operating systems they are willing to support. How do they choose them? I guess they look at adoption and deployment rates - and many of them find Linux to be to small of a target to commit their resources to supporting it.

So we end up with an endless loop scenario. Hardware vendors are not supporting Linux because to few people are using it. Few people are using Linux because the lack of support from the hardware vendors. In such environment the only thing Linux community can do is to hack, and reverse engineer everything they can get their hands on, and support it out of the box. And this is what they have been doing for years now.

No More Excuses for Booting into Windows Partiton

Friday, May 2nd, 2008

I said it before, and I’ll say it again - Linux is not for everyone. Convincing people to switch their primary OS is a little bit like trying to convince someone to change their religion, or political views. It’s possible, but not easy. You can’t really “convince” someone that your OS is superior in a discussion. The only way you can really accomplish something like that is by subtle influence - by showing, teaching, and leading by example. I never try to sell Linux to others - I simply use it and talk about the good and bad things that entails with a passion. I found that this approach is actually makes the right kind of people interested in the platform.

To that end however I know many people who like Linux, own dual boot systems, use it occasionally and are passionate about it but never make the plunge of making it their primary OS because they need application X or Y. Note that I didn’t say switch. Switching is the last thing I would want someone to do. I personally believe in being platform agnostic. Your personal computing ecosystem should be a healthy mix of different operating systems and you should be able to jump from Windows to Linux to MacOS without really skipping a beat. Each platform offers different things, and there is no reason to confine yourself to a single one. OS is not a religion. I naturally don’t mean that you ought to go and spend money on new systems so that you can experiment. What I mean, is that instead of throwing out or giving away your old computer when you upgrade to a new one, set it aside and use it to install that one OS you always wanted to try.

But I got side tracked. Let’s get back to the poor Linux enthusiasts who can’t live without that single Windows-only application they actually use every day. I often hear them saying things like “I would banish Windows from my hard drive long time ago if only there was a good Linux alternative for application X” or “if application X would actually run under Wine reliably”. Excuses, excuses, excuses.

I did some testing, and I found out that there is a reliable solution for most of these people. I will let you guess where I’m going with this. Let’s see if you were paying attention to my posts for the last few weeks. The answer here is Virtual Fucking Machines. And I use the f-word here for added emphasis and not to signify teledildonics or something silly like that. Virtualization will let you run most of the crucial Windows-only applications under Linux with no glitches and no problems. For example, for the last few days I have been hacking away in Visual Studio on a .NET application that is supposed to work with MS Outlook using Ubuntu as my primary OS. How did I do that? I was running Windows XP in a VirtualBox. So I was using a real Windows environment, and real Windows application without the need to actually boot into that OS. My machine has 2.4 GHz Intel Centrino Duo CPU and 2 GB of RAM which is actually pretty decent, but not entirely impressive by today standards, but I was able to comfortably run a Virtual Windows XP session. Note that I was running full KDE desktop with several applications open on the Linux side (namely Kontact, Firefox, Gvim and Komodo Edit). The performance was just fine, and the build times were actually pretty good. In fact, I don’t think I would get much more speed running windows natively because I would likely be bogged down with some bloated security suite.

In fact, I must say that Office 2003 inside the emulated session was actually much faster and responsive than Open Office running natively outside the VM. So I would say that roughly 80 to 90% of these killer windows apps that people cannot live without could be comfortably run this way. I haven’t really tested Photoshop (one of the most often mentioned apps in this category) but I don’t see why wouldn’t it run semi-decently in a VM. You may need to allocate more memory to the VM if you usually work with big images, but other than that I believe you should be fine.

There is of course a class of applications which won’t do well in a VM. These are performance intensive apps that usually like to talk directly to your video card such as games, 3d rendering apps and etc. Gaming is one of these things that will remain a Windows domain for a long time. If you are a gamer and you want to play the newest titles on the market, your gaming box needs to run Windows. There is just no way around it - performance is paramount, and it will always be worse under a VM. Not to mention the fact that you won’t have low level access to your system’s 3D acceleration hardware while running in a virtual sandbox. Same goes for rendering or doing 3d animation that is windows, or architecture specific. Some of the stuff you just can’t fake.

But apps which do not need low level hardware access, and are not total resource hogs that take over your whole machine in full screen mode should be happy to run in a virtual machine. So no more excuses people. Next time you have a chance, boot into your Linux partition, download VirtualBox or VMWare then install Windows inside it, and set up your work environment there. Then next time you need to use that killer windopws-only app of yours just fire up your VM and work from there. When you are done, shut it down and enjoy your life in a pristine Linux environment - just like you always wanted.

If the performance sucks, or you think the whole VM thing is a hell of an inconvenience then you can start booting back into your windows partition. I won’t blame you. This is just a friendly suggestion for those of you who would love to take the plunge into Linux - to live it and breathe it every day - but seem to be chained down to Windows by this one or two silly apps. This is something that could let you do your first step towards becoming a better Linux user, and let you learn the intimate inns and outs of the new OS while still having the old one at your fingertips when you need it.

Just don’t try virtualizing Vista yet - that’s a whole mess of issues in itself. XP will still be a perfectly serviceable OS for the next few more years. And by the time they end-of-life it and it is no longer safe to keep it around hopefully hardware and virtualization technology will catch up to the point where running Vista (without Areo) in a VM will be as pleasant and worry free as running XP is now.

Setting up Dell 3100cn Printer on Kubuntu Gutsy

Thursday, April 17th, 2008

My office has several network printers. Most of them are HP and have zero issues using them from under Linux. They worked right out of the box - all I had to do was to set them up as Windows/Samba shared printers via the KDE printer setup GUI. One that always gave me problems was the big, black and bulky Dell 3100cn color printer sitting in the corner which was not supported.

I finally figured out how to bend it to my will. If you digg around on the Dell website you will notice that it does offer Linux drivers for that machine. Only they are Red Hat drivers. No debs, despite the fact that Dell is officially distributing Ubuntu with their systems. Why is that? Who knows. The important part is that they are there.

snapshot18.png

These are Linux drivers, and that makes our life easier. If they work for Red Hat, they can be made to work for Ubuntu. The systems are not that different after all. Here is how we are going to do this.

First grab the Red Hat drivers from the Dell website:

wget ftp://ftp.us.dell.com/printer/Dell-Laser-Printer-3100cn-1.3-1.noarch.rpm

Next, let’s transform the rpm into a deb package using alien:

sudo alien Dell-Laser-Printer-3100cn-1.3-1.noarch.rpm

If all goes well, this should spit out a deb file into the same directory. The name is exactly the same, but for some reason alien likes to lower-case the whole thing. You should be able to install it bu doing the following:

sudo dpkg -i dell-laser-printer-3100cn_1.3-2_all.deb

This should do it, unless you run into some dependency issues (I had none) or some other problem. That was the hard part. It’s smooth sailing from here my brothers. Just pull up the KDE printer interface and let’s try to add our new printer:

snapshot13.png

Nothing out of unusual yet. By trial and error I learned we need to use the TCP/IP Network Printer option on the next screen:

snapshot14.png

On the next screen just put the IP address of your printer. You know what it is, right? In my office the printer is actually hooked up to a wireless printserver from Linksys which actually does have an IP address of it’s own. If you are using the built in networking logic this step might be different. Anyways, this is insignificant detail.

snapshot15.png

Finally you should be able to specify a printer by picking it from the driver list. A DELL entry should automagically appear in there, and it should have a 3100cn option for you to choose. If you don’t see it, you probably installed the package wrong. If you do see it, pick it, then keep clicking next until you are prompted for a printer name, enter it and you are done.

snapshot16.png

Easy as pie (that is if you consider pies to be easy)! Now I can finally print in color! Wohoo!

Btw, this worked on Gutsy. If you are running Hardy, you are on your own. )

My Renewed Love for Virtualization

Wednesday, April 16th, 2008

Every once in a while I need to use windows centric applications at work. IE is the least of my problems since it seems to work semi-reliably under Wine. But sometimes I need to test things in a full Windows environment, or run into an app that is just to much pain in the ass to install on Linux. This is why in the past I commandeered an old decommissioned desktop barely capable of running WinXP and I plopped it under my desk as my “windows machine”. I would then rdesktop to it whenever I needed to something windows centric. The machine was aged, but it worked quite well when I had a really old and slow laptop. You could barely tell the difference between the two as they were both crawling at the same speed.

Now that I got upgraded to a much newer, and much nicer machine the difference between the two became noticeable and somewhat annoying. My laptop is set up as dual boot with Windows XP but since I can do 90% of my work from under Linux I have my whole working environment set up and ready to go when I boot Ubuntu. Rebooting into windows every time I needed to do something there would be silly - especially since I’m used to working in that two-machine mode anyway.

So I figured since my machine is several times powerful than that puny desktop, I could probably emulate it and get comparable and better results. When I tried virtualization in the past it usually performed poorly due to my hardware specs. So I never really used it extensively. It was more for novelty value - for example installing an obscure Linux distro in a VM to check it out. I never really used virtualization on a daily basis, because of the poor performance. My current laptop however seemed strong enough to be able to handle an OS that was not a huge resource hog. That security talk from last week gave me the final motivation to get it all together and actually set up an environment which I could use regularly.

I briefly talked with the security expert after his presentation and naturally we chatted about virtual machines since this was major topics he discussed. He mentioned he was all about virtual machines. For example, he said liked to keep his work and play environments separate. So when he took his work laptop home, he started a virtual machine in full screen mode and then did all his casual browsing and entertainment from there. He could install whatever he wanted without making the machine unstable, and didn’t really really worry about viruses that much since he could always just roll back to the last clean snapshot. So if this guy could do this, then so could I.

So I installed VirtualBox on my machine, then grabbed Windows 2k CD and created myself a virtual machine of my own. End result is that my 2.4 GHz dual core laptop with 2GB of RAM is able to comfortably run a Windows 2000 session. And by comfortably I mean that I’d be actually using both machines to do real work. So on the Ubuntu site I may have the following things running:

  • Kontact
  • Firefox
  • Komodo Edit
  • Several gVim sessions
  • Seveal open Konsoles
  • 2 rdesktop sessions

On the VM side I would have the following open:

  • Excel
  • Monarch
  • IE
  • Adobe Reader

Both environments remain responsive, and there is no sign of slowdown at any point. VirtualBox even has the so called “seamless mode” which removes the VM window and makes the program windows appear as if they were running natively. Kinda like Parallels on OSX. Still, the Windows apps in this mode are sort-of confined to a single virtual desktop (I usually work with 6 or 7) which limits the usability of this mode. Also, they only see the virtual file system, so after experimenting a bit I switched it back to windowed environment. I sort of like the clear separation - and the VM window almost feels like just another rdesktop session which works out great for me. And now I can literally take my “windows box” with me everywhere I go.

If you haven’t tried this yet, and you have the hardware for it I highly recommend jumping onto the virtualization bandwagon. If you are already on the bandwagon, let me know what OS’s do you run virtually and how you use them!