Using UNIX and Windows Together - Network Administration - UNIX: The Complete Reference (2007)

UNIX: The Complete Reference (2007)

Part IV: Network Administration

Chapter 18: Using UNIX and Windows Together

Overview

The UNIX System gives you a rich working environment that includes multitasking, extensive networking capabilities, and a versatile shell with many tools. UNIX exists in many versions, called variants, that include distributions of Linux, Mac OS X, and BSD that run on desktop environments, and other distributions that run on workstations, minicomputers, and mainframes-such as Solaris, HP-UX, and AIX. But we live in a world in which millions of desktop PCs and servers run applications under Microsoft Windows, which itself has a few versions currently being used, such as Windows 2000, Windows XP, and even older versions on home PCs. To complicate things further, many environments exist in which UNIX computers and Windows computers are networked together. These realities make it crucial for many people to use Windows and UNIX together.

There could be many reasons to use both systems-for instance, if you use a UNIX system at work and run Windows on a PC at home or vice versa. You may want to take advantage of both UNIX and Windows applications by running them on the same machine. For example, maybe you wish to run UNIX versions of Windows software that are compatible with the original Windows versions. You may want to emulate your Windows environment on a computer running UNIX. On the other hand, maybe you wish to enrich your Windows environment with UNIX System facilities and tools, or you wish to run UNIX applications on a Windows machine. You may even want to run both Windows and UNIX on the same PC.

When you use both Windows machines and UNIX machines on the same network, you may want to share files between them. You may want to use your Windows PC as a terminal for logging in to a UNIX computer, and so on. So in a hybrid world of both UNIX and Windows machines, you may want to use Windows and UNIX together in a multitude of ways.

There are many aspects to using the UNIX System and Windows together. This chapter covers these issues and more:

§ Moving to UNIX if you are a Windows user, including understanding important similarities and differences between the two operating systems

§ Understanding the differences between how the graphical user interfaces execute tasks and how the command-line interfaces execute tasks

§ Understanding how to access a UNIX system using terminal emulation on your PC

§ Running Windows applications on UNIX machines, including Windows emulators

§ Sharing files and applications across UNIX and Windows machines

§ Running both UNIX and Windows on the same machine

§ Networking Windows PC clients with UNIX servers (covered also in Chapter 15)

§ Sharing hardware between UNIX and Windows machines

Moving to UNIX If You Are a Windows User

Both UNIX-and its variants-and Windows have command-line and graphical user interfaces. While many UNIX users switch between the two environments depending on the task to be performed, most Windows users seldom use command lines. To effectively move from a Windows environment to a UNIX environment, you will need to understand the similarities and differences between the two systems. If you are moving to a UNIX environment from Windows, you will need to know a number of things to become as proficient as you were in your Windows environment. You need to know about the differences and similarities of the commands used. You need to understand how the user interfaces are different, but-in some instances-can be made to look the same. You need to know the differences in how files and directories are named and accessed. And you need to know how the environments and shells are different. These next few sections talk about these issues.

Differences Between Windows and the UNIX System

The UNIX System and Windows differ in many ways, most of which are hidden from the user. Unless you are an expert programmer, you do not need to know how memory is allocated, how input and output are handled, or how the commands are interpreted. But as a user, if you are moving from one to the other, you do need to know differences in commands, differences in the syntax of commands and filenames, and differences in how the environment is set up. You may also want to compare how the GUI (graphical user interface) environments of both UNIX and Windows are similar, and how they are different.

If you already use Windows, you have a head start on learning to use the UNIX System. You already understand how to create and delete directories; how to change the current directory; and how to display, remove, and copy files. DOS users under Windows are familiar with command-line interfaces to execute commands. Windows users are familiar with using icons and mouse movements to perform simple tasks such as moving and copying files.

While you may never need to understand the actual operations of the “clicks and drags” you use as a Windows user, you can get a clearer understanding of the UNIX System by understanding the corresponding UNIX System commands for these basic Windows commands. These Windows commands are executed as DOS commands in much the same way that commands performed under UNIX desktop environments, such as the Common Desktop Environment and K Desktop (CDE and KDE, discussed in Chapter 7) or the GNOME desktop (Chapter 6) are actually executed as UNIX commands. We will use the term DOS in this chapter to describe the command-line environment of Windows. In later versions of Windows such as 2000 and XP, the command-line interface to DOS is replaced by the notion of CMD.EXE instead of COMMAND.COM.

Graphical User Interfaces

Microsoft Windows presents users with a graphical user interface that lets them simplify many different tasks with the help of their mouse. The Windows GUI evolved from earlier GUIs developed at Xerox Park and at Apple Computers. Analogously, GUIs have been developed for UNIX users. Originally, different variants of UNIX had their own GUIs, but standardization efforts have led to the adoption of common GUIs across many variants of UNIX, such as the Common Desktop Environment (CDE), GNOME, and KDE. It is not difficult to move from one UNIX GUI to another, since the underlying principles behind the use of these GUIs are similar.

In the same way, moving from the use of Windows with a GUI to the use of UNIX with a GUI is relatively easy For instance, both the UNIX and Windows GUI environments use icons to represent tasks, files, and directories. As an example, both UNIX and Windows use the concept of a folder to represent a directory The metaphor of “icon dragging” applies to both the UNIX and Windows GUIs. You can move icons around on a page, move the active window, enlarge or minimize it, or move file folders or contents to other folders in both environments. Likewise, the metaphor of “double-clicking” applies. When you double-click an icon in either GUI, an application executes and a new window opens to allow you to run the application. When you are done, you exit the application by selecting an “exit” icon in the active window. Even “right-clicking” is similar. When you use your right mouse button, you see either a drop-down menu of options you can perform with the current icon, or more information about it.

General Differences Between the Command Line in UNIX and in Windows

Although UNIX and Windows tasks can be executed in much the same way by using a graphical user interface, a number of differences exist between them in the way commands are executed, the way files are named and structured, and the environment under which a user interacts with the system.

Some minor differences in command syntax can be confusing when moving from one system to the other. For example, as previously noted, DOS under Windows uses a backslash to separate directories in a pathname, where the UNIX System uses a (forward) slash. In addition, the two systems require different environmental variables, such as PATH and PROMPT, which must be set properly for programs to run correctly

The file system structures also differ from one to the other. Although both Windows and UNIX use the concept of hierarchical files, each disk on a Windows machine has an identifier (for instance, C: or D:) that must be explicitly mentioned in the pathname to a file. This is because each disk has its own root directory with all files on that disk under it in a hierarchy UNIX has only one root directory, and no matter how many physical disks are associated with the files under the root directory, the files are referenced as subdirectories under the root directory This process, called mounting, shields the user from having to know where the files reside. In fact, files may even reside on different machines and still be accessed using this single root concept via remote resource mounting. These concepts are discussed in more detail in Chapters 14, 15, and 17.

