...making Linux just a little more fun!

<-- prev | next -->

Leaning Out of Windows

By Tom Brown

This is a follow-up to my earlier article, "I Don't Think We're in Redmond Anymore, Toto" (Issue #97, December 2003), in which I described my introduction to, and first impressions of, Linux. In this article, I wanted to give you my further impressions and experiences, so you have some idea what it's been like to go full-time (more or less) from Windows to Linux. In the process, I hope to pass on some helpful tips. Hopefully, you who follow in my footsteps can avoid stepping in some of the doggy-doo that I faced (faced? now there's a mental picture I could have done without).

Choosing a Linux Distro

The first thing you need to do after deciding to give Linux a try is choose a distro. There are a lot of them out there, with different features and benefits to each one. I myself started out with Mandrake, and was happy with it until I raised my computer's memory to 1GB, at which point the default version of Mandrake refused to run. Unwilling to play around with it, I changed over to Red Hat 8 (and subsequently upgraded to Red Hat 9). My main reason for choosing Red Hat was the large number of companies that used it. In time, I'd like to make a living using Linux, so it seemed like a natural choice. In my opinion, RHL9 wasn't as easy to use as Mandrake, but it worked well enough.

One day, I received the "end of life" email from Red Hat, which gave me the choice of upgrading to their Enterprise version, Red Hat Enterprise Linux, or switching to the "hobbyist" version, Fedora Core (I refuse to call it "Fedora", since that name has been in use since 1998 by Cornell University and the University of Virginia for a different project). Suddenly, I was back to choosing a Linux distro again. The one choice from Red Hat was too expensive, and the other looked like a permanent beta version to me (sorry guys, I know some of you disagree). I decided to look at other distros, and finally settled on SuSE 9 Professional.

In the course of this article, I'll mention some of the features in SuSE that attracted me to it, and which have made my life easier. Everyone has their favorite distro, of course, so before you jump into the Linux universe, talk to others about which distro they're using and why. Even if you're just playing around with Linux, you'll be a lot happier if you do your homework first.

Installation

Most Linux distributions are simple and straightforward to install (some don't even need installing, but run right from the CD). As long as the distro's new enough to recognize your equipment (or your equipment is old enough), installation's a snap.

At this point in your exploration of Linux, your biggest problem is going to be hardware support. I already mentioned that Mandrake didn't support my 1GB of memory. Neither Mandrake nor Red Hat recognized my Promise Raid controller (Red Hat saw it as two separate disk drives, and wanted to "fix" them for me). Red Hat also had problems using my LCD monitor. You may have to make some decisions here: do you want to stick with the distro you selected, or do you want to use that one piece of hardware? Someone that knows a good bit about Linux can probably fix what's wrong, but if that someone isn't you, you'll have to choose. When I discovered that SuSE supported all my hardware, my choice was made.

Getting It Just Right

For many, once Linux is installed, that's the end of it. Time now to start playing with it. But what if you need to change something? Perhaps you want to share a directory with a Windows machine on your local network, change the settings of the firewall, or use that 15-year-old laser printer that's sitting in the attic collecting dust.

These tasks, and others, aren't as simple as you might think from your experience with Windows, but they're not impossible, either. Different distros may have their own custom tools to make these jobs easier, but many times, it comes down to manually editing a configuration text file.

There are a lot of good text editors to help you here. Some are character-mode DOS-like applications(e.g., vim, emacs, joe, jstar), while others are Windows-like GUI apps (e.g., kvim, xemacs, Kwrite, Kate, Gedit), so use the one you're most comfortable with. In any case, you'll find the configuration files off the root directory under /etc. Now, you're going to need help understanding these files, which means searching the web for "HOWTO" docs for the job you're trying to do (e.g., "Samba-HOWTO-Collection.pdf").

[ Some distributions have a collection of HOWTOs available as an installable package, or you can simply search the Net for "<keyword> HOWTO". - Editor ]

This is one of the places where SuSE attracted my attention. SuSE has a tool called "Yast2" (for "Yet Another Setup Tool"), which eliminates most of the work configuring both hardware and services. Most Yast screens have a separately-scrolling help panel on the left side, describing the fields to be configured on the right side panel. This help usually supplies you with enough information about the fields to make the correct entries. Each of the system changes I mentioned above (Windows share, firewall, printer setup) are a snap using Yast2. When you click the "Finish" button, Yast2 does whatever is necessary to make your change effective, including restarting services (otherwise, you'd have to go to the command line, and do it yourself). Someone comfortable with Linux, the command line, and the /etc directory, would want to do most of this manually. For someone from the Windows universe, however, a tool such as Yast2 makes Linux a lot less intimidating. This doesn't completely eliminate editing /etc files, but it handles most jobs.

Other distros have their own methods of making configuring your system easier. Red Hat, for example, uses a lot of little programs, instead of the one monolithic one used by SuSE. As I said above, ask people what distro they use, and how this sort of feature works there. I can only tell you from my own experience. I like Yast2, and it (along with the distro's default use of KDE instead of Gnome) are what sold me on it. YMMV.

Disaster Recovery

Even the experts make mistakes. Those of us still near the beginning of the Linux learning curve make a lot of them, so prepare for the worst. Once you have your system set just the way you want it, perform a backup of two things: the /etc directory (that's where all your carefully-crafted system settings are stored), and the contents of your home directory. One important tip here (from personal experience): if you're using drag-and-drop to copy the files somewhere, make sure you tell the file manager to show hidden files (in KDE, it's under the View menu) first. Files that begin with a period are hidden from the GUI file manager by default, and that's where your personal settings are stored. If they're not visible, they're not going to get copied. You've been warned.

Another note on the SuSE 9 distro. The install CD (and the DVD) has a GUI-based system repair tool. One of the things it will repair is the boot process (e.g., if a Windows re-install overwrites the Grub boot sector), but it checks for, and fixes, a load of potential problems as well. It's saved me on more than one occasion.

My Security Rant

OK, I'm gonna get on my soap box with this one. There has been a lot of talk in the press about viruses, trojans, and worms (oh, my!) attacking Windows. A lot of you may be thinking about moving to Linux to avoid all of that. Some say that the reason Windows gets attacked and Linux doesn't is that Windows has a lot more users.

As Sherman Potter of the 4077th would say, "Horse hockey"! Windows, IMHO, is inherently insecure, mainly due to design decisions that go to the heart of the operating system. This cannot be corrected without fundamental changes to Windows, which no doubt would break nearly all existing applications. Applications and system services are integrated to operate together on a very low level. In many cases, they have to be in order to work. Notice the recent Microsoft announcement that XP Service Pack 2 will break some applications because of its security enhancements. When a flaw surfaces in one Windows application or service, it can seriously impact the entire system. This is like having repeated unprotected group sex with complete strangers (I think that's another mental image I didn't need). This goes beyond the question of allowing Outlook to execute code inside an email. The modular structure of Linux discourages this sort of behavior, helping to keep programs from interacting in ways they shouldn't.

If you want to secure your Linux installation against attack, I have a few suggestions. Home users don't need to run an antivirus in Linux if they follow a few precautions. First, don't run a web or ftp server that's visible outside your private network. Second, keep your computer behind a router (which is also the easiest way to share a cable or DSL modem between two machines). Third, if you're connecting to the Internet via WI-FI, enable the strongest protection you have (WEP, WPA, etc.), and make sure your Access Point will only connect with the MAC addresses of your own machines, so strangers can't come in. Fourth, don't run any script or program from a source you can't trust. Note that Windows programs won't run in Linux (unless you run them in Wine), so they're not a problem. Finally, don't poke unnecessary holes in your firewall. It's like leaving the windows open (if you'll excuse the expression) in a parked car. If you don't see a problem leaving your car windows open all night, then it's obvious you've never been to my old neighborhood.

Installing More Programs

At some point, you'll want to install programs that didn't come with your Linux distro. After hardware configuration, this is the most difficult part of Linux to adjust to for the Windows user. Some distributions, such as Mandrake, Red Hat, and SuSE, use "RPM packages", a format originally designed by Red Hat. Many of these packages can be used on any Linux that accepts RPM files, but there are a few that may be specific to one distro or another. Many packages that can be used in any Linux are marked as specific to Red Hat, so you may have to look around, or ask someone, to find out if it will work with your distro. You could just try it, of course, if you're feeling lucky (for a moment there, I thought I heard Clint Eastwood). These packages are installed using the command line, and a program called "rpm". A good tip for using the "rpm" command (which I mentioned before) is to always use the "-v", or verbose option. This will give you a better idea what went wrong.

RPM packages can suffer from a dependency problem. For example, if a package needs version 2.3 of a particular library to work, and you only have 2.0 on your machine, that's a dependency problem. This hasn't happened to me lately, but I've been keeping my system up-to-date (Yast2 can automatically check for, and apply, updates), so perhaps that's the key to success.

While I've never worked with it, I understand that Debian has something called "Advanced Package Tool", or APT, that solves the dependency issue. But, as I said, I've never used Debian, so can't tell you how well APT works. People I've talked to swear by it, however, and would never use anything else.

It doesn't solve dependencies, but the Yast2 tool in SuSE automatically opens when you double-click the icon of an RPM package. The tool allows you to see a description of the package, and a list of the files in it (including the complete file path of each). You install the package with the click of a button. Yast2 isn't perfect. I've experienced problems with installing a few packages, and was forced to use the "rpm" command from a shell, but this didn't happen very often. All in all, SuSE makes installing RPM programs a lot easier than using "rpm" by itself.

Another method you'll see for installing programs is the use of a shell script (usually with the file extension ".run"). The ones I've looked at have what appears to be random characters at the end. This is normal, and constitutes the material to be installed. You just run the script to install the program. As with all shell scripts, if you can't run it, check its permissions (in KDE, you'll find it in the Permissions tab of the icon's Properties dialog) to see if the file can be executed. Unlike Windows, Linux won't run any script or program file that doesn't have the "execute" bit set.

Finally, we have an installation method that is both better and worse than the others. You download a "tarball" containing source code, then compile and install it. A tarball is a archive file, usually compressed with "gzip", with the extension ".tar.gz" (or sometimes just ".tgz"), which you have to unpack into a directory before you can do anything with it. From a command line, you can type the following to do so:

tom@MYMACHINE:~/temp> tar xvzf programname.tar.gz

If you're using KDE's file manager, there's another way: right-click on the tarball's icon, and select "extract here", "extract" or "extract to". The first menu option uses the program "Ark", while the other two use the program "Karchiver". If your familiar with using a flavor of "zip" on Windows, you know that not everyone creates an archive so that the contents extract into their own directory. This can make as much of a mess in Linux as it does in Windows, so always unpack the tarball in an empty directory, where it won't make a mess.

Once you've unpacked the tarball, you're ready to compile and install. Don't be scared of this, even if you've never done any programming. All you have to do is type three separate commands into a shell:

tom@MYMACHINE:~/temp/expanded_tarball_dir> ./configure
tom@MYMACHINE:~/temp/expanded_tarball_dir> make
tom@MYMACHINE:~/temp/expanded_tarball_dir> make install

When this works, which is most of the time, it's great. I've occasionally had trouble with it, however. Sometimes, it's a matter of running some (or all) of the commands as root. Sometimes, the tarball is missing a file. Other times, it fails because it can't find the source it needs from elsewhere in your system. The benefit of this installation method is that the resulting binaries are built specifically for your system. You do, however, need to have the proper compilers installed.

If you run into any problems, or see error messages you don't understand, just step back, take a deep breath, and check out Ben Okopnik's excellent Linux Gazette article "Installing Software From Source", from Issue #74. It goes into a lot more detail about this, and is a good starting point for tracking down your problem and fixing it.

Running Windows Programs in Linux

You can run some windows programs in Linux. Not all of them, but a few of the key ones can be used if you know how. "How" is through a program called Wine (which stands for "Wine Is Not an Emulator"). The best way to use Wine is to make a copy of a real Windows directory (I use an old installation of Windows 98), and have Wine use it as part of a "fake c drive". You install programs into this fake drive by inserting the appropriate installation CD (for example, a Microsoft Office CD), and entering a shell command such as:

tom@MYMACHINE:~> wine /media/cdrom/setup.exe

You'll see the familiar Windows installation screens. Not every program will work, however. For example, I haven't gotten Visio 2000 (the one from Visio Corp, not Microsoft) to install yet. Once a program is installed, you run it using a shell command such as the following.

tom@MYMACHINE:~> wine "/c/Program Files/Microsoft Office/Office/winword.exe"

I believe the most compatible version of Microsoft Office is 97. Later versions may not work completely. Where possible, though, you should avoid using Windows programs in Linux, since many programs work best when working with their native operating system. There are a lot of open source Linux programs out there, and you should check them out before falling back on a Windows app. Besides, your goal is to migrate away from Windows, right?

The Open Office Word Processor

OK, I confess! The only part of Microsoft Office I really use is Word. I've mostly had good luck using the Open Office word processor, but I've had a few problems when loading a Word document, editing it, then saving changes out to the same file. Most of those problems dealt with tables, and resulted in a scrambled page when viewed in Word. The same page would look just fine in Open Office.

My advice when editing word documents is to double-check the document's appearance in Word itself if the document has complex formatting (i.e., is not a straight-forward bit of text). The version of Open Office I used was 1.1, and this sort of problem may be corrected in newer versions. I fixed the document mentioned above by re-creating the table format from scratch in Open Office, then copying the text from the original document.

Similar to using Wine, I recommend sticking with the native format in Open Office, and only save the document in Word format when you're ready to give it to someone.

Games

I still end up playing video games in Windows, rather than Linux. Mostly, it's because there aren't a lot of new games released for Linux. And, while some older games will work under Wine (e.g., Jedi Knight Outcast), not all of them will. A common problem I've seen is that a game will install under Wine, but when you go to run it, it complains that you're running a debugger. It tells you to exit the debugger and try again. This is a copy protection mechanism, and I don't know if there's a work-around for it.

Another problem I've seen in Wine is with games that come on two CD's. Midway through the install, it tells you to change disks. Sometimes you can, and sometimes you can't.

Then you get a game such as Unreal Tournament 2004. It's available natively for Linux (no Wine needed), and runs beautifully. Besides being a fabulous game, it looks great under Linux, and runs fast, even with all the eye candy turned on (I have an nVidia Gforce 4 card with the nVidia 3D driver). Disclaimer: to date, I've only been able to play the demo.

Some manufacturers give you a Linux engine for their games, but you have to supply the rest of it yourself (e.g., levels). An example of this is Serious Sam First and Second Encounters. You download an installer for free, which asks you to insert the original game CD. While both of these particular games work OK, they don't recognize all of the mouse buttons (Logitech's two thumb buttons in particular). In contrast, Return to Castle Wolfenstein works perfectly, mouse buttons and all. If you already have the Windows version of one of these types of games, download the Linux installer and try it.

Don't ignore the games that come free with Linux, however. My favorites are Frozen-Bubble (simple, and very addictive) and Armagetron (a 3D version of the Light Cycles in the movie Tron).

Ripping and Burning CD's

So you just bought a new audio CD, and want to convert the songs on it to MP3 or Ogg Vorbis format then burn a CD for use in your portable player. This can get complicated for the Windows user. In Linux, you're often dealing with a lot of separate programs for this, instead of a do-it-all program like MusicMatch or iTunes. Some of these programs are actually command-line driven, with a separate program to serve as a GUI shell.

You're going to need a program to convert from the audio CD's ".wav" format to MP3 or Ogg. When dealing with MP3, the most common conversion program is called "Lame" (there are others). Once you have a copy of Lame (or whatever), you just plug it into the program you're using to "rip" the CD (e.g., "Grip").

You can use the command line programs alone for burning CD's, but you don't have to. There are several GUI alternatives out there, such as K3B and cdbakeoven (I lean more towards cdbakeoven). I haven't tried burning a DVD in Linux yet, so I can't tell you whether, and how well, these two programs work for DVDs.

Network Sharing

One of the things I wanted to do was take an old 750 MHZ computer, and turn it into a file server for both Linux and Windows clients. Yast2 made quick work of setting up both Samba (Windows sharing) and NFS (native Linux/Unix sharing). If you're not using SuSE, you can use the Samba browser tool, or just write both configuration files (Samba and NFS) by hand with a text editor. Find and read the HOWTO documents, and follow the examples. I had only one problem with my installation: I was using my router for DHCP (in which each computer in the network gets its IP address from the router), but couldn't fetch the IP address of the other network computers from the router. I ended up giving each computer a fixed IP address. Not pretty, but it works.

Getting Rid of Internet Ads

Internet ads pay for the web site you're viewing, and are generally a fair trade-off for the information you're getting. Some ads, however, are so distracting and annoying that you just want to turn them off, particularly the animated ones. In Windows, I use Norton Internet Security to remove ads from the browser. Since there is no Linux tool (that I know of) to do the same, I had to find a few work-arounds, which I'll now pass on to you. I use Mozilla 1.6 as my web browser.

First, using Mozilla, go to "Privacy and Security" in the Preferences dialog, and checkmark "Block unrequested popup windows". You have now stopped unwanted popup windows from appearing in Mozilla.

There are two ways to block regular ads. The first is to put the URL of the ad site in your "hosts" file, referencing it to the same IP address as the Localhost:

127.0.0.0   ads.fictitious.net

This will work with any browser. The second, again in Mozilla, is to right-click on the ad (most of them will be a picture, not text), and select "Block Images From This Server" from the resulting popup menu. Using these two methods, you can block some ad servers, while allowing the rest.

Finally, we have those annoying Flash ads. If you use Mozilla's new Firefox browser, you can add a plugin (see the Properties dialog) which replaces all Flash ads with a link that says something like "Click to play". The ad won't appear now unless you tell it to.

Playing Windows Media Video in Linux

There are codecs available that allow you to play back at least some ".wmv" video files in Linux. Once a matching codec is installed (I use version 5.2-1 of "w32codec"), it's easy to configure something like xine to play the video.

The Bottom Line

Generally, I've been very happy with my migration to Linux. I haven't solved all my problems yet, but I'm making good progress. In fact, I'm down to two minor issues, too small to really worry about for the moment. I'll mention them briefly, to give you some idea of what's left in my to-do list.

Sound. I'd like to get 5.1 surround sound to work on my Creative Labs Live sound card when playing a movie in Xine.

Printing. I have a 15 year old postscript printer that only prints in Linux using Laserjet emulation. Postscript works fine in Windows, but not in Linux, no matter what page descriptor file I use. I'm too cheap to buy a new printer, and besides, I'm still on the original toner cartridge. It should be good for at least another 15 years.

Finally...

The Windows Defector series is intended to educate and encourage people who are contemplating the switch from Windows to Linux (including me), so if you have any corrections, suggestions or solutions, please share them with everyone by sending a copy of your email to The Linux Gazette Answer Gang, rather than just to me. Flames and brickbats, however, you can continue to send just to me, as I don't want to clog-up the mailing list with all that extra volume. :-) .

 


[BIO] Tom has been a software developer since the early days of the Commodore 64, with such commercial classics as Prototerm-64 and Colorez-128, and has seen lots of operating systems come and go. Every one he's liked is either discontinued (OS/2) or out of business (Commodore Amiga). He currently likes Red Hat Linux, which won't be supported after April '04. As a result, we've been trying to get him to fall in love with Windows, but so far no luck.

Copyright © 2004, Tom Brown. Released under the Open Publication license unless otherwise noted in the body of the article. Linux Gazette is not produced, sponsored, or endorsed by its prior host, SSC, Inc.

Published in Issue 101 of Linux Gazette, April 2004

<-- prev | next -->
Tux