Red Hat Linux 7 Unleashed

Red Hat Linux 7 Unleashed

By William Ball

Emulators

Emulators have been used since the early days of computing. An emulator is a software program designed to mimic a Central Processing Unit (CPU), computer language, or entire operating system on a foreign computer platform. Emulators are used to test CPUs, hardware devices, programs, and operating systems. They are also used to enable the porting or building of applications on one computer when the programs are destined for other, usually quite dissimilar, computing platforms.

Many of the early emulators under UNIX were assembler language macros that translated the low-level code for foreign CPUs into native code on the computer. In this way, programs could be transferred from one computer system to the next. This chapter does not detail how modern-day emulators work or cover all the emulators available for Linux (such as those used to run read-only memory programs from arcade machines under X11), but you'll find that Linux supports some useful and ingenious emulators.

Emulating DOS with DOSEMU

DOSEMU, based on the early work of Matthias Lautner and currently maintained by Hans Lermen, is not (according to its author) an emulator. Instead, Lautner claims it is a virtual machine for DOS. This means that the program creates a virtual computer in your system's memory. A copy of Pat Vallani's FreeDOS kernel (actually a 16MB DOS filesystem named under the /var/lib/dosemu directory) is included with the Red Hat Linux Powertools CD-ROM (and is available for download from Red Hat's site). After installation, you'll find most of DOSEMU's documentation under the /usr/share/ doc/dosemu directory.

To download and install the latest copy of DOSEMU, go to ftp://ftp.dosemu.org, log in, and then navigate to the dosemu directory. You can download DOSEMU in a compressed tarball (.tgz format), or as an .rpm file. You'll find .rpm files similar to Red Hat's DOSEMU .rpm files (except for the FreeDOS .rpm) under the /pub/dosemu directory, which can then be downloaded and installed easily with the rpm command like this:


   # rpm -ivh dosemu-1.0.1.2.i386.rpm
dosemu             #################################################
# rpm -ivh xdosemu-1.0.1.2.i386.rpm
xdosemu            #################################################
# rpm -ivh dosemu-freedos-1.0.1.2.i386.rpm
dosemu-freedos     #################################################

The Red Hat DOSEMU distribution consists of 151 files found under the /etc, /usr/bin, /usr/share/doc, /usr/man/man1, and /var/lib/dosemu directories. DOSEMU may be used from the command line of a Linux console or launched in its own window during an X session. The main configuration file, global.conf, is located under the /var/lib/dosemu directory. However, to configure most system-wide settings, you should only edit the file /etc/dosemu.conf. This file has nearly 80 different settings through which you can configure how DOSEMU works.

After a fresh install, you may have to set up DOSEMU (as root) by editing the /etc/dosemu.conf and changing the entry for the name of the hard drive used for booting. Check to make sure the default entry will look like this:

$_hdimage = "hdimage.first" # list of hdimages under /var/lib/dosemu

If the entry does not look like the above, change the name of the hdimage entry, then save your changes. You can then launch DOSEMU from the console by using the dos command. Type the command and press Enter:


   # dos

  The Linux DOSEMU, Copyright (C) 2000 the 'DOSEMU-Development-Team'.
  This program is  distributed  in  the  hope that it will be useful,
  but  WITHOUT  ANY  WARRANTY;   without even the implied warranty of

  MERCHANTABILITY  or  FITNESS FOR A PARTICULAR PURPOSE. See the file
  COPYING for more details.  Use  this  program  at  your  own risk!

  By continuing execution of this program,  you are stating that you
  have read the file  COPYING  and the above liability disclaimer and
  that you accept these conditions.

  Enter 'yes' to confirm/continue:

Type yes and press Enter. You'll then see:

Loading device driver c:\ems.sys at segment 1513
[dosemu EMS 4.0 driver installed]
KERNEL: Boot drive = C

DOS-C compatibility 3.31
(C) Copyright 1995, 1996, 1997, 1998
Pasquale J. Villani
All Rights Reserved

DOS-C version 1.0 Beta 2 [FreeDOS Release] (Build 1937).

DOS-C is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.

For technical information and description of the DOS-C operating system
consult "FreeDOS Kernel" by Pat Villani, published by Miller
Freeman Publishing, Lawrence KS, USA (ISBN 0-87930-436-7).

Running dosemu-1.0.1.0 compatibility, DosC patch 1
Process 0 starting: command.com

"Welcome to FreeDOS (http://www.freedos.org)!"
C:\>

If you first try launching the program and see this:


   # dos
Sorry bball. You are not allowed to use DOSEMU. Contact System Admin.

You may need to edit the file /etc/dosemu.users to allow other users to launch and use DOSEMU. Create an entry in /etc/dosemu.users:

root c_all
all c_all

Save the file. Your users can then start a DOS session. You can also start a DOS session in an X11 window with the xdos command. Type the command's name:


   # xdos

You'll then see a DOS session start, as shown in Figure 28.1.

28fig01.gif

Figure 28.1 Use DOSEMU to run a DOS session from the console or during an X11 session.

To get the latest version of DOSEMU, browse to http://www.dosemu.org. You'll find links to the very latest documentation and updates. For updates to FreeDOS, browse to http://www.freedos.org. You'll also find hundreds of utilities, commands, and additional software packages you can add to your DOSEMU system.

Running Windows Clients with Wine

The Wine emulator, supported by programmers contributing the Wine project, allows you to run many DOS, Windows 3.1, or Win32 programs. This emulator may be downloaded from http://www.winehq.com in binary or source archives.

The easiest way to install Wine is to download a prebuilt .rpm file (such as from the Red Hat PowerTools CD-ROM) and to then install the program with this code:


   # rpm -ivh wine-20000725-1.i386.rpm

After installation, edit the file wine.conf under the /etc/wine directory as root to tell wine the location of your Windows directory and settings for your floppy drive and CD-ROM. First look for the floppy drive entry:

[Drive A]
Path=/mnt/fd0
...
Device=/dev/fd0

If your floppies are mounted under the /mnt/floppy directory, you should then change the Path= entry to reflect this:

Path=/mnt/floppy

Next, look for the entry for Drive C:

[Drive C]
Path=/c

Change the drive entry to reflect the path to your Windows filesystem. Under Red Hat Linux, the corresponding entry to Windows's drive C: (in your system's filesystem table, /etc/fstab) will probably point to /mnt/dos. If so, change the wine.conf entry to

