How-To: Teach Linux To Do Windows, Part 1

Now is the time for system builders and their clients to learn Linux.

September 29, 2004

19 Min Read
Network Computing logo

Now is the time for system builders and their clients to learn Linux. The best way to learn a new OS is to use it regularly. However, to use Linux regularly, you must either convert all your data files for use with Linux applications where they are available, or find a way to keep the legacy files accessible via access to Windows applications running over Linux. In this Recipe, I will show you how.

You can do this. I started this article in a Windows text editor. I am finishing this article in Linux OpenOffice, after which I will save it back to a Windows Word .doc file for my editor and submit it for publication using my Windows copy of Eudora. The screenshots I took using Linux K-Snapshot were converted to .jpg and edited using Windows PaintShopPro. I am not a hardcore l33t uber-h4xxor, and you don't have to be to be one, either.

This Recipe will tell you what I wish I'd known when I started this process. It will give you information you won't be able to find in online tutorials, forum posts, and vendor docs without doing a lot of research when you need the information right now. If you don't find it here, check the resources I recommend elsewhere in the article.

But you cannot get away with not learning at least the basic Linux commands. These include getting around a directory tree, changing Linux file access permissions and file ownership, etc. I omit this information here because there isn't room and because this has been very well done by others. A copy of Linux for Dummies or a ...For Dummies book more specific to your Linux distribution will also be a good thing to have on hand.

Why Bother?Why convert to Linux, anyway? Three main reasons:

  1. Stability: Linux servers exist that have not needed to be rebooted in several years. Though even a Linux emulation can't solve all of Windows's stability problems, moving to Linux certainly can help.

  2. Relative immunity from malware attacks: Linux is immune to boot sector and file system-related viruses. Almost all malware is Windows platform- or application-specific.

  3. It's the future: Anyone in the commercial white-box business who plans to stay in it must learn Linux before customers require it. We see news of a major organization or government agency switching over from Windows to Linux almost every day. In the past, this has been mainly in the server area. But now, organizations are doing complete conversions including desktops for ordinary users. While most functionality that isn't already will be wrapped in pretty GUIs, you are going to be the one your customers call when the GUIs don't work, i.e. they're going to expect you to know the guts of Linux. There's also going to be an increasing demand for Linux consultants.

Further, the Windows desktop is under attack from all sides. Can Microsoft stand alone against IBM, HP, Oracle, and the rest of the non-MS vendors who are pushing *nix solutions?

For these reasons, any system builder who stays an all-Windows shop is being locked out of an increasing number of workstation seats. Conversely, the white-box system builder who supports Linux will have access to an increasing customer base for which there will be little competition, at least for a while. Also, the white-box builder who knows Linux will also be able to build "appliance" solutions (for example, servers and thin-client desktops) that will be far more difficult for customers to foul up in ways that require the builder to make expensive on-site service calls.

Why You Still Need Access to Windows Apps via Emulation

I think you'll find this list will provide you with the impetus required to move from your original Windows installation to Win4Lin Linux. This really is the best of both worlds.

  1. Not all Linux applications are in place yet, particularly in the graphics and multimedia areas. For example, GIMP (GNU Image Manipulation Program) is an acceptable substitute for Photoshop or PaintShopPro only in the imagination of the Open Source zealots. In fact, they'll tell you it can substitute for Corel Draw, too!

  2. You'll need Windows applications to access your legacy application data files which don't have Linux equivalents which handle those file formats. Also, there are things not completely implemented in Linux yet, such as printer setup / maintenance. You'll probably have to boot to Windows to get to them.

  3. While Linux ports are in progress for many Windows applications, people who stay on the leading edge can't wait for them anymore. We can switch from legacy to Linux applications as they become available.

  4. Incompatibilities still exist between MS Office documents and the most popular Open Office programs. (That said, they are mainly a problem for those who require more complex document-formatting options, macros, etc.)

  5. On a day-to-day basis, I find the biggest advantage of Win4Lin/Linux is the ability to work in Linux when Windows is too busy to accept user input. For example, I can write about a program installation while Windows under Win4Lin is rebooting the computer. Also, Windows is far easier to deal with when it's just another resizable window on a Linux desktop. Especially since I can use Linux tools within files in the Windows environment. Especially since some Linux applications are better then their Windows equivalents. Opera for Linux and the gThumb image viewer are good examples of this. I found myself dreading having to boot to Windows.

Why Use Win4Lin Instead of Free Wine and Popular CodeWeavers?

Because Wine, an Open Source implementation of the Windows API on top of X and Unix, can handle only a very limited number of applications.

Now if those applications are the only ones you need, then either WINE (free/included in all Linux distributions) or its commercial version, CodeWeavers, might be good choices for you. But before you do anything, check the list of supported apps on each site carefully to make sure everything you need is there.Also, Win4Lin comes with unlimited e-mail support. For my support requests during the writing of this Recipe, I generally got a one- to two-day turnaround, including weekends.