Finally, some fundamental concepts underlying the UNIX operating system are not present in DOS-such as standard input and output. And some concepts are used much less frequently in DOS, such as piping commands or using redirection of output. The differences will be outlined here, as these concepts are an essential part of learning the UNIX System.

Common Commands in UNIX and DOS

Most of the common commands in DOS have counterparts in the UNIX System. In several cases more than one UNIX command performs the same task as a DOS command; for example, df and du both display the amount of space taken by files in a directory, but in different formats. In this case the UNIX System commands are more powerful and more flexible than the DOS SIZE command (DOS 7.0 and newer versions use the CHKDSK command). Some commands appear identical in the two systems-for example, both systems use mkdir. Table 18–1 shows the most common commands in DOS and the equivalent commands in the UNIX System.

Table 18–1: Basic Commands in DOS and the UNIX System

Function

DOS Command

UNIX Command

Display the date

DATE

date

Display the time

TIME

date

Display the name of the current directory

CD

pwd

Display the contents of a directory

DIR, TREE

Is –l, find

Display disk usage

CHKDSK

df, du

Create a new directory

MD, MKDIR

mkdir

Remove a directory

RD, RMDIR

rmdir, rm –r

Display the contents of a file

TYPE

cat

Display a file page by page

MORE

more, pg

Copy a file

COPY

cp

Remove a file

DEL, ERASE

rm

Compare two files

COMP, FC

diff, cmp, comm

Rename a file

RENAME

mv

Send a file to a printer

PRINT

lp

Most of these UNIX commands are described throughout this book, especially in Chapters 3 and 19. In some cases, putting them together in a chart may be misleading, because they are not precisely the same. In general, the UNIX System commands take many more options and are more powerful than their DOS counterparts. For example, the UNIX cp command copies files like the COPY command does, but the UNIX ls command allows you to do a little more than the DIR command under DOS.

Command-Line Differences

The differences between how DOS and the UNIX System treat filenames, pathnames, and command lines, and how each uses special characters and symbols, can be confusing. The most important of these differences are noted here:

§ Case sensitivity DOS is-by nature-not case sensitive (except if your system supports long filename capabilities). You may type commands, filenames, and pathnames in either uppercase or lowercase, and they will act the same (e.g., the commands DIR and dir will both list the current directory and myfile and Myfile are treated as the same file). However, the UNIX System is sensitive to differences between uppercase and lowercase. The UNIX System will treat two filenames that differ only incapitalization as different files (e.g., file1 versus File1). Two command options differing only in case will be treated as different; for example, the –f and –F optionstell awk to do different things with the next entity on the command line.

§ Backslash, slash, and other special symbols These are used differently in the two operating systems. You need to learn the differences to use pathnames and command options correctly See Table 18–2 for an understanding of the differences in structure.

Table 18–2: Differences in Syntactic Use of Slash, Backslash in DOS and UNIX

Name/Function

DOS Form

UNIX Form

Directory name separator

C:\SUE\BOOK

/home/sue/book

Command options indictor

DIR/W

ls –x

Path component separator

C:\BIN;C:\USR\BIN

/bin:/usr/bin

Escape sequences

Not used

\n (newline)

§ Filenames In earlier versions of DOS, filenames consisted of up to eight alphanumeric characters, followed by an optional dot, followed by an optional filename extension of up to three characters. Newer versions support something called long filenames, where the name can be up to 255 characters (or longer for some versions of XP). There still is a three-character limit on file extensions (see next entry)-since DOS uses the file extension to determine the type of file in many cases (and thus which program to associate it with). DOS filenames can have multiple dots; but if DOS detects a dot in the filename, it tries to interpret the next three characters after the last dot as the file extension. UNIX System filenames can have up to 256 characters and can include almost any character except “/” and NULL. UNIX files may have one or more dots as part of the name, but a dot is not treated specially except when it is the first character in a filename.

§ Filename extensions In DOS, specific filename extensions are necessary for files such as executable files (.EXE or .COM extensions), system files (.SYS), and batch files (.BAT), as well as Windows files used by applications (such as .DOC, .PPT, .DLL, and .AVI). In the UNIX System, filename extensions are optional and the operating system does not enforce filename extensions. Some UNIX utilities, though, use filename extensions (such as .tmp, .h, and .c).

§ Wildcard (filename matching) symbols Both systems allow you to use the * and ? symbols to specify groups of filenames in commands; in both systems the asterisk matches groups of letters and the question mark matches any single letter. However, if a filename contains a dot and filename extension, DOS treats this as a separate part of the filename. The asterisk matches to the end of the filename or to the dot if there is one. Thus, if you want to specify all the files in a DOS directory, you need *.*, whereas the UNIX equivalent is *. The UNIX System also uses the [] notation to specify character classes, but DOS does not.

Setting Up Your Environment

Both DOS and the UNIX System make use of startup files that set up your environment. DOS uses the CONFIG.SYS and AUTOEXEC.BAT files. The UNIX System uses a file called .profile. In order to move from Windows to the UNIX System, you need to know something about these files. In particular, you will need to understand how entries representing devices and services added under the Windows Control Panel are added to either the AUTOEXEC. BAT file or the CONFIG.SYS file, or both. You will also need to understand how the .profile file sets up certain aspects of your environment that affect how the UNIX shell is started up (see Chapter 4).

Creating the DOS Environment When you start up a Windows machine running DOS, it runs a built-in sequence of startup programs, ending with CONFIG.SYS and AUTOEXEC .BAT if they exist on your hard drive (or a floppy that you are using to boot from). The CONFIG.SYS file contains commands that set up the DOS environment-such as FILES and BUFFERS, and some device drivers-which are TSR (terminate and stay resident) programs that are necessary to incorporate devices into the DOS system. Other devices are managed directly by Windows configuration files and do not become part of CONFIG .SYS. You can also specify that you wish to run a shell other than COMMAND.COM.

The AUTOEXEC.BAT file can contain many different DOS commands, unlike CONFIG .SYS, which may only contain a small set of commands related to your machine configuration. In AUTOEXEC.BAT you can display a directory, change the working drive, or start an application program. In addition, you can create a path, which tells DOS where to look for command files-which directories to search and in what order. You use a MODE command to set characteristics of the printer, the serial port, and the screen display You use SET to assign values to variables, such as the global variables COMSPEC and PROMPT.

Most of the previous functions are now handled by Windows automatically when it boots up, based on a file called the Registry, as well as internal settings of devices stored in the Control Panel. You can, however, usually see these activities happening by pressing the ESC key when your Windows screen first appears. This method is especially useful if you suspect that something has happened to your Windows system that is making it work incorrectly For example, you may not have sound coming out of your speaker. By looking at the actual DOS commands and environment setting routines that are being executed, you may discover that a specific device-such as the audio card that you are depending on-has a problem, and the driver for it is not being loaded at boot time.