[Drive C]
Path=/mnt/dos

Continue through the wine.conf file, editing entries to match your system's filesystems, devices, and mount points. Another important entry will point to your system's CD-ROM drive:

[Drive D]
Path=/cdrom
...
Device=/dev/cdrom

In this example, your computer's CD-ROM drive is assigned as Drive D. You may need to change this entry to reflect the proper mount point and device like this:

[Drive D]
Path=/mnt/cdrom
...
Device=/dev/hdc

If you have your Windows partition mounted, you can then try to run the Windows WordPad client by typing this:


   # wine /mnt/dos/Prog*/Accessories/wordpad.exe

The editor's window appears, as shown in Figure 28.2.

28fig02.gif

Figure 28.2 The Wine emulator allows you to run some Windows programs during your Linux X11 sessions.

If you'd like to learn more about Wine or exchange tips and hints with other users or developers, read the Usenet newsgroup comp.emulators.ms-windows.wine. You'll also find nearly 30 newsgroups focused on discussions about emulators if you search at http://www.deja.com.

Emulating the Apple Macintosh with Executor

Executor, by ARDI, is a commercial software emulator you can use to run MacOS applications under Linux. According to ARDI, Executor on a 90MHz Pentium can run most applications almost as fast as a 50 MHz 68040. The Executor software is distributed in a series of .rpm archives, and a demo version is available through http://www.ardi.com.

This software may help you run one of nearly 340 legacy Macintosh applications, but the software emulation of the Apple Macintosh is not perfect and does have some limitations. The default emulated MacOS is System 6.0.7, although some System 7.0 applications may work. More importantly, though, other exclusions include