Questions To Ask Yourself Before You Start

Before starting to work on your system, make sure you can truthfully answer Yes to all of the following 10 questions:

  1. Are you at least comfortable at the DOS command line? You are probably going to have to do some command-line stuff -- very possibly a lot of it -- to get your setup working. If you aren't, DOS for Dummies is a good place to start with respect to getting comfortable at the command line.

  2. Do you have a current backup image of your current Windows environment, both OS and applications? When you install a new OS on a workstation, one mistake -- or machine error -- and you've blown your data away. This is especially true if you're planning to share the disk with an existing install, which means repartitioning.

  3. Do you know someone with Linux expertise who can bail you out if anything goes wrong? A knowledgeable friend is a good thing to have. Otherwise, google for a local Linux User Group (LUG); there is a good directory of LUGs here.

  4. Do you have a fairly new computer with a minimum speed of 1 GHz? Because you'll be running Windows emulation, you are going to take a mild hit on speed. More important, you need a relatively recent computer to ensure that the video and audio drivers work out of the box. If you are a Linux newbie, you do not want to discover that getting your video to work right requires recompiling the kernel to install a video chipset-specific driver. While anybody can type make install, it takes experience you don't have to know what to do if anything goes seriously wrong.

  5. Do you have an installable copy of Windows 98SE / ME? This Recipe will work with 9.x/ME, but nothing later. That's not as bad as it sounds: Most current Windows applications will still run under 98SE, and only a few expect XP. So 98SE will be what your Windows legacy applications will see when you run them. More specifically, the 98SE OS operates within an idealized virtual computer running as a Linux session. You will see a Linux window open to a Windows session. In that session, multiple applications can run just as they do within "regular" Windows. While Win4Lin will work with any Windows 9.x including ME, I recommend the latest 9.X versions for new installations. Of course, if you have an installable Windows 95 and it runs all the Windows applications you need, have fun and good luck. Make sure you have (or make) a floppy boot disk, you'll need it when you install Win4Lin and if your Linux install blows up in your face, you'll need it to restore your Windows setup.

  6. Do you have a copy of the current Win4Lin Workstation Edition 5.0? It's available at http://www.netraverse.com for a list price of $90. If you're on a dialup connection, save yourself some serious time and buy the shrink-wrapped box version.

  7. Do you have a second HD to install Linux on? It's safer to dual-boot a Windows/Linux installation to separate drives, especially during the transition from Windows to Linux.

  8. Do you have a copy of the Linux command summaries? If not, google on http://www.google.com/search?q=site:ndeepak.info commands. Also, get a copy of the IBM LPI certification tutorials.

  9. Do you have a Linux distribution? See Choosing a Linux Distribution below.

  10. Do you have a mobile rack or other backup system (tape, etc.)? If not, now is a good time to install one. You won't need complex software, just go to PriceWatch.com or google for a "mobile rack" that's compatible with your IDE, SATA, or SCSI drives. The starting price is under $10 for IDE. To install the rack, first put the rack in any of your system's available 5.25-inch drive bays. Next, put the hard drive in the tray. Plug in the connectors. Screw it down. Put the tray cover on. You're done with the hardware. Connecting (mounting - see below) it to a Linux filesystem is covered below.

System Setup

To give you an idea of what you'll need, here's the hardware configuration I tested for this Recipe. You don't need the same gear, but you should have something fairly equivalent.

  • CPU: AMD Duron 900

  • Motherboard: PC Chips 810LR SiS630/730 chip set. This is a last-generation motherboard; it uses 168-pin DRAM, not DDR.

  • Hard Drives: Samsung 40 MB (existing Windows drive), Maxtor Diamond Star Plus 9 160 MB (new Linux drive++ duplicate for backup)

  • Printer: Lexmark Z605 (USB)

  • Scanner: Canon LIDE30 (USB)

And here's the software configuration I used:

  • Linux distribution: Fedora Core 2.

  • Windows emulation environment: Win4Lin.

  • Windows version: Windows 98SE

Where to Find Windows 9.x

The cheapest legal way to do this is borrow a friend's or business install CD, burn a copy, and buy a no-media license, which is basically a official MS license with an unlock code. I strongly recommend you stay legal with this. While the following are packages with CD media included, the no-media licenses are easy enough to find:

When you search for 9.x, most of what you'll find are going to be these licenses. Using Windows ME, OEM, and add to shopping cart as keywords, I turned up:

Microsoft Windows 98 2nd Edition SE 2.0 OEM Full Version Windows 98 - for install on New PC: $91.00 on Trustprice.com.

Microsoft Windows ME Millennium Edition DSP OEM Single Pak: $92.00, also on Trustprice.com.Microsoft Windows 98 SE Second Edition Operating System (Retail CD & Keycode): $56.70 at ComputerSystems2Go.