Setting Up the UNIX Environment In a UNIX system, the hardware-setting functions (performed by CONFIG.SYS and the MODE command on a DOS system) are part of the job of the system administrator. These and other administrative tasks are described in Chapters 13 and 14.

Both systems use environmental variables such as PATH in similar ways. In the UNIX System, your environmental variables are set during login by the system and are specified in part in your .profile file. Your UNIX .profile file corresponds roughly to AUTOEXEC .BAT on DOS. A profile file can set up a path, set environmental variables such as PORT and TERM, change the default prompt, set the current directory, and run initial commands. It may include additional environmental variables needed by the Korn shell, if you are running this. On a multiuser system, each user has a .profile file with his or her own variables.

Basic Features

Some of the fundamental features of the UNIX System include standard input and output, pipes and redirection, regular expressions, and command options. Most of these concepts are found in DOS also, but in DOS they are relatively limited in scope. In the UNIX System they apply to most of the commands; in DOS they are only relevant to certain commands.

§ Standard I/O The concept of standard input and output is part of both systems. In both systems, the commands take some input and produce some output. For example, mkdir takes a directory name and produces a new directory with that name. sort takes a file and produces a new file, sorted into order. In the UNIX System, certain commands allow you to specify the input and output, for example, to take the input from a named file. If you do not name an input file, the input will come from the default standard input, which is the keyboard. Similarly the default standard output is the screen. This concept is relevant for DOS also. If you enter a DIR command in DOS, the output will be displayed on your screen unless you send it to another output.

§ Redirection Redirection is sending information to a location other than its usual one. DOS uses the same basic file redirection symbols that the UNIX System does: < to get input from a file, > to send output to a file, and >> to append output to a file. An important difference is that DOS sometimes uses the > symbol to send the output of a file to a device such as a printer, whereas the UNIX System would use a pipe. For example, the DOS command

C:\> dir > prn

sends the output of the dir (directory) command to the printer. The UNIX System equivalent would be the following pipeline:

$ ls lp

§ Pipes Both systems provide pipes, used to send the output of one command to the input of another. In the UNIX System, pipes are a basic mechanism provided by the operating system, whereas in DOS they are implemented using temporary files, but their functions are similar in both systems.

§ Regular expressions The concept of regular expression is used by many UNIX System commands. While the Search routine in DOS is limited to asterisks and question marks in searching files and folders, there are some counterparts in DOS in the JScript and VBScript routines. Regular expressions are string patterns built up from characters and special symbols that are used for specifying patterns for searching or matching. They are used in vi, ed, and grep for searching, as well as in awk for matching.

§ Options Most UNIX System commands can take options that modify the action of the command. The standard way to indicate options in the UNIX System is with a minus sign. For example, sort –rindicates that sort should print its output in descending rather than ascending order. Options are used with DOS commands, too. They are called command switches and are indicated by a slash. For example, DIR /P indicates that DIR should list the contents of the directory one page (screen) at a time, which comes in handy when you are looking at large directories. The concept is the same in both systems, but options play a more important role in normal UNIX System use.

Similarities Between UNIX and Windows

UNIX and Windows both provide many useful features for their users. Original versions of Windows increased the ease of use of the GUI but did not do much to improve performance and services. Windows NT was the first Microsoft Windows-based system to do so. Newer Windows versions such as Windows 2000 and Windows XP have greatly improved multitasking capabilities and networking services.

Here are a few ways in which UNIX and Windows are the same: Both UNIX and Windows can be loaded on a PC as a client that accesses a server. Additionally both can be loaded onto a server and provide services such as printing and file serving for their clients on a network. UNIX and Windows are true multitasking machines; that is, you can perform multiple tasks simultaneously UNIX and Windows both provide management of your processes through a GUI interface (Microsoft calls it the Task Manager). Both UNIX and Windows can provide a full suite of networking tools and applications to allow connections to other machines, and software to allow sharing of files across the network. Finally, both UNIX and Windows have strong built-in security features that keep unwanted intruders out.

Networking UNIX and Windows Machines

Many networked computing environments include both Windows and UNIX System machines. When you work in such an environment, there are many reasons for using the two systems together. You will probably want to transfer or share files between one system and the other, and you may also want to log in to a UNIX System computer from your Windows PC. We will discuss some of these concepts in the next sections. A number of networking capabilities are available that help you to link Windows PCs and UNIX System computers. In fact, one of the most popular-TCP/IP-is the network technology that has made the Internet flourish, since it is the backbone of the Internet.

In addition to the following brief discussion, this concept is further discussed in detail in Chapters 15 and 10.

You can provide TCP/IP services on your Windows PC so that it can carry out networking tasks with other computers running TCP/IP software, including computers running UNIX. These can be connected to the PC by an Ethernet LAN. You can even set up a simple SLIP (Serial Line Internet Protocol) or PPP (Point-to-Point Protocol) connection for basic Internet access (this is discussed further in Chapter 9).

In order to use TCP/IP, a Windows user must define the protocol to the system via the Control Panel. The Networks setting allows you to add the TCP/IP service for dial-up networks as well as directly connected ones, as in a LAN.

Providing your Windows PC with TCP/IP capabilities allows you to use Internet services and applications. You can also exchange electronic mail with other computers running TCP/IP software, including using SMTP (the Simple Mail Transfer Protocol). You can log in to another TCP/IP system using the telnet command. You can transfer files to and from other TCP/IP systems using the ftp or tftp command.

Terminal Emulation

Terminal emulation is a way to make your Windows PC look like a simple asynchronous terminal. Using your Windows PC as a terminal is a simple way to allow you to connect to a UNIX machine. You can then input commands from your PC’s keyboard and receive output display on your PC screen. Microsoft provides two built-in terminal emulators, HyperTerminal (for dial-up connections) and the telnet client (for direct LAN connections). In addition, there are a number of third-party software packages that provide terminal emulation services on Windows machines.

Logging In to Your UNIX System from Your PC

A simple way to use DOS and the UNIX System together is to treat them as two distinct systems, and to simply access the UNIX System from your personal computer using a terminal emulation program to turn your PC into a UNIX System terminal. You can run whatever programs are important to you in a Windows environment and turn your personal computer into a UNIX System terminal when you wish to log in to your UNIX System.

When you run a terminal emulator, your personal computer becomes a virtual terminal. You do not have access to most features of Windows and cannot run most Windows application programs while using the emulator without escaping the emulator environment and going back to Windows. However, you can run selected commands that manipulate files, like COPY, RENAME, and ERASE. These commands are usually preceded by some command to let the emulator recognize it as a DOS command.

You can also do simple file transfers. Most terminal emulators have features that allow you to upload files to your UNIX system from the personal computer, and to download files from your UNIX system to your personal computer. Numerous terminal emulators are available for Windows machines, some of which come packaged together with an operating system environment. The next section briefly discusses the use of telnet, Dial-Up Networking, and an example of a commercially available product called NetTerm as ways to access UNIX machines.

