Linux – Ready To Use
The article first appeared in Tom’s Hard News email newsletter. To subscribe, go here.
You may have heard of Linux. You may have even been thinking of giving it a try. And exactly what is this “LIH-nuks” I am talking about, anyway?
Flash back to 1991. Right around the time Microsoft was preparing to release Windows 3.1, Linus Torvalds began writing a unix-like operating system to run on his PC. Today, what we call “Linux” is actually a synthesis of Linus Torvald’s kernel and tools from the Free Software Foundation (such as the GNU compiler). Linux usually comes with the choice of two graphical user interfaces, KDE and GNOME, both of which are now fairly mature. Linux is packaged and distributed by several companies and not-for-profit groups, “called “the distributions.” The most popular distributions include Red Hat, Debian, SuSE, Mandrake, and Caldera. Even today, the Linux kernel is continually under development. If you want to, you can get the latest kernel source from kernel.org and compile it yourself, but for the rest of us mere mortals, there are the distributions.
One Problem – Lack Of Applications
As an operating system, Linux is ready to use. The main problems for Linux continue to be the lack of applications and driver support. In this article and the ones that follow, I will be looking into some solutions to the first problem, the current lack of applications; however, the driver issue deserves a brief comment.
If you are thinking of trying Linux, you should be aware that Linux does not support all PC hardware. Although some companies recognize Linux and provide driver support, others do not. The level of support depends on your hardware vendor. As demonstrated here, Nvidia is already producing high quality drivers for Linux, but if you have specialty hardware, you may find that it is not supported. Thanks to the efforts of the Linux community, much of the popular PC hardware is now supported. However, it is probably a good idea to check the hardware compatibility list for your distribution. For example, Red Hat has a database of supported hardware for their latest distribution at hardware.redhat.com. If you are thinking of buying a computer to run Linux, you might want to go with one of the several PC vendors who sell computers with Linux pre-installed. On the other hand, if you want to find out if Linux will run on your current hardware, I suggest you just download the free ISO images for your distribution of choice and give it a try.
While anyone should be able to get Linux running on a PC, the lack of popular office productivity software continues to keep Linux from reaching the desktop. Until there is a perceived market for Linux, software companies will not port their popular applications, but until popular applications are available, the average user cannot run Linux. In order to solve this chicken-and-egg problem, there is an ongoing effort in the Linux community to create these applications. Open source projects such as OpenOffice.org and KOffice have come a long way toward usability, but these projects and other like them are still “beta.” Currently, no office suites for Linux are as stable and full-featured as their Windows counterparts.
One way you can run the most popular applications under Linux is by using a migration tool. With a migration tool, you could, for instance, create a graphic in The Gimp and import it into a PowerPoint presentation, all at acceptable levels of performance and without ever having to reboot. In this article, I will describe an emulator called Win4Lin that allows you to run Windows applications under Linux, but first, I would like to take a slight detour and look at early attempts at Windows-to-Linux migration.
Enter The Dual Boot
Since the early days of Linux, it has been possible to install Linux in a dual boot configuration. In a dual boot, you can have either two hard disks (one for each operating system) or two partitions on a single disk. During the boot sequence, LILO (the Linux loader) asks you which OS to launch, and after that it is pretty much business as usual.
With a dual boot, you can stand in both worlds. You may have some applications in Windows you need to use, and with a dual boot, you do not have to give them up. You also gain access to all the free software available for Linux. Those of us who are running Linux remember when there were certain things we knew how to do in Windows, but just could not figure out how to do in Linux. The dual boot gives you a chance to “have a break” from Linux when you need one. You are free to give Linux a try and, if things don’t work out, you can go back to using Windows full-time. I suggest the dual boot for all new Linux users.
There are some disadvantages to the dual boot. Imagine you would like to edit a graphics file in The Gimp and then import the same file into a PowerPoint presentation. One problem with the dual boot is that, since Windows and Linux do not share a single file structure, you have to install them in different partitions. This also means that you will have to maintain two separate file systems for both applications and documents. When you need to use a document in Windows that was created in Linux, you have to copy the file from the Linux partition to the Windows partition. The other problem is that every time you switch from Linux to Windows, you have to reboot the machine! What if, when you load the graphic into PowerPoint, you find there is a mistake? You will have to reboot the machine twice just to make the changes – not exactly an ideal user experience!
While this is certainly a problem for office apps, it is not as bad for games. The reason is that, when you play a game, it is usually the only application you are running, and you might be using the computer the same way for several hours.
Here Come The Emulators
Traditionally, an emulator is software that translates programs written to run on one instruction set so they can run on another one. The classic example is Apple Computer’s migration of the MacOS from the 68k architecture to the PowerPC. It turned out to be easier to port the only critical parts of the operating system and use an emulator for the rest. In general, emulators tend to degrade performance because it takes time to do the translation.
There are two popular emulators available that allow you to run Windows inside of Linux: VMware and Win4Lin. As with any emulator, you should not expect full performance, but it is important to remember that these emulators are not translating any instructions since both Windows and Linux running on a PC use the same x86 instruction set. What Windows emulators do is create a “virtual PC” that you can use to install a genuine copy of Windows. (Of course, this means that you have to own a copy of Windows to use either of these products.)
Vmware takes a more complete approach that allows you to install several operating systems into what are called “virtual machines.” Using VMware, you can run Linux applications inside Windows or you can run Windows applications inside Linux, and the same is possible for other operating systems. Win4Lin, from NeTraverse, was designed from the ground up for a different purpose: to enable Linux users to run Windows applications.
Win4Lin
Win4Lin has several advantages over VMware. First of all, Win4Lin has a much smaller memory requirement. With VMware, I was unable to get decent performance with less than 128 MB of RAM, but Win4Lin works fine in a computer with only 64 MB. The second advantage is that Win4Lin allows you to use a single file system for both Windows and Linux. With VMware you still need to use two separate file systems, just as in the dual boot, but with Win4Lin, the Linux file system is used for both operating systems.
Win4Lin supports the latest versions of Red Hat, Caldera, SuSE, and Mandrake, but you may have a wait a few weeks when a distribution releases a new version. You should also be able to use Win4Lin with the “official” Linux kernel at kernel.org. If you go this route, you will also need to get the kernel patch, which can be downloaded for free from NeTraverse.
The download version of Win4Lin is $79.99 and the CD boxset is $89.99. If you purchase a license over the web, NeTraverse will email it to you.
The Bad News
Of course, Win4Lin is not a complete replacement for Windows. Unlike VMware, you can only install Windows 95 or 98. This is not really a limitation if you are only interested in running Windows applications since most applications should work in Windows 98.
Win4Lin also has no support for DirectX, which means you’ll still need to keep that dual boot around if you want to play games. There is also no support for “TCP/IP networking.” This is not as bad as it sounds, because many Windows applications (such as Internet Explorer) actually use a networking protocol called WinSock, which is supported by Win4Lin.
Stage 1
Win4Lin may be downloaded directly from the NeTraverse web site, or is available as a boxset from
LinuxCentral. I am going to describe how to install Win4Lin on Red Hat Linux 7.1 using the download version.
First, login at the NeTraverse web site. If this your first time, you will need to create a new account. Select “Win4Lin Desktop 3.0 – Download Installer” and download netraverse_installer.tgz. You will need GNU tar for the next step. To find out if you have it, you can type
rpm -qa | grep tar
On my Linux machine, it says
tar-1.13.19-4
Now unpack the installer.
tar xvzf netraverse_installer.tgz
If you are downloading the software directly from NeTraverse, you will have to buy a license before going any further. You can do this on the web site.
Next, become the root user, change to the unpacked directory, and run the installer.
su
cd netraverse_installer
./win4lin-install
Win4Lin has a fully graphical installer. If you have ever used InstallShield in Windows, you should feel right at home. The next screen is the license agreement, followed by a registration form, and another form which asks for the license key. Next, the installer will do a check on your system to find out what version of Linux you are running.
At this point, it will ask you to download the Win4Lin-enabled kernel and the Win4Lin software. After it is finished, you will have to reboot.
Be sure to select the “win4lin” option in LILO when you reboot. You need to be running the Win4Lin-enabled kernel in order to use Win4Lin.
Stage 2
Stage two of the installation must also be done as the root user.
su
cd netraverse_installer
./win4lin-install
The installer will ask you where your CD-ROM is. You should be able to use the default setting. I am using Windows 98SE.
The installer will then copy the Windows system files.
Stage 3
The last part of the installation must be done by the user who will be running Win4Lin. Run the installer (but not as root).
cd netraverse_installer
./win4lin-install
Win4Lin will ask you which kind of networking you would like to use. You can choose either WinSock or VNET.
Most applications will work fine with WinSock. However, if you need to use the network neighborhood, you should choose VNET. Be advised that VNET requires you to have a separate IP address that is different from the one Linux is using, but WinSock can share the IP address you already have. For now, just choose WinSock. You can switch to VNET later if you like.
Make sure your Windows CD is in the drive, and proceed with the rest of the installation.
Using Win4Lin
To begin a session of Windows, open a terminal window and type
win
With Win4Lin, it is easy to use Linux applications and their Windows counterparts side by side. Here is a screenshot of Internet Explorer using WinSock networking:
Here is one for CorelDRAW:
This one shows Front Page from Office 2000 running in a window next to the Mozilla browser, running in Linux:
One File System
Win4Lin allows you to keep all your documents in one place because it does not require you to use a separate file system for Windows. There is no need to copy files back and forth when using Linux and Windows applications to edit the same document. Since Win4Lin uses caching to improve performance, it is a good idea to keep your documents somewhere other than the C drive. You can create a new D drive linked to your Linux home directory. To change your Win4Lin configuration, type
winsetup
From the menu, choose “personal session configuration: win.”
Next, click the “drives and filesystems” tab. To add a new drive, click “add,” select the drive letter, and enter $HOME for the directory.
Now you can access the files in your Linux home directory from inside Windows.
Printing From Windows
Win4Lin allows you to print from your Windows applications by redirecting the output to the Linux print spooler. This means that you can even connect to a network printer that is using TCP/IP, such as HP JetDirect, because, in this case, the networking is done by the Linux print spooler.
To configure printing in Win4Lin, just enter the Linux print command under “system-wide administration.” I just use “lpr.” If you want to use multiple printers from Windows, you will have to create a new device. If you are running winsetup as the root user, you can do this by clicking “new” and typing a name for the new device. You can now specify a separate Linux print command for the new printer. Don’t forget to add the printer from Windows.
Resizing The Display
Win4Lin allows you to change the screen resolution available to Windows. To access the display controls, run “winsetup,” and choose “personal session configuration:win.”
Click the “display” tab.
I prefer to resize my Windows display so it fills the entire screen except for the KDE taskbar at the bottom. This allows me to have Linux applications running on the other virtual desktops, and I can easily switch between Windows and Linux using the KDE taskbar. In my case, this means I need a Windows screen resolution of 1017×710. Fortunately, Win4Lin allows you to change the screen size by as little as a single pixel.
Here is Windows using the resized display. Word 2000 is running in Win4Lin next to the StarOffice 6.0 beta, running in Linux.
Of course, just showing that the applications work is not enough; they also must be fast enough to use. Let’s take a look at the performance for some popular Windows applications running in Win4Lin.
Test Setup
In these tests, I wanted to see how Win4Lin compared to a normal installation of Windows 98SE when running office applications. I installed Red Hat Linux 7.1 and Win4Lin 3.0 with Windows 98SE running inside Win4Lin. This was compared to a normal installation of Windows 98SE that was not running inside an emulator. Each OS was installed on one of two identical 7200 RPM Seagate Barracuda drives. All tests were run on a 2 GHz Pentium 4 with 256 MB of PC800 RDRAM and a Leadtek WinFast GeForce3. Win4Lin was allocated 64 MB of memory for the tests.
I should mention that I encountered some problems trying to run the benchmarks. I really wanted to use Sysmark 2001, but since Win4Lin does not support DirectX, and Sysmark 2001 refuses to install without DirectX, I had to use the slightly older Sysmark 2000. For Sysmark 2000, I was not able to get “official scores” because Adobe Premeire (which is used in the content creation suite) claims to only run on a “Pentium-class” processor. Even though I was running the benchmark on a Pentium 4, Win4Lin identifies the processor as a Cyrix 486 (presumably so the user is not allowed to install DirectX). However, I was able to get the office productivity suite to run without any problems, and those results follow.
Office Performance – Sysmark 2000
The performance is seriously degraded using Win4Lin. CorelDraw 9 showed the worst performance, down more than 70%, while Word 2000, down 50%, fared a little better. According to BAPCo, a score of 100 corresponds to the performance of a 450 MHz Pentium III (440BX) with 128 MB of memory. For most of the applications, Win4Lin has turned a 2 GHz Pentium 4 into a 300 MHz Pentium II. Certainly not fast, but it is still usable for office productivity apps. I wrote this article in Word 97 using Win4Lin on a 366 MHz Mobile Pentium II and could not detect any lag or any sluggish behavior. But then, word processing is not exactly the most demanding of applications. However, graphics professionals will notice the difference in performance when using CorelDraw.
Win4Lin is sufficient for word processing because the computer is usually waiting on you (and not the other way around). What about an application where usability depends more on performance?
QuickTime Performance
One thing Linux has been lacking is the ability to watch video encoded for QuickTime. Unlike the usability of office applications, performance will make the difference between what is viewable (or usable) and what is not, as lag will translate directly into dropped frames during playback. Fortunately, QuickTime has a “show movie info” option that reports the frame rates in real-time. I chose to use
The Lord of the Rings Trailer #2 for this test.
The frame rate was recorded every 10 seconds to get an average score for each resolution of the trailer. Here are the resolutions tested:
Trailer size | Resolution | Max frames per second |
Small | 240 x 128 | 8 |
Medium | 320 x 172 | 12 |
Large | 480 x 260 | 24 |
Full Screen | 640 x 480 | n/a |
The “max frames per second” is what you should get if no frames are dropped during playback.
The frame rate for the “full screen” size needs further comment. When running QuickTime for this size, the info box reported a max frame rate of 0.33 which is obviously incorrect (and I can tell it was quite it bit higher just by watching it). Also, for this size, the frame rate reported during playback was always zero. This would happen in both Win4Lin and a normal installation of Windows 98SE, so it is either a problem with QuickTime or else the ability to measure frame rates was disabled for some reason.
The results for Win4Lin were obtained in full screen mode (which is particularly useful for giving PowerPoint presentations). You can launch Win4Lin in full screen mode by using the “fwin” command. Win4Lin spawns a second X-server before starting Windows, and you can switch back to Linux by typing ctrl + alt + F7. Using ctrl + alt + F8 will take you back again. Here are the results:
QuickTime Performance, Continued
Using Win4Lin, even a 2 GHz Pentium 4 is dropping 25% of the frames for the “large” trailer size. The playback was even worse for the “full screen” size. Of course, the normal installation of Windows 98SE did not drop any frames, and playback was smooth (and the same was true for a 500 MHz Pentium III from Falcon Northwest). Once again, Win4Lin has turned our shiny, new Pentium 4 into a sub-500 MHz computer! To be fair, Win4Lin is not dropping any frames for the two smallest trailer sizes, and even for the “large” size, playback is decent. Considering that Linux does not have a native way for viewing QuickTime, any frame rate above zero is an improvement.
Conclusions
Graphics professionals should probably stick with Windows because they will notice the difference in performance. For games, I would also stick with the dual boot for now. While some titles are available for Linux, most still require Windows. QuickTime using Win4Lin, while good enough for playback at low resolution, is not going to cut it for 640×480.
The kernel release schedule is also something to key your eye on. With Linux, it is very important to have a kernel that is up-to-date, lest the script kiddies use your box for denial-of-service attacks and other forms of badness. Since Win4Lin is working at a very low level, you need to be using one of the “enabled” kernels that can be downloaded from the web site. NeTraverse has just released enabled kernels for Red Hat Linux 7.2, so it looks like they lag behind the distributions by about two weeks. However, their most recent patch for the source at kernel.org is for the 2.4.9 Linux kernel, originally released on August 16. They really could be doing a better job on their release schedule for patches to the “official” Linux kernel.
Finally, for those of you who have been waiting for office applications to materialize before giving Linux a try, wait no more: Win4Lin is just what you have been looking for. You really can use Word, Excel, and PowerPoint inside Linux, and with a GHz+ machine, you should not really notice any performance problems for these applications.