Running Microsoft Windows, DOS, and Macintosh Applications


Linux is ready to run most applications that were created specifically for Linux, the X Window System, and many UNIX systems. Many other applications that were originally created for other operating systems have also been ported to Linux. There are still, however, lots of applications created for other operating systems for which there are no Linux versions.

Linux can run some applications that are intended for other operating systems using emulator programs. An emulator, as the name implies, tries to act like something it is not. In the case of an operating system, an emulator tries to present an environment that looks to the application like the intended operating system.

Note 

The most popular of these emulators, called WINE, is not really an emulator at all. WINE is amechanism that implements Windows application-programming interfaces; rather than emulating Microsoft Windows, it provides the interfaces that a Windows application would expect. In fact, some people claim that WINE stands for "WINE Is Not an Emulator."

In the following sections, I discuss emulators that enable you to run applications that are intended for the following operating systems:

  • DOS

  • Microsoft Windows 3.1

  • Microsoft Windows 95

  • Microsoft Windows 98

  • Microsoft Windows 2000

  • Microsoft Window ME

  • Microsoft Windows NT

  • Microsoft Windows XP

  • Macintosh (Mac OS)

As for Mac OS X applications, because that operating system is based on a UNIX-like operating system called Darwin, many open source applications written for Mac OS X will have versions available that run in Linux. If you find an application that you like in Mac OS X and want to run in Linux, check the Sourceforge.net site to see if the project that created the Mac OS X application offers a Linux version of it as well (or at least the source code to try to build the application yourself).

Note 