There is limited sound support, and the software can read and write 1.44MB Macintosh-formatted floppy disks. According to ARDI, "Desk Accessory support is very weak; most will not run." On the other hand, you'll find excellent support for some major Macintosh clients, as listed in Table 28.1.

Table 28.1. Executor-compatible Macintosh Clients

Name Version(s) Supported
Adobe Dimensions 2.0
Adobe Illustrator 1.9.5, 5.5
Adobe Photoshop 4.0
Aldus Freehand 2.2
Aldus Persuasion 2.1, 3.0
Claris Draw 1.0v1
Claris Works 2.01, 2.1, 3.0
File Maker Pro 2.0, 2.1, 3.0, 4.0
HyperCard 2.1, 2.2, 2.3
Microsoft Excel 3.0a, 4.0
Microsoft Word 5.1
Microsoft Works 2.00a
QuarkXPress 3.32
Quicken 4.0, 5.0, 6.0
WordPerfect 3.1
WriteNow 4.0

Installing Executor

Install the software (as root) with the rpm command. After installation, the main executable is found under /opt/executor/bin, but symbolic links will be created under the /usr/local/bin directory. Although an SVGA version is included, the easiest way to run the executor command is during an X11 session. Start X, then type the following at the command line of a terminal to start the program:


   # executor &

A splash screen will appear, and then the main window will appear, as shown in Figure 28.3.

28fig03.jpg

Figure 28.3 ARDI's Executor emulates a legacy Apple Macintosh and runs more than 300 different Macintosh applications.

The default screen size of the emulation window is 640x480, but you can alter this by using one of Executor's command-line switches, as shown in Table 28.2.

Table 28.2. Executor Command-Line Switches

Option Action
applzone n [k] Uses n kilobytes of memory for an application
applzone n [MB] Uses n megabytes of memory for an application
bpp n Uses n bits per pixel (1 or 8)
desparate Minimalist mode (only for DOS)
geometry height x width Standard X geometry settings
grayscale Uses grayscale when running
help Prints help message on options and quits
info Prints system information
keyboard ke y board Uses specified keyboard
keyboards Prints available keyboard maps
memory n Creates n megabytes of use for system memory
nobrowser Disables file browser when starting
nodiskcache Disables internal disk cache
nodotfiles Doesn't list filenames beginning with a period
nosound Disables sound
privatecmap Uses a private colormap for X
refresh n Refreshes screen every nth of a second
size height x width Uses initial window of height and width pixels
stack n [k] Uses n kilobytes of stack memory for the system
stack n [MB] Uses n megabytes of stack memory for the system
sticky Uses sticky menus
syszone n [k] Uses n kilobytes of memory for the system
syszone n [MB] Uses n megabytes of memory for the system

To emulate traditional Macintosh keys, Executor uses the left Alt key as the Command key and the right Alt key as the Option key. If you press Cmd+Shift+5 (left Alt+Shift+5), a preferences dialog box appears. The dialog box, which is shown in Figure 28.4, is used to set compatibility options.

28fig04.gif

Figure 28.4 You can set System 7 compatibility options by using the left Alt+Shift+5 key combination.

Printing under Linux is supported through configuration of the printers.ini file found under the /opt/executor directory. The default output is PostScript, which will print through the apsfilter system using the lpr command.

VMware for Linux and Windows

VMware from VMware, Inc. is a software package for Linux, Win32 operating systems, and others that you can use to install and run an operating system using a virtual filesystem on your computer. This approach, similar to the hard drive image used by DOSEMU, can be used to install and run Linux under a Win32 operating system without partitioning the hard drive. It can also be used to install and run a Win32 operating system under Linux.

VMware for Linux is available for download on a limited trial basis. Unlike the free AT&T Laboratories Cambridge virtual network software (discussed in this chapter's Windowing Network Clients section), VMware is a commercial software package. This section discusses installing and running VMware under Linux, although VMware is available for other platforms. For details, browse to http://www.vmware.com.

The VMware software for Linux is distributed as a 6MB compressed archive, and requires at least a 266MHz processor and the X Window System.

Installing VMware for Linux

To install VMware under Linux, download the package and then decompress the archive with the tar command:


   # tar xvzf vmware*gz

Navigate to the resulting vmware-distrib directory and run the file vmware-install.pl as root:


   # ./vmware-install.pl
Creating a new installer database using the tar2 format.
Installing the content of the package

In which directory do you want to install the binary files?
[/usr/bin]

The installation script starts and you are asked where to install the binary files. By default, this location is the /usr/bin directory, but you can specify an alternate location, such as /usr/local/bin. You'll then be asked a series of questions about file locations, and will be asked to type yes to agree to the VMware End User License Agreement (EULA). The script then checks your system, builds any required software modules, and asks whether you'd like a closed or working networking configuration. (This helps determine whether to allow the installed operating system to communicate with other computers.) If you need networking support for your intended operating system, allow the script to enable networking support.

After you choose your configuration, the script installs the VMware software under the designated directories and exits. In order to run VMware, you must have a license file from VMware, Inc. This license can be obtained by registering at the VMware home page, and it will be emailed to you. When you receive the license, save the email message as a text file named license.

Next, use the mkdir command to create a directory in your home directory named .vmware. Copy the license into the .vmware directory:


   # mkdir .vmware ; cp license .vmware

Starting and Configuring VMware

To start VMware, type vmware at the command line of your terminal window. (You do not need to be logged in as the root operator, but you will need read and write permission for the device /dev/zero.) The VMware configuration window and configuration dialog box appear, as shown in Figure 28.5.

28fig05.gif

Figure 28.5 Before you can install another operating system, you must first run VMware's Configuration Wizard.

Click OK to continue. You'll see the Configuration Wizard screen. Click Next to continue, and you'll see a list of supported operating systems, as shown in Figure 28.6.

28fig06.jpg

Figure 28.6 Use VMware's Configuration Wizard to select an operating system to install.

Note that you can even install another Linux distribution, or if you click Other, another UNIX variant, such as FreeBSD. To start your configuration, click the button next to an operating system, and then click Next. Throughout the configuration process, you can step forward or backward to change settings. After selecting your operating system, click Next.

You are then asked to select the location of the virtual filesystem, a type of virtual disk, a file size for the new operating system's virtual disk, the CD-ROM and floppy device, and the type of networking, as shown in Figure 28.7.

28fig07.jpg

Figure 28.7 Select a type of networking to restrict or allow your new operating system to communicate over a network.

You are then asked to confirm your settings, as shown in Figure 28.8.

28fig08.jpg

Figure 28.8 Confirm your configuration settings before using VMware.

After you click Done, you're ready to install an operating system.

Installing Your Operating System

To start the installation process, insert a floppy disk or CD-ROM into your computer and then click the Power On button in the VMware window. The software boots, as shown in Figure 28.9.

28fig09.gif

Figure 28.9 Power on VMware with an inserted floppy or CD-ROM operating system installation disk to install your new operating system.

Note that VMware comes with an industry-standard PC BIOS. Continue through and finish your operating system installation. The next time you start VMware, you'll be asked to select a desired configuration, usually found under the directory you designated when you configured your virtual machine. The configuration file will have a name ending in .cfg in the directory (usually under the vmware directory in your home directory or other volume). To start your session, select the file and then click the Power On button. Your operating system will boot, as shown in Figure 28.10.

When you click in the VMware window, your mouse will become "attached" to the operating system's window. To release your mouse, press Ctrl+Alt+Esc. When you're finished working with VMware, make sure to properly shut down the running operating system and then click the Power Off button in the VMware window.

For tips and hints on troubleshooting problems, or to learn more about VMware for other operating systems, browse to http://www.vmware.com.

28fig10.gif

Figure 28.10 The VMware software supports many different types of operating systems, including legacy software such as the now-defunct Windows for Workgroups.

Share ThisShare This

Informit Network