Microsoft Windows Terminal Emulators

To access your UNIX machine, you need to establish a connection between your PC and the UNIX machine you want to connect to. The type of connection you establish depends on whether you are on a LAN (local area network), or remote (not directly connected). Microsoft has implemented both ways of accessing remote computers, including UNIX machines, as part of its environment. In particular, Microsoft includes a built-in telnet function for connecting to another machine over a LAN and a service called Dial-Up Networking for connecting over a phone line. Both of these are discussed in the next sections.

The Microsoft terminal emulation programs lack some important features, so other vendors, such as InterSoft International, have created third-party applications that run as terminal emulators on Windows machines, such as NetTerm, which provide richer feature sets than the standard Microsoft software.

Using telnet to Access Your UNIX System

The telnet application allows you to connect one machine to another machine using the TCP/IP protocol, regardless of the operating systems on the machines.

If you are connected to a LAN, you can access a UNIX machine simply by using the built-in telnet application on your Windows machine. There are three ways to access the program. The first is to use your Start bar and select the Run icon. You can then type in a command such as:

telnet 152.99.196.84

which will open up a telnet connection to the UNIX machine at that address on your LAN. If you have a DNS name for the machine (see Chapter 17), you can alternatively type its name, for example, to connect to the machine named hoviserve:

telnet hoviserve

Another way is to access telnet via your web browser. Selecting a URL that begins with the string “telnet://” displays the same telnet session window as in the previous two methods.

Once you have opened up the telnet session, you log in to your UNIX machine by supplying your login ID and password as normal.

Using Dial-Up Networking to Access Your UNIX System

If you are accessing your UNIX system remotely (not on a LAN), you need to establish a dial-up connection. Windows has a feature called Dial-Up Networking that allows you to do this. To set up an icon to allow you to connect to a UNIX machine, you need to know a few things ahead of time. You need to know the dial-up number for the system you want to access, and some information about where you are calling from and what type of phone service you have (for instance, does it include call waiting). You also need to know what speed modem you are using, and which COM port it is connected to. After selecting the Network and Dial-up Connections header from the ones available under My Computer, you complete the information fields on the pop-up window (note that this is the same function as HyperTerminal). When they are complete, you are asked to save the configuration in a file. You should give the file a unique name, one that describes the UNIX system to which this information pertains, such as the computer name (for instance, flipper, if your UNIX machine name is flipper). You should then move this file to your desktop, so that it is available for use without your having to hunt for it.

To connect to a UNIX system from your Windows environment, select the Dial-Up Networking icon that is associated with that particular system (you may have multiple icons and multiple configuration settings for each UNIX system that you connect to) and use the pop-up windows that appear to automatically dial for you. Once you are connected, go through the usual UNIX System login procedure.

Using Packages Such as NetTerm to Access Your UNIX System

Third-party applications perform the same basic connecting functions as the built-in Microsoft ones but provide more flexibility in configuration and options that are not available with the Microsoft telnetimplementation. One such package is NetTerm, by InterSoft International. NetTerm allows you to create and maintain a phone directory of many machines, each of which may have different characteristics. For instance, you can configure your desktop look (number of lines, number of lines to scroll, line width, and so on). You can also configure the keyboard mappings. This is especially useful if you want to use keys that are not part of the standard ones you normally use in typing. Figure 18–1 shows a sample configuration.

Image from book
Figure 18–1: A sample NetTerm screen

Once you have such a package installed and configured, you can store it on your desktop so that it can be run by double-clicking the associated icon.

Running Windows Applications and Tools on UNIX Machines

If you are used to running applications under the Windows environment, you can do so on UNIX machines. You may run a Windows emulator, which is an environment that is made to look like the familiar Windows one (it emulates it). You may also take advantage of tools that have been developed on UNIX machines to perform the same functions as their Windows counterparts, thus eliminating the need to have two separate environments on your machine that you must switch between to perform different tasks. Newer emulators are beginning to add richer features that do more than just emulate an environment; they actually take features from the Windows environment and implement them on UNIX machines in their native mode. This allows Windows users to perform tasks on UNIX machines exactly as they would perform them on their Windows machines.

There are two types of emulators: software and hardware. The next section discusses some of the software emulators that are available. VMware, which is a hardware emulator, is discussed later on in this chapter.

Running DOS and Windows Emulators Under UNIX

Emulators are available that enable you to run both DOS and Windows programs under UNIX. While DOS and Windows emulation is not heavily used except by experienced users, it is still worth mentioning for those who wish to take advantage of it. In addition to reducing the overhead cost of running two separate machines, or requiring dual booting to access features from one environment or the other, emulation allows UNIX users to run Windows environments only when needed.

Win4Lin