In theory, any application that is Win32-compatible should be able to run using software such as WINE (described later). Whether or not a Microsoft Windows application will run in an emulator in Linux must really be checked on a case-by-case basis. Available emulation programs include:

  • DOSEMU, for running DOS programs. (DOSEMU is available from http://dosemu.sourceforge.net).

  • WINE, which lets you run Windows 3.1, Windows 95, Windows 98, Windows 2000, Windows NT, and Windows XP binaries. Windows NT and XP programs are not as well supported. However, because many Windows applications are written to work in earlier Windows systems (why limit their market just to use a couple of XP-specific calls?), they will run just fine in WINE as well. Check the documentation for the Windows application. If it only requires Windows 95 or Windows 98, it will often run in WINE.

  • ARDI Executor, which enables you to run applications that are intended for the Macintosh operating system (MAC OS).

In general, the older and less complex the program, the better chance it has to run in an emulator. Character-based applications generally run better than graphics-based applications. Also, programs tend to run slower in emulation, due sometimes to additional debugging code put into the emulators. However, because WINE “is not an emulator,” any application that doesn't make system calls should run as fast in WINE as it does natively in Windows.

Running DOS applications

Because Linux was originally developed on PCs, a variety of tools were developed to help developers and users bridge the gap between Linux and DOS systems. A set of Linux utilities called mtools enables you to work with DOS files and directories within Linux. A DOS emulator called dosemu lets you run DOS applications within a DOS environment that is actually running in Linux (much the way a DOS window runs within a Microsoft Windows operating system).

Using mtools

mtools are mostly DOS commands that have the letter m in front of them and that run in Linux (though there are a few exceptions that are named differently). Using these commands, you can easily work with DOS files and file systems. Table 5-4 lists mtools that are available with Linux (if you have the mtools package installed).

Table 5-4: mtools Available with Linux

Command

Function

mattrib

The DOS attrib command, which is used to change an MS-DOS file attribute flag

mbadblocks

The DOS badblocks command, which tests a floppy disk and marks any bad blocks contained on the floppy in its FAT.

mcd

The DOS cd command, which is used to change the working directory to another DOS directory. (The default directory is A:\) that is used by other mtools.

mcheck

The DOS check command, which is used to verify a file.

mcopy

The DOS copy command, which is used to copy files from one location to another.

mdel

The DOS del command, which is used to delete files.

mdeltree

The DOS deltree command, which deletes an MS-DOS directory along with the files and subdirectories it contains

mdir

The DOS dir command, which lists a directory’s contents.

mdu

The Linux du command, which is used to show the amount of disk space used by a DOS directory.

mformat

The DOS format command, which is used to format a DOS floppy disk.

minfo

This command is used to print information about a DOS device, such as a floppy disk.

mkmanifest

This command is used to create a shell script that restores Linux filenames that were truncated by DOS commands.

mlabel

The DOS label command, which is used to make a DOS volume label.

mmd

The DOS md command, which is used to create a DOS directory.

mmount

This command is used to mount a DOS disk in Linux.

mmove

The DOS move command, which is used to move a file to another directory and/or rename it.

mrd

The DOS rd command, which is used to remove a DOS directory.

mren

The DOS ren command, which is used to rename a DOS file.

mshowfat

This command is used to show the FAT entry for a file in a DOS file system.

mtoolstest

This command is used to test the mtools configuration files.

mtype

The DOS type command, which is used to display the contents of a DOS text file.

mzip

This command is used to perform operations with Zip disks, including eject, write protect, and query.

I usually use the mtools to copy files between my Linux system and a Windows system that is not on my network. I most often use mcopy, which lets me copy files using drive letters instead of device names. In other words, to copy the file vi.exe from floppy drive A: to the current directory in Linux, I would type:

# mcopy a:\vi.exe . 
Caution 

By default, the floppy-disk drive can be read from or written to only by the root user and the floppy group. To make the floppy drive accessible to everyone (assuming it is floppy drive A:), type the following as root user: chmod 666 /dev/fd0.

Using dosemu

The DOS emulator package dosemu does not come with Fedora Core distributions. To use dosemu, download the dosemu RPM file from dosemu.sourceforge.net.

With the utilities that come with the dosemu package, you can run DOS applications, as well as use your computer as if it were running DOS. This includes accessing hardware, working with DOS configuration files, and using the DOS file system.

The following commands can be used to start dosemu within Linux:

  • dosemu — Starts the DOS emulator in any shell.

  • xdosemu — Starts the DOS emulator in its own X window.

  • xtermdos — Starts the DOS emulator in an xterm window.

  • dosdebug — Starts a debug program to view information and error messages about a running DOS program.

Basic information about your DOS environment is set in the /etc/dosemu/dosemu.conf file. The following list describes how the DOS environment is set up and how to change it:

  • CPU — The CPU is set to emulate an 80386 (Intel 386-compatible). You can change the $_cpu value to 80486 or 80586 (for Pentium).

  • Keyboard — The keyboard is set to auto, which tries to set the keyboard based on the current Linux console settings. You can specifically change the keyboard type by setting the $_layout value to a variety of other country/language combinations listed in the dosemu.conf file (such as us for US/English, de for German, or it for Italian).

  • X Settings — There are several X settings (beginning with $_X) that let you change things such as the title in the DOS window, the font used, and the cursor blink rate.

  • Floppy Disks — Floppy disk A (/dev/fd0) is set to a 3.5-inch floppy (threeinch) and floppy disk B (/dev/fd1) is not assigned. Either disk can be assigned to be 3.5- inch (threeinch), 5.25-inch (fiveinch), atapi, or empty.

  • Hard Disk Images — The file system that appears when you start DOS is actually a disk image file stored in /var/lib/dosemu. By default, dosemu uses hdimage.first (which is linked to hdimage.freedos). You can change that to another DOS image or to a DOS file system (such as /dev/hda1, if that partition were a DOS partition).

  • Serial Ports — No serial ports are assigned by default. You can assign any of the serial ports ($_com1 to $_com4) to a device such as a modem (/dev/modem), a mouse (/dev/mouse), or a terminal line (/dev/tty0).

The dosemu package is set up for the root user. It is not very secure to allow multiple users to have access to DOS because DOS does not have the same security protections for files and devices that Linux does. If you want other users on your Linux system to use DOS, however, edit the /etc/dosemu.users file so that it includes the following lines:

root c_all  all c_all 

For more information on dosemu, visit the dosemu home page at www.dosemu.org.

Running Microsoft Windows applications with WINE

The WINE project (www.winehq.com) has been making great strides in getting applications that were created for Microsoft Windows to run in Linux and other operating systems. WINE is not really an emulator, because it doesn't emulate the entire Windows operating system. Instead, because it implements Win32 application programming interfaces (APIs) and Windows 3.x interfaces, the WINE project is more of a "Windows compatibility layer."

To get WINE for your Fedora system, you can go to the following places:

  • Download sites — You can download WINE free of charge from several different Web sites. Check winehq.com for a list of download sites. I downloaded the latest RPMs built for Fedora Core 2 from http://sourceforge.net/projects/wine/. (If a Fedora Core 3 version becomes available you should probably use that instead.)

  • Cedega — A commercial version of WINE called Cedega (formerly called WineX) is available from TransGaming, Inc. (www.transgaming.com). TransGaming focuses on running Windows games in Linux, using WINE as its base. See Chapter 7 for descriptions of Cedega.

  • CodeWeavers — If you need Microsoft Office or Web browser plug-ins, CodeWeavers (www.codeweavers.com) offers CrossOver Office and CrossOver Plug-in, respectively. Although these products cost some money, they offer friendly interfaces for installing and managing the Windows software and browser plug-ins that it supports.

While it’s true that you can run many Windows applications using WINE, some fiddling is still required to get many Windows applications to work. If you are considering moving your desktop systems from Windows to Linux, the current state of WINE provides an opportunity to see if some Windows applications you need might run in Linux.

Caution 

I suggest that you test any application you want to use in WINE before you put it on any computer that is a critical part of your work. Although I haven’t done serious damage to my computer, WINE still freezes up the desktop under certain conditions. Please check with the organizations listed in the bullet lists for specific issues related to running Windows applications in Fedora.

Besides developing software, the WINE project maintains a database of applications that run under WINE. More than 1000 applications are listed, although many of them are only partially operational. The point is, however, that the list of applications is growing, and special attention is being paid to getting important Windows 98 and 2000 applications running.

Although not open-source products, VMware and Win4Lin are other good ways to run Windows applications along with a Linux system on the same running computer. With VMware you can simultaneously run Microsoft Windows 98/NT/2000/XP and Linux operating systems on the same PC. In general, Windows applications are less likely to break in VMware than they are in WINE (since you actually run the whole Windows operating system), but performance will be worse (since you run an operating system within an operating system). You can get more information about VMware from www.vmware.com. Win4Lin (www.netraverse.com) lets you run Windows applications in a running Linux system.

The next section describes how to set up Linux to run Microsoft Windows applications using WINE.

Understanding WINE

For WINE to let you run Microsoft Windows applications, it needs to have an environment set up that looks like a Microsoft Windows system. The following section takes you through the steps of installing and configuring the latest released wine RPM for Fedora Core (under Red Hat Packages) from sourceforge.net/projects/wine.

When you install the wine package in Fedora Core, the package creates the /etc/wine/config file that, like the Windows registry, identifies the locations of components an application would need in a Microsoft Windows operating system.

The location of the basic Microsoft Windows operating-system directories for WINE is the $HOME/.wine/drive_c directory for each user, which looks like the C: drive to wine. The $HOME/.wine directory is created automatically the first time a user runs the wine command. Drive letters are assigned in the $HOME/.wine/dosdevices directory.

Note 

If you have trouble accessing the CD drive or other drive in WINE, check the dosdevicesdirectory. If the CD drive doesn't show up as d: in the dosdevices directory, you can create a link to it yourself by typing something like:

# ln -s /media/cdrecorder $HOME/.wine/dosdevices/d: 

Table 5-5 shows how C: and other Windows drive letters are mapped to Linux directories and devices.

Table 5-5: Microsoft Windows Drive Letters in WINE

Description

Drive Letter or Name

Linux Directory or Output Location

Linux Device Name (If Applicable)

Floppy drive

A:

/mnt/floppy

/dev/fd0

Hard disk #1

C:

$HOME/.wine/drive_c

 

CD-ROM

D:

/mnt/cdrom

/dev/cdrom

Temp directory

E:

/tmp

 

User’s home directory

F:

$HOME (user’s home directory)

 

Root directory

Z:

/

 

Serial ports

COM1

COM2

COM3

COM4

 

/dev/ttyS0

/dev/ttyS1

/dev/ttyS2

/dev/modem

Parallel ports

LPT1

 

/dev/lp0

Print spooler

LPT1

Pipes printer jobs to the lpr command (|lpr)

 

WineLook

Win95 (how the system appears to apps: Win31, Win98, or the default Win95)

  

Within the $HOME/.wine/drive_c directory (that is, your C: drive), you should see some things that are familiar to you if you are coming from an older Windows environment: Program Files and windows directories.

Assuming that the basic directory structure is okay with you, you may still want to consider changing a few items. For example, you may want to change the command to print documents (set in the /etc/wine/config file) to something other than the "| lpr" command to use a particular printer or add some Linux printing options.

Note 

For details on configuring the wine.conf file, see the Wine User Guide. That guide (wine-user.pdf) is stored in the /usr/share/doc/wine* directory when you install the wine RPM for Fedora Core.

For Windows applications that are included on CD or DVD, you can try installing them by simply running the setup program on that medium with the wine command. So, with a CD containing the application you want to install inserted and mounted, you would run a command like the following:

 # wine d:\Setup.exe  

The application will run, just as it would in Windows, to install the application to your hard disk.

Setting up Microsoft Windows applications

The best way to understand how to set up and run a Microsoft Windows application is to step through the process of getting a simple Microsoft Windows accessory to run in WINE. To do this procedure, you will need the following:

  • The wine package installed in your Fedora Core system.

  • Access to Microsoft Windows components, including the executable program you want to run and the DLL files the executable needs to run.

If you have a dual-boot system (Fedora Core and Microsoft Windows), the best way to do this procedure is to have Linux running with the Windows partition mounted somewhere so that you can copy the files you need. Otherwise, you should skip the first step and copy the files you need from a floppy or CD, or over the network.

In this example, I want to be able to run the Microsoft Paint program (mspaint.exe) from Windows in Linux using WINE. Here is an example of how to go about it.

  1. If you have a dual-boot system start by mounting the Windows partition. Here’s how:

    • As the root user, from a Terminal window, type:

       # fdisk –l  

      This lists your hard-disk partitions. Look for a partition that is listed as something like WIN95 FAT32.

    • Make a directory on which to mount your Windows partition. For example, to use the /mnt/win directory, type:

       # mkdir /mnt/win 
    • Assuming that the Windows partition is on the first partition of the first IDE hard disk (/dev/hda1), type the following to mount the Windows partition:

       # mount –t vfat /dev/hda1 /mnt/win 

      At this point you should have a mounted Windows partition available from /mnt/win.

    • To make that partition permanently available to you from Linux, add the following line to your /etc/fstab file:

      /dev/hda1       /mnt/win       vfat       defaults 0 0 

    The preceding entry causes the Microsoft Windows partition to mount automatically on /mnt/win each time your Fedora Core system boots up.

    Note 

    For the purposes of the rest of this procedure, I assume that you have a Microsoft Windows system accessible from /mnt/win. If this is not the case, you need to find a way to copy files from your Microsoft Windows system on another computer to the locations described in this procedure.

  2. Copy the mspaint.exe program to a location accessible from your Linux computer. For example, with a mounted Microsoft Windows partition as previously described, you could type:

     # cp /mnt/win/Program\ Files/Accessories/mspaint.exe /bin/ 
  3. Run the wine command with mspaint.exe as an argument to see if it can run or if it needs some added DLL files.

     # wine /bin/mspaint.exe err: module:PE_fixup_imports Module (file) MFC42.DLL (which is           needed by Z:\a\mspaint.exe) not found 

    This says that you need the mfc42.dll file to be able to run mspaint.exe.

  4. Next, copy the necessary DLL file from the Microsoft Windows partition. For example:

     # cp /mnt/win/windows/system/mfc42.dll /usr/share/wine c/windows/system/ 
  5. With the proper DLL files installed, type wine /bin/mspaint.exe again and the Microsoft Paint window opens. An example of the Paint window running in Fedora Core is shown in Figure 5-3.

    image from book
    Figure 5-3: Running Paint in Red Hat Linux using WINE.

In Figure 5-3, Paint is displaying a bitmap image that I opened from the Fedora Core file system. Choose File ® Open. In the Open dialog box, you can see how the application views the locations available to it. The C:, D:, E:, F:, and Z: drives all represent the locations shown in Table 5-5. (The computer in the example didn’t have a floppy, or you would also see the A: drive.)

Finding Microsoft Windows applications for WINE

Applications that have been tested to run under WINE are maintained at the Wine Application Database (http://appdb.codeweavers.com/). The database is divided into the following categories:

  • Educational Software and Computer-Based Training

  • Games

  • Multimedia

  • Networking & Communications

  • Productivity

  • Programming / Software Engineering

  • Reference, Documentation, and Information

  • Scientific, Technical, and Mathmatical

  • Special Purpose

  • Utilities

Hundreds of applications have been submitted for the database. Most of the packages that have been tested are games. In most cases, the person listing the application describes the platform he or she tested on and any experiences he or she had getting it to run. The host of the list, codeweavers.com, asks that you create a login to access the database.

Another Web site for information about WINE applications is Frank's Corner (www.frankscorner.org). The site is loaded with good tips for getting graphics, Internet, multimedia, office, games and other applications running in WINE.

Running Macintosh applications with ARDI Executor

Besides enabling you to run many popular older Macintosh applications on the PC, ARDI Executor (www.ardi.com) from ARDI, Inc. lets you work with Mac-formatted floppies and a variety of Mac drives. Find more about ARDI Executor from www.ardi.com/executor.php.

ARDI also maintains a listing of compatible Mac software in its Compatibility Database. There are literally hundreds of Mac applications listed. Each application is color coded (green, yellow, orange, red, or black) to indicate how well the software runs under ARDI. Green and yellow are fully usable and largely usable, respectively. Orange is mostly unusable. Red means the application won't run at all, and black means it won't run because it requires features that aren't implemented in ARDI. At a glance, about two-thirds of the applications listed were either green or yellow.

Cross Reference: 

With Mac OS X being based on a Linux-like operating system, more and more cross-platform applications will be available for Linux and the Mac. Interoperating Mac OS X with Linux systems is discussed in more detail in Chapter 26.




Red Hat Fedora Linux 3 Bible
Red Hat Fedora Linux 3 Bible
ISBN: 0764578723
EAN: 2147483647
Year: 2005
Pages: 286

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net