Microsoft Windows Millennium Edition Compaq OEM CD: $42.88 here.

I've never done business with any of the above vendors personally, so check them out the same way you check out any other online vendor before buying. Also, other keywords might turn up better prices.

Choosing a Linux Distribution

For this Recipe, I used Red Hat Fedora Core 2, which can be considered Red Hat 11. I picked it for three reasons: I had video problems with Red Hat 9 (couldn't get past 800x600); I knew that USB support is improving rapidly in the Linux environment; and I wanted my scanner and printer supported. So I actually looked for something with a more recent version of the Linux kernel, which will be properly supported in Win4Lin shortly after this article appears.As for which distributions you should use, some are available with pre-installed Win4Lin-enabled Linux kernels. FC2 is not one of them, and some of the problems I had when installing Win4Lin is based on my use of a distribution that wasn't prepared in advance to support it.

Distributions with preinstalled Win4Lin kernels include Linspire, Xandros, and Gentoo. Netraverse customer support also mentioned that they've had good experience with Mandrake, too. Check the latest information on supported distributions at the Netraverse site.

I do not recommend Linspire, however, despite its ease of use. Linspire's default setup replicates a major security mistake Microsoft made with its Windows 9.x operating systems: It has the user running as root (equivalent of System Administrator level in Windows 2000/XP/2003) at all times.

Installing Linux

The most important thing you can do to ensure an easy, trouble-free installation is to make absolutely certain that your hardware and peripherals are compatible with the Linux distribution you intend to use.To be sure, check the "hardware compatibility" lists at the Web sites of each distribution. NEVER take the hardware vendor's word for Linux compatibility! The main problem is drivers. The supplied or downloadable Linux driver may be for either a Linux distribution no longer in use or one that is incompatible with yours.

Before you install Linux, note that I recommend the KDE desktop. Its applications appear to be easier to use and more functional than the Gnome desktop. So when your distribution gives you a choice during install, pick KDE. If you're using Red Hat/Fedora, have already installed the Gnome desktop, and would like to change to KDE, view this LinuxQuestions.org page. Otherwise, google or check your Linux distribution's vendor site.

To install Linux:

  1. Obtain a CD/DVD copy of whatever Linux distribution you decide to getshut down your computer, set your BIOS to tell the computer to boot from your CD/DVD drive.

  2. insert Disk 1 of the multi-CD / DVD set which contains the Linux OS and applications, and boot.

  3. Do whatever it tells you to do.

The main thing to remember with respect to installing Linux in a dual-boot setup is this: When you get to the disk formatting/partitioning screen, make sure you tell the computer not to reformat your Windows drive. Other than that, use the default installation parameters except when you know they are not practical for the setup you intend to have. For more information, go to the website maintained by the developers of your distribution and read their installation information. Print it out if you feel the need. Having an experienced Linux user for handholding is a good idea for your first installation attempt.If your video doesn't quite fill the screen, try adjusting the refresh rate using Start > System Tools > Resize & Rotate.

If this completely blows up in your face and you can't boot to your Windows drive, get your 9.x Windows boot disk and run: fdisk /mbr on your C: drive. This will blow off the Linux bootloader and should restore your hard drive to normal access.

The following instructions are for a KDE desktop environment after you have successfully installing Linux and enabled KDE.

  1. Go to Start > System Tools > Terminal. Click-drag the icon onto the desktop.

  2. After getting your Linux setup successfully installed install a copy of Adobe Acrobat for Linux. (You will be doing a lot of copying and pasting from PDF documentation, since this is the easiest way to make sure that you're entering an unfamiliar command correctly. The standard Open Source PDF applications don't support copy/paste operations. Look up how to install rpm files (a special type of application file archive intended for installation purposes) in the Linux commands document referred to earlier for how.

  3. Get a text editor that works from the command line. While there are those who swear by vi, I use a much easier application called nano. It's a lot like the BBS text editors for writing message posts/e-mail; there's no GUI, just a couple of rows of control-letter commands. Nano is part of most Linux distributions.

The following tells nano to open a file in the nano text editor:

Enter: nano filenameTo mount (make accessible to the Linux OS) your Windows drive:

cd /mnt/

mkdir directoryname

Choose a directory name for your Windows drive, it will look like a directory in Linux -- mkdir works just like it does in DOS.

nano /etc/fstabfstab is the file that tells Linux which drives are installed and what kinds of filesystems they used, in the example below, Linux is being told that the windows drive is connected to the primary channel of the primary drive controller.

hda - primary drive controller, master channel (usually = C: in Windows)

hdb -primary drive controller, slave channel

hdc -secondary drive controller, master channel

hdd -secondary drive controller, slave channelAdd the following:

/dev/hda1 /mnt/directoryname vfat defaults 0 0

Substitute the directory name you chose for your Windows drive for directoryname.

USB Scanners

My USB scanner, a Canon LIDE30, was recognized immediately by the SANE (equivalent to TWAIN in Windows) scanner access applicaton. Unfortunately, the only way I could access it via the xsane SANE scanner front end was by opening a "super user" session via terminal and entering xsane at the command line, as shown in the screen shot below.

If you have a USB scanner that won't work with the regular Linux GUI scanner interfaces, try this (su makes you a superuser with admin privileges):

[alizard@terrarium alizard]$ su

Password:

[root@terrarium alizard]# xsaneWhen you see the xsane warning, click "Continue at your own risk." It's a known bug, which you can learn about on this Red Hat Bugzilla page.

If this is your problem, set up a Web alert from Google's beta section on any "known bug" that you find that doesn't already have a fix you can apply.

USB scanners are not supported yet by Win4Lin. The workaround is to first access the scanners from Linux, then put the file somewhere within the /win directory space that Win4Lin can find, unless you have a graphics application in Linux you plan to process the file with. However, this isn't a current concern for you, all you're trying to do is make sure your scanner works before installing Win4Lin.

Printers

If all goes well, you will simply be able to select your printer from a printer configuration menu and start printing immediately. But if your printer won't print, don't panic. First make sure the printer is turned on. Some printers don't automatically get turned on by the software on boot.I spent three days installing my USB Lexmark Z605 Colorprinter after finding that downloading and installing the installation RPM (rpm is an applications installation/upgrade file format) file didn't work. During that time, I did online research and tried different options suggested by various posters. I won't go into the details here, mainly because they'd be useful only to a handful of people. But I can recommend that you find a printer on the "approved" list for the Linux distribution you ultimately pick. Epson, for one, has a good reputation for Linux compatibility.

Dealing With Files

First, everything on a Linux system is in a single filesystem. The root directory is /. All other directories, including that of separate and network drives mounted on the Linux filesystem, are subdirectories under the root directory.

Never use a space in a Linux filename. Instead, use an underscore or a dash to separate words. Here are some examples of good and bad Linux filenames:

BAD: filename oneGOOD: filename_two

GOOD: filename-three

Do this when working in Windows, as well. Otherwise, working with files you've created will become much more difficult.

When working with files in the Linux command line, you may need to select a legacy file with a filename in it. In that case, use the ? wildcard character: filename?one. It works.

For test purposes, make a directory to put files you'd like to experiment with some of your files withcd /home/username

mkdir test

The file managers that come with the FC2 distribution don't work well when dealing with large numbers of files, like the 120,000++files that copying my Windows working environment to Win4Lin required. For this task, you are better off using the command line instructions.

However, you are also better off waiting to move your Windows drive working files until after you have installed Win4Lin/Windows. When you move to your new environment, you will want access to the latest versions of all your files, particularly mailboxes/folders. Once your Windows drive is mounted, you can experiment with Linux applications by copying them into your Linux /home/username directory by:

cd /path/filenamewith path being

/mnt/windows/[directories between windows and]/filename

For example:

/mnt/windows/My?Documents/shoppinglist-2-20-1997.doc

andcp filename /home/username/directory/

You should now have your Linux distribution up and running, so this ends Part One of this two-part Recipe. Next week, in Part Two I'll show you how to install Win4Lin, install Windows applications under Win4Lin, and handle backups.

Sidebar: Where To Go If You Run Into Trouble

  • Check the vendor site first. The answer may already be in a searchable KnowledgeBase, FAQ, or other documentation on the site.

  • Google is your friend.

  • There is much useful documentation available at the Linux Documentation Project. Also check out About.com.

  • Post questions in places like Linux Questions, The Fedora Forum (if you use Fedora Core), or Usenet groups like news://comp.os.linux or subgroups. There are many Linux Web forums and vendor-specific mailing lists. Google can help you find them, too.

  • Ask a knowledgeable friend or local Linux User Group (LUG). There's a list of LUGs here.

  • If you bought a distribution or application that includes support, call the vendor.

  • Check vendor and open-source developer sites for user and developer forums. Your question may have already been answered. If not, post a new question.

  • Visit TechBuilder's Recipe Forum, and post a question for your fellow system builders.

This is Part One of a two-part Recipe. Part Two can be viewed here.

A. LIZARD is an Internet consultant in the San Francisco Bay Area who has written for technology magazines and Web sites since 1987. He wishes to thank Maxtor and Netraverse for contributing a pair of hard drives and a review copy of Win4Lin, respectively, for use in this Recipe.

Discuss this Recipe with other system builders in the TechBuilder Recipe Forum.

0

Read more about:

2004
SUBSCRIBE TO OUR NEWSLETTER
Stay informed! Sign up to get expert advice and insight delivered direct to your inbox
More Insights