Win4Lin (http://www.win4lin.com/) is a Windows 2000 and XP (and even Windows 98) emulator running on the Linux platform that takes an interesting approach to Windows emulation. It is very tightly integrated with the Linux host operating system. For example, Win4Lin uses the Linux file system instead of creating a real or virtual FAT file system. It also makes certain parts of the install shared among all users of the machine, so there can be only one version of Windows installed on a Win4Lin machine (VMware can have multiple Windows installations-all different versions-installed and running at the same time). Due to the architecture, Win4Lin files are directly accessible from Linux, even when the emulation isn’t running.

DOSemu

DOSemu is a DOS emulator that is available for Linux systems from the web at http://dosemu.sourceforge.net/. This Linux application typically comes with sample configuration files called config.dist that are used to help build your dosemu.conf file, which is the configuration file that you use for your particular version of Linux. You can create a bootable floppy disk using the mcopy command, which is available as part of Linux distribution. Copy the command.com, sys.com, emufs.sys, and exitmenu.com files (and the ems.sy.cdrom.sys file, if you have a CD-ROM on your system) to the floppy This allows you to boot up your Linux machine in DOS emulation mode.

Wine

The Wine emulator is a very popular Windows emulator for some UNIX variants. It runs on most of the versions of UNIX that run on Intel platforms, including Linux and Solaris. Wine started as a project in 1993, to support running Windows 3.1 programs under Linux. It has matured to support both 16-bit and 32-bit application environments, such as Windows 2000 and XP (Win32 applications). Its primary function is to convert Windows functions to X Window functions that are similar, using C language code instead of Microsoft code to do so. It has reached maturity with the current version 0.9.14 being released in May 2006. Many groups are developing new features for it. Some of the things that have been developed include support for sound devices, Winsock TCP/IP (a Windows service), modems, and serial devices. The code, extensive documentation, and tools to develop Wine are all available at http://www.winehq.com/, which is the official headquarters site, and whose symbol is a tilted wineglass.

RUMBA

RUMBA is a suite of applications from NetManage (http://www.netmanage.com/). RUMBA is a product that allows you to run an environment that can connect you to multiple server machines over TCP/IP by using ActiveX objects. The objects are optimized for Microsoft’s 32-bit desktop platforms, such as Windows 2000 and XP. Many versions of this product are available, based on the type of client as well as the host to which you want to connect. The product is available for a range of UNIX platforms.

Sharing Files and Applications Across UNIX and Windows Machines

Ways are available for accessing Windows files and applications from within the UNIX operating environment, or for accessing UNIX files from within the Windows environment. One such way is to use a TCP/IP utility such as ftp to transfer files from one machine to the other. A second way is to use a Windows-based application that is an enhancement of ftp to perform a file transfer from one machine to the other. A third way is to treat a remote UNIX file system as though it were local to your Windows PC network, via a product such as Samba. A fourth way is to set up a virtual network among different machine environments using Virtual Network Computing (VNC). This section discusses each of these methods.

Accessing Your UNIX Files from a Windows Machine

Many computing environments include machines running Windows and UNIX together. When you work with both, you may need to transfer files from a Windows system to a UNIX system or from a UNIX system to a Windows system. You may also want to log in to a UNIX system from your Windows PC to access files using terminal emulation, which was discussed previously Or you may want to share files on Windows machines and UNIX machines. This section describes some capabilities that provide Windows-to-UNIX System networking.

Transferring Files from Windows to UNIX Using ftp

One of the primary reasons for connecting your Windows PC to a UNIX machine is to transfer files between the two. You can send files from your Windows PC to your UNIX machine, and vice versa, by using one of the commercially available packages such as WS_FTP on your Windows machine (see Figure 18–2). WS_FTP is a software package interface to the Windows TCP/IP service, called WinSock (for Windows Sockets), that allows you to use a Windows interface to perform FTP operations from one machine to the other. You simply locate the source file on one machine, move to the appropriate directory in which you want to place the file on the other machine, select whether you want the transfer to be binary (as for program files) or ASCII (text files), and select an arrow showing in which direction the transfer is desired. WS_FTP Pro supports long filenames for Windows. You can get WS_FTP or WS_FTP Pro directly from the vendor, Ipswitch, Inc., via the web at http://www.ipswitch.com/.

Image from book
Figure 18–2: A sample WS_FTP session

Another way that a Windows machine can share files with a UNIX System computer is via a simple local area network connection. Using such a configuration, the Windows machine can be a client of the UNIX system, which acts as a server. This allows Windows to share files with UNIX systems using facilities such as ftp. The ftp command is discussed in detail in Chapter 9.

A third way exists to share files between Windows machines and UNIX machines across a network. Both Windows and UNIX allow you to share files using the Network File System (NFS). This concept is discussed in more detail in Chapters 15 and 17. One useful feature of NFS is that you can set up the system to allow a machine that is acting as a file or print server for a client machine to become a client itself, accessing resources on another server. This resource pooling concept makes NFS a powerful file sharing environment. NFS implementations for use on a Windows machine can share files with a UNIX machine, and versions that run on UNIX machines can share files with Windows machines. The implementations for both UNIX and Windows machines are generically called PC/NFS.

Using Samba to Share and Print Files on Different Operating Systems

If you are a Windows user on a network that is constantly connected to a particular UNIX machine, you may need to access or print files that are on the UNIX machine to use in your local applications on your Windows machine. Rather than learn how the UNIX file system works in order to locate and manipulate files, you may want to use an application that allows you to access the files and manipulate them as a Windows user normally does, and have them look just like Windows files to you. The same is true for UNIX users that need to access and print files on a Windows machine.

Samba is an open-source software suite that is available on the web at http://www.samba.org/ through the GNU public license. Mirror sites are available worldwide for both the documentation and the software downloads. Samba was originally developed by Andrew Tridgell but has become a joint project of the Open Source team for Samba. The name Samba is derived from the functionality of the software. The protocol used is the equivalent of what Microsoft refers to as the NetBIOS protocol (also called the Common Internet File System, or CIFS, protocol). This protocol on UNIX is referred to as the Server Message Block (SMB) protocol, hence the name Samba.

One of the things this protocol allows is to mount UNIX file systems so that they appear to be DOS files to a user of a Windows system, or vice versa. A UNIX user can mount a file system on a UNIX machine that is connected to a Windows PC so that it looks like a network drive when a Windows user displays drives under Explorer. For example, you can mount a file system that is called winfiles on a UNIX machine and make it appear as though it is connected as a Windows directory available on the Windows L: drive, appearing as whatever you define it on your Windows machine, say L:\win.

Whenever you perform any file activity on the Windows machine in the directory L:\win, such as creating, modifying, or deleting files, you are actually using the Samba software to perform the activity on the UNIX file called winfiles. The advantage to doing this is that a Windows user does not need to know anything about the file system structure of UNIX to actually manipulate files and directories on a UNIX machine; everything appears as though the environment is Windows. If you are a UNIX user, the same concept is true from the UNIX perspective. Files that are accessed from the Windows machine appear as UNIX files to you.

This approach is different from mounting the remote files via NFS (the Network File System), which is discussed in Chapters 15 and 17. Although the two are functionally equivalent, the NFS approach requires the installation of something called the NFS client, in order to be able to access the files on the UNIX server. On the other hand, NFS is more robust, in that you can have multiple client/server relationships in the same network (for instance, a client can be a server, and vice versa). Which one you use depends on how many Windows clients are on your network. If there are many Windows clients and few UNIX servers, you may prefer the Samba approach. If the opposite is the case, you may prefer to use NFS to share files. We discuss this issue in more detail in Chapters 15 and 17.

Samba also enables UNIX users to print files on printers connected to Windows-based print servers, and Windows users to print files on printers connected to UNIX-based print servers. While each operating system has its own rules about how to configure printers-for instance, UNIX uses the smb.conf file to configure Samba printers-you can perform essentially the same types of print requests from the other operating system’s print server once Samba is correctly configured.

Using UNIX Servers in Windows Networks

In Chapter 15, we discuss the concept of clients and servers. In particular we discuss how Windows clients can access UNIX servers to obtain services without knowing that the server is actually a UNIX machine. Here are some examples of how this can be accomplished.

UNIX Servers Acting as Windows Servers

Another way to access DOS files from a UNIX environment is offered by Sun Microsystems. Sun has a platform called PC NetLink (currently version 2.0) that allows a Sun server to sit on a Windows network and perform the functions of a Windows server (NT/2000/XP). Putting the UNIX machine in the network allows users of Windows clients to get file and print services, as well as authentication services, from the UNIX server as though it were a Windows server.

UNIX Servers Providing Transparent Services to Windows Clients

The Apache Web server (see Chapter 16) is an example of a UNIX server environment that provides complete web server functionality to Windows clients. While Microsoft has its own web server called IIS (Internet Information Services), many hybrid-network administrators choose to use the Apache Web server due to its functionality, security, portability (it runs on all versions of Windows as well as UNIX variants), and cost (Apache is free).

A Windows user requesting web services from an Apache server does not see anything different than when using IIS. This is because the user sees only the browser interface (e.g., Mozilla or Internet Explorer). Browsers and the Internet in general are discussed in more detail in Chapter 10.

Virtual Network Computing (VNC)

Virtual Network Computing was originally developed at AT&T. It consists of remote control software that allows you to view (using a program called the viewer) and interact with another computer (called the server) anywhere on the Internet. The two computers can be running different operating systems; for example, you can use VNC to view a Linux machine in your office on your Windows home computer. One of the key features of VNC is the capability to assume control of the remote networked computer as though it were your local machine. This is made possible by a technique called the RFB (Remote Frame Buffer) protocol, which transmits inputs across the network and transmits the resulting screen back to the initiating computer.

VNC has a wide range of applications, including system administration, IT support, and help desks. It allows several connections to the same desktop and can be used for collaborative (shared) work in the office environment. It also has applications in electronic classrooms. VNC is freely and publicly available. You can find more about it at either http://www.vnc.com/ or http://www.realvnc.com/.

Running UNIX Applications on DOS/Windows Machines

Just as Windows users want to feel comfortable by using Windows applications when working in the UNIX environment, UNIX users may want to be able to use familiar UNIX commands when working in a Windows environment. You can do this in a few ways. One way is use a windowing environment, such as the X Window environment, on a Windows PC. Another is to use packages that allow you to issue UNIX commands on a Windows machine. Yet another is to use tools that have been developed on UNIX for Windows environments. Finally you can run a UNIX shell environment instead of the default command.comshell environment on a Windows PC.

Running an X Window System Server on Your Windows PC

If you are a UNIX user, you may want to perform UNIX tasks from a Windows PC in a familiar environment, such as the X Window environment. You can run an X Window System server on your Windows PC that allows you to interoperate between your Windows PC and a UNIX host machine. One of the ways you can do this is to use Cygwin/X. Cygwin/X is a port of the X Window System to Microsoft Windows by the Cygwin Project (http://www.cygwin.com/). Cygwin/X consists of an X Server, X libraries, and almost all the standard X clients, such as xterm, xhost, xdpyinfo, xclock, and xeyes. It works with Windows 95, 98, ME, NT 4, 2000, and XP. You can find information about it, and get the installation software, by going to either http://www.x.cygwin.com/ or http://www.cygwin.com/.

You can find out more about running X servers on your PC by accessing the USENET and consulting the newsgroup comp.windows.x.

Using Tools to Emulate a UNIX Environment

Several programs and collections of programs let you create a UNIX System-style environment on a Windows system, as well as emulate some Windows functions on a UNIX machine. In addition to programs that emulate actual UNIX commands, there are shells that implement the Korn shell or the C shell; and other applications are available for Windows. These programs can be very helpful in bridging the gap between the two systems, because they allow you to run UNIX-like commands on your system without giving up any of the DOS/Windows applications that you already have.

If you are a Windows system user, you have several possible reasons for using “lookalike” programs that emulate basic UNIX System commands. Utilities such as awk and vi enhance your Windows environment, providing capabilities missing from DOS under Windows, as well as useful capabilities for editing, formatting, managing files, and programming. If you are a Windows user who is just learning to use the UNIX System, adding UNIX System commands to your Windows environment is a good way to develop skill and familiarity with them without leaving your accustomed system. If you move between the two systems-for example, using the UNIX System at work and a Windows PC at home-creating a UNIX System-like environment on your Windows PC can save you from the confusion and frustration of using different command sets for similar functions. If you are a UNIX user and need to access Windows resources, there are also utilities for that; the next section discusses these.

The MKS Toolkit

As operating systems, the UNIX System and Windows are similar in some ways. The UNIX System and Windows both support multiple users and multitasking. Therefore, it is possible to create a good approximation to the working environment created by the shell and the common UNIX System tools on a Windows platform. A number of software packages exist that help you do this, including the MKS Toolkit from MKS, Inc. (formerly Mortice Kern Systems at http://www.mks.com/ or mkssoftware.com/). This product has grown significantly since its initial release to include new tools and APIs, but one of the original uses that is still relevant is that it provides an implementation of the shell and basic tools that you can use on your Windows computer. Inevitably, some look-alike commands work slightly differently from the UNIX System originals, because of fundamental differences between the two operating systems. Nevertheless, you will find the look-alike tools a useful bridge between the two operating systems, and a good way to ease gently into using a UNIX System.

This discussion will concentrate on some of the more useful commands included in the MKS Toolkit. The MKS Toolkit contains a collection of more than 100 commands-that correspond to most of the common UNIX System commands, including vi, awk, and the Korn shell, as well as commands such as strings and help-that you can run on a Windows computer.

In some cases, the UNIX System tools provide an alternative to a similar DOS command. For example, cp can copy several files at once, and rm can remove several files at once. In addition, the MKS Toolkit offers commands that do not have a DOS equivalent, such as file, strings, and head. Many DOS files are in the form of binary data; the Toolkit offers file to identify them, and od and strings to examine them. Many tools such as head, diff, and grep are useful for dealing with ASCII text files.

You run the MKS Toolkit commands as you would any other DOS commands. You simply type the command name with any options or filenames that it requires. For example, to view the contents of the current directory using ls, you type the command name:

C:\> ls

The MKS Toolkit includes a help command that is particularly useful when learning to use UNIX System commands on Windows. It displays the list of options that go with each command. To use this, type helpfollowed by the name of the command, as shown here:

C:\> help ls

Experienced Windows users should refer to the chart of differences in commands between UNIX and DOS earlier in this chapter. It is easy to start out with commands like ls, pwd, or help. Next you might try file, strings, head, or od to give yourself an idea of the range of the UNIX System tools provided by MKS. You should now begin to recognize the power and flexibility that UNIX-style tools add to your Windows environment.

Other UNIX Toolkits and Applications for Windows

In addition to MKS, Inc., SourceForge provides a large number (over 100) of common GNU utilities that have been ported from UNIX to the native Win32 platform. These utilities depend on the existence of the Microsoft C-runtime routine msvcrt.dll but do not require the emulation layer provided by Cygwin/X. You can download these utilities from the Source Forge web page at http://unxutils.sourceforge.net/.

Running the Shell as a Program Under COMMAND.COM

Although you can run look-alike tools directly under the standard DOS/Windows command interpreter, COMMAND.COM, running a version of the UNIX shell on Windows can be very useful. Compared to COMMAND.COM, the UNIX shell is much more powerful and flexible, both as a command interpreter and as a programming language for writing scripts. Using the shell in place of or in addition to COMMAND.COM provides a more complete UNIX-style environment, including such valuable shell features as command-line editing and shell programming constructs. Furthermore, using the shell enables you to make use of some features of the look-alike tools that may not run properly under COMMAND.COM. One example is the capability to use commands that span more than one line, as in awk and sedcommands. The UNIX System look-alike tools include versions of the shell. The MKS Toolkit includes the Korn shell.

The easiest way to run the shell on your DOS/Windows system is as a program running under COMMAND.COM-that is, you continue to use COMMAND.COM as your normal command interpreter, and when you want to use the shell, you invoke it as you would any other command.

To run the shell using the MKS Toolkit, type the following at the DOS prompt:

C:\> Sh

$

You will see the UNIX System prompt, which is by default a dollar sign. You then enter commands, with their options and filenames, just as you would in a UNIX System environment. For example, using shrather than COMMAND.COM you can enter multiline arguments on the command line, which you need for awk and other commands. To exit the shell and return to COMMAND.COM, type exit.

This way of running the shell does not replace COMMAND.COM; it simply uses COMMAND.COM to run sh, which then acts as your command interpreter. This has the advantage of providing the most completely consistent DOS environment, for example, when a program requires you to use the DOS-style indicator for command options (slash), rather than the minus sign used on the UNIX System and by the shell. If you run the shell under COMMAND.COM, you can simply exit from the shell in order to run these particular programs.

If you want to execute the DOS equivalent of a .profile (similar to the environment set up in your AUTOEXEC.BAT) when you start the shell, you can invoke it with the −L option:

C:\> Sh −L

$

This will set up any environmental variables you choose to specify in your profile.ksh file.

Replacing Command.Com with the Shell

If you want to emulate a UNIX System environment as fully as possible, replace COMMAND .COM with the shell as your default command interpreter. With this approach you do not use COMMAND.COM at all. This has the advantage of being most like a UNIX System environment. It even allows you to set up multiple user logins. It does not allow simultaneous use by more than one user, but it does permit each user to run under a customized environment-for example, with a different prompt or PATH. The disadvantage of this method is that you can no longer easily exit to COMMAND.COM, because it is not set up as your underlying shell. If you want to run a DOS program that demands the slash as a marker for command switches instead of the backslash, you may have to write a shell script to switch back and forth for this application. As another example, you may lose access to certain DOS commands that are built into COMMAND.COM rather than provided as separate programs.

Some frequently used DOS commands, such as DIR and TYPE, are internal, which means that instead of being separate executable commands, they are part of COMMAND.COM. If you are using the shell, it cannot call them directly In order to use these commands, you must set up an alias for them using the alias command.

If you use the shell as your command interpreter, put a command in your CONFIG.SYS file to tell the system to bypass COMMAND.COM and go directly to the shell or to an initialization program that allows multiple user logins. If you choose the initialization program, the system will set up multiple user logins, each one with its own environment. The documentation for the specific toolkit products such as MKS Toolkit will help you choose and set up the various possible configurations.

Setting Up the Environment for Utilities on DOS

Whether you replace COMMAND.COM with the shell or whether you run the shell as a program under COMMAND.COM, you must set up the proper working environment. The choice between these alternatives will determine how you set up the MKS system on your computer. Setting up the environment is tricky because MKS needs some of the environment of both operating systems. It needs to have certain DOS environmental variables set properly, and it sets up a profile.ksh file to correspond to a UNIX System .profile file. You need AUTOEXEC.BAT to set variables like PATH, ROOTDIR, and TMPDIR, which MKS requires in order to run properly If you run under COMMAND.COM, the system will start with AUTOEXEC.BAT to set the other environmental variables. The AUTOEXEC. BAT file can also include the SWITCH command to allow you to specify command options with a minus sign and to use slash as the separator in directory pathnames.

UNIX Kernel Built-in Capabilities

In addition to third-party software tools that let you emulate DOS or UNIX environments, the UNIX kernel itself can be used for simultaneous access to both DOS and UNIX. Although you cannot run DOS executables without some type of software emulation, you can mount DOS file systems directly from the kernel and access DOS devices directly You can then manipulate the contents of the devices directly For example, you can copy move, and delete data on DOS devices directly from the kernel.

Running UNIX and Windows Together on the Same Machine

Terminal emulation and networking allow you to work on your PC and access a UNIX system on a separate computer. This concept is discussed more in Chapter 15. Running UNIX System look-alike software (such as MKS Toolkit) on DOS brings some of the commands of the UNIX System to a Windows environment. However, you may want to have complete Windows and UNIX environments on the same machine for specific computing requirements. You can do this by allocating your disk so that Windows and UNIX each have their own areas on the disk.

Partitioning a Hard Disk for Use by both UNIX and Windows

One way to have access to both systems on the same machine is to create two separate partitions on your hard disk: one for the UNIX System and one for Windows. Within either partition you run the corresponding operating system and have all of its normal features. You can use a UNIX System application at one moment, and then switch over to the Windows partition and run a Windows application.

This approach allows you to use both systems, to move between them, and to have all of the normal features of the system you are using at the moment. Unfortunately, for most UNIX variants, it is cumbersome to move from one operating system partition to the other. To do so you have to switch partitions, shut down the current system, and start up (boot) the other.

If you are using the UNIX System and want to move to Windows, you begin by selecting the active partition on your machine. Similar to using FDISK for partition management on Windows machines, you use the UNIX fdisk command, which brings up a menu that you use to change the active partition. (Note that to use fdisk you have to have superuser permission.) For example,

$ su

Password:

# fdisk

Hard disk size is 4035 cylinders

Cylinders

Partition Status Type Start End Length %

========= ====== ==== ===== ===== ====== ===

1 FAT32 0 1181 1182 31

2 Active UNIX Sys 1182 4034 2852 69

SELECT ONE OF THE FOLLOWING:

1. Create a partition

2. Change Active (Boot from) partition

3. Delete a partition

4. Exit (Update disk configuration and exit)

5. Cancel (Exit without updating disk configuration)

Enter Selection: 2

Enter the number of the partition you want to boot from

(or enter 0 for none): 1

This sets the computer hardware so that the next time you boot, it will start up in the DOS partition.

After changing the active partition, shut down your UNIX System. To shut down the system, follow one of the methods described in Chapter 13, using either the menu-based system administration commands or the command-line sequence. If you boot the system following the previous steps, it will come up running DOS in the DOS partition.

In addition to the complexity involved in moving between two systems this way, using separate partitions for each system has some important limitations because each partition with the programs and files it contains is independent of the other. In most cases, without special software, you cannot directly move files or data between partitions, and you cannot send the output of a DOS command to a UNIX System command.

VMware

VMware (http://www.vmware.com/) is a virtual machine environment that is fast becoming the de facto standard for operating system emulation. VMware allows Windows (and other operating systems) to coexist on the same physical Linux machine without partitioning, through hardware emulation. Hardware emulation is where each operating system has its own virtual area on a system that consists of a processor, memory, disks, and I/O devices. All devices are accessed through the underlying host operating system, and the file system may be a virtual drive that is contained in a file. It may directly access one or more standard File Allocation Table (FAT) 16 or FAT 32 partitions. All access to Linux file systems is done through Samba open-source file and print server software, which supports Windows clients. (A “lite” version of Samba is included.)

VMware can support multiple operating systems on the same machine, depending on the features of the machine: the more memory and disk space and the faster the processor you have, the better chance you have of running multiple operating system sessions. However, only one operating system can be designated as the host operating system. All of the others run as guests on the virtual machine.

Each operating system has its own group of configuration files that must be loaded initially with the operating system. While VMware supports a wide range of devices and options, you need to plan your requirements carefully to ensure that the configuration you end up with is a useful one. Once the operating system is loaded, you can then load VMware Tools to help manage the virtual machine environment.

One of the problems that VMware solves is the need to perform dual booting. Dual booting is an environment where each operating system on the machine has its own partition and set of instructions as to how the operating system should be loaded. Linux users should be familiar with the LILO boot loader, and Windows users with the NTLDR boot loader. In order to move between the two environments, the machine must first be shut down from the first environment, and then rebooted to the new environment. While this is acceptable for occasional movement from one operating system to the other, it becomes bothersome to do this frequently VMware allows faster switching from one environment and-if your machine has enough physical resources-can actually leave the operating system that you designate as the host operating system running while you move to the other environment.

VMware is available as a commercial product but also comes with a few Linux distributions that include the VMware product as part of the install. Therefore, you have the choice of installing VMware on the distribution of your choice or using their prepackaged distribution.

A Simple Solution for Sharing UNIX and Windows Environments

The solutions for using UNIX and Windows together discussed in this chapter are designed to give you a clearer picture of the variety of ways that you can share these two environments. Many of them depend on software additions to one platform or the other.

If you decide-after reading this chapter-that you want to keep your UNIX software environment separate from your Windows software environment, there is a very simple way to access them simultaneously Say you have just invested in two separate machines that run the latest operating system environments, for instance, Fedora Core 5 Linux on one machine and Windows XP on the other. You like to work in both environments, and-at times-like to switch back and forth to perform tasks on one machine while the other is running a long process.

A simple way to accomplish this is to use a common keyboard, video display monitor, and mouse connected to each machine’s CPU through a device called a KVM switch (for Keyboard, Video, and Mouse). A KVM switch has connections on it that allow multiple input and output options. Your connections from a common keyboard and mouse go into the switch and connect to the input ports of both of your CPUs. The video output ports of both of your CPUs go back through the switch to a common video monitor. After booting up one machine using the switch setting associated with it (say A), you can boot the other machine using its associated switch setting (say B). From this point on, you can switch back and forth between the two machine environments and perform the tasks you need to.

Summary

You might wish to use Windows and the UNIX System together for any of many reasons, and these operating systems can be made to work together in many ways.

We began by describing how Windows is a graphical user interface to DOS much as CDE, KDE, and GNOME are graphical user interfaces to UNIX. We then described some similarities and differences between how the DOS command-line environment under Windows is used in comparison to command-line environments under UNIX.

Among the techniques that we have shown is using PC software to emulate a Windows environment under UNIX. We described how to build environments that allow the use of familiar commands for either the Windows or the UNIX environment, and how to use software such as Samba to access and print UNIX files as though they were Windows files. We addressed running the UNIX System and Windows on the same PC. We also briefly addressed the issues of file transfer and networking Windows and UNIX machines together. These last two issues are discussed in much greater detail in Chapters 9 and 15.

We conclude by suggesting that your method of sharing UNIX and Windows environments depends on what you need to do when you share the environments.

How to Find Out More

Here are some useful books, journal articles, and online locations that cover the topic of Windows and UNIX working together.

Books on Using Windows and UNIX Together

Here are some useful books to help Windows users become proficient in the UNIX environment quickly, through understanding shells and tools, simple system administration for multiuser systems, and text processing utilities. These books are also helpful for UNIX users wishing to understand the Windows environment better. Although some are written for Windows NT, since the NT philosophy has migrated to newer operating systems such as Windows 2000 and XP, a lot of the information is still relevant.

· Burnett, Steve, David Gunter, and Lola Gunter. Windows2000 & UNIX Integration Guide. Berkeley, CA: McGraw-Hill/Osborne, 2000.

· Harvel, Lonnie, et al. UNIX and Windows 2000 Handbook: Planning, Integration, and Administration. Upper Saddle River, NJ: Prentice-Hall PTR, 2000.

· Henriksen, Gene. Windows NT and UNIX Integration. New York: Macmillan Technical Publishing, 1998.

· Williams, G. Robert, and Ellen Beck Gardner. Windows NT & UNIX: Administration, Coexistence, Integration, & Migration. Reading, MA: Addison-Wesley, 1998.

The following books are both useful in understanding how the Server Message Block architecture is used in Samba to share files between Windows users and UNIX servers:

· Smith, Roderick W. The Definitive Guide to Samba-3. Berkeley, CA: Apress, 2004.

· T’s, Jay, Robert Eckstein, and David Collier-Brown. Using Samba. 2nd ed. Sebastopol, CA: O’Reilly Media Inc., 2003.

· Terpstra, John H. Samba-3 by Example: Practical Exercises to Successful Deployment. Upper Saddle River, NJ: Prentice-Hall PTR, 2004.

Here are some useful books on VMware:

· Bastiaansen, Rob. Rob’s Guide to Using VMware. 2nd ed. Leusden, the Netherlands: Books4brains, 2005.

· Compton, Jason. VMware 2 for Linux. Rocklin, CA: Prima Publishing, 2000.

· Ward, Brian. The Book of VMware: The Complete Guide to VMware Workstation. San Francisco, CA: No Starch Press, 2002.

Journals That Cover Using Windows and UNIX Together

A number of periodicals devoted to the Windows PC environment also address the issues of Windows and UNIX working together in client/server environments. Here is a list of a few of the more popular ones:

· ComputerWorld, an IDG (International Data Group) publication

· PC Computing, a Ziff-Davis publication

· PC Magazine, a Ziff-Davis publication

· PC Week, a Ziff-Davis publication

Online Information About Using Windows and UNIX Together

The Internet is an extremely useful tool to find information about topics concerning using Windows and UNIX together. Included in the topics covered in this chapter are references to some helpful sites to find out more about specific topics, such as emulators, toolkits to run Windows commands on UNIX and vice versa, sharing files and printers, and networking Windows and UNIX machines together.

If you want more information on comparisons between UNIX and DOS commands, see the page at http://yolinux.com/TUTORIALS/unix _for_dos_users.html.