Chapter 3: Virtual Machines Emulators

Throughout this book we cover tools for many different operating systems. To use the full gamut of tools, many users build workstations with multiple operating systems installed on them. If they are running Windows and need to use a Unix tool, then a quick reboot puts them in a Unix environment. This seems like a satisfactory solution, but loading more than two operating systems can get tricky. Making several operating systems coexist and cooperate peacefully on the same system can sometimes be difficult because of partitioning issues on your hard drive. Also, continuous reboots to switch operating systems is a hassle.

VMWARE

VMware Workstation enables you to run multiple operating systems concurrently. You need install only one operating system to serve as the host (either Windows or Linux). VMware allows you to create virtual, or guest, machines to run an operating system on virtual hardware.

You can "power on" a virtual machine and you'll see the operating system's familiar boot sequence within VMware, just as it would on real hardware. The virtual machine supports almost any operating system that installs on Intel-based hardware, from DOS 4.1 to Windows to Linux to FreeBSD. Creating a new virtual machine merely takes up disk space on your host system; no partitioning or modification of boot sectors is necessary.

Download and Installation

Although this book exhibits a heavy bias towards free (and open -source) tools, VMware is a commercial product available for download at http://www.vmware.com/. You can register with VMware for a 30-day trial license key. The download for version 5.0 is a bit hefty, weighing in at around 6070MB depending on which operating system you choose for the host.

Windows Host Install

Once you've obtained VMware's setup program from the web site or from CD, the Windows installation process is rather simple. VMware wants to disable the CD-ROM Autorun feature because it may interfere with guest systems. As a general practice, it's a good idea to disable CD-ROM Autorun unless you trust the creator of every CD you put in your computer. Allowing Autorun to blindly run an application on a CD (that may or may not be trustworthy) is equivalent to executing an unknown e-mail attachment. Given these two reasons, you should probably click Yes.

Tip 

VMware Workstation is officially supported on Windows (NT, 2000, or XP) and Linux platforms; however, you can also run VMware on Unix systems that support Linux emulation (like FreeBSD). The OS on which VMware is installed is called the host OS.

VMware installs some network utilities that help manage virtual machines. Since the virtual machines under VMware are supposed to behave like individual systems, each virtual machine needs to have its own network adapter and IP address. VMware has several different networking options, which we'll cover later.

Linux Host Install

VMware is mostly agnostic towards Linux distributions; the real constraint is the kernel version of the host. VMware should run on the most recent 2.4 and 2.6 versions. If the install process does not detect a precompiled module for your Linux flavor and kernel version, then it prompts you to compile one on the fly. Make sure you have the kernel source installed. The kernel source will have to at least be configured identically to the kernel into which you're installing VMware. This doesn't mean you'll necessarily have to recompile your kernel. Mandrake, for example, places its kernel's config text files in the /boot directory. Look for a file like config-2.6.11-6mdk-i686-up-4GB or whatever matches your system's uname a command output.

Configuration

VMware greets you with the screen shown in Figure 3-1. You'll need a valid license key (trial keys last for 30 days) in order to create or use a VMware virtual machine.


Figure 3-1: VMware welcome screen

A virtual machine must be prepared before it can be used. Use the VM wizard to create a virtual machine's profile. The options enable VMware to select the most appropriate hardware devices to accommodate the operating system to be installed in the virtual machine. VMware will prompt you for the guest operating system you intend to install into the virtual machine. The list contains most operating systems and provides an "Other" choice if you're trying a less-known OS. The biggest reason for this prompt is so VMware can provide correct drivers to the guest system.

One important option is choosing the initial network environment that the guest operating system will see. Bridged networking sets up the guest so that it is a peer of the host system. A NAT configuration places the guest system "virtually behind" the host. It can access the network, but cannot be directly accessed from other systems on the network. Host-only networking means that the guest system can only access its host, regardless of the presence of other systems on the network. Figure 3-2 shows these options. Whatever option you choose at this step can be changed if you later decide to try a different configuration.


Figure 3-2: VMware network options

Another important consideration is choosing the disk configuration to use with the machine. Virtual disks are basically huge (multiple gigabyte) files that reside on the host's operating system. Yet to the guest operating system in the virtual machine, these files appear to be clean, new hard drives . This is typically the best option if you are testing operating systems or creating a restricted environment in which to test unknown or potentially malicious software. The other disk management choice is to use one or more partitions that already physically exist on the host computer. This option is useful for hosts that have already been configured to boot into multiple systems. The wizard provides these options, as shown in Figure 3-3.


Figure 3-3: Virtual disk management options

Once you have completed the wizard, the virtual machine's skeleton will be ready. Note that no operating system has been installed yet. At this point, the virtual machine just has a BIOS to handle the boot sequence and access the virtual hardware. Devices can be added or removed at any time, but this might impact the guest operating system. If you were to start the machine, you would see the BIOS check memory, disks, and then complain that no operating system is installed. A virtual machine, ready for a guest system, is shown in Figure 3-4.


Figure 3-4: VMware virtual machine fully configured

Before we install a guest system onto the virtual machine, let's examine the hard disk options in the Configuration Editor, accessible by clicking the Virtual Disk device. You can change the disk file that a device uses as well as size limits. By default, virtual disks are considered persistent; that is, changes to the operating system are written directly to the virtual machine. A useful feature of VMware is that you can make a disk file undoable or nonpersistent. Making a disk nonpersistent lets you wipe out any disk changes since powering on the system. You could even format the entire nonpersistent virtual hard drive and restore it to the original state at a later time. Undoable mode is probably the most popular mode, because it gives you a choice of saving changes to the disk or discarding them.

In addition to virtual hard drives, you can use the Add Hardware Wizard to create virtual floppy disks and CD-ROMs. By default, VMware will install floppy and CD devices based on the actual physical drives it finds on your system. In addition to using the physical drives, you can have VMware use floppy, CD, DVD, or ISO images. The files appear as physical disks to the guest system. They can be mounted, unmounted, written to, and ejected as any other disk. You can even take an ISO and burn it to a physical CD for use by other systems.

Implementation

Operating systems are installed into virtual machines in the identical manner they would be on real hardware. In fact, you could even run Gnoppix (covered later in this chapter) from its ISO image within VMware. One thing to note is that the VMware window won't gain the mouse or keyboard focus (accept user input) until it receives a mouse-click in the window.

Tip 

Use CTRL-ALT to release mouse control from the guest operating system to the host. If you install guest tools, then you may be able to simply move the mouse into and out of the guest.

VMware tools are a collection of drivers and utilities specifically designed for maximum performance within the guest operating system. VMware tools must be installed after the operating system is installed.

Open-Source Alternatives

If your virtual machine desires lie more with experimentation than 100 percent emulation, you may wish to check out the Bochs, plex86, or Wine projects. Bochs (http://bochs. sourceforge .net) strives for full x 86 CPU emulation. Thus, it would serve as a test environment for installing any operating system designed for the x 86 platform. It has a few drawbacks due to this. First, the project, although actively maintained , is not complete and can run only Linux, Windows 95, or Windows NT somewhat reliably. Second, the code is designed for completeness, not efficiencyguest systems will suffer noticeable performance impacts.

Plex86 (http://plex86.sourceforge.net) also aims for x 86 CPU emulation, but it takes a different route from Bochs. Plex86 focuses on the core CPU instructions necessary to run a Linux installation. Thus, performance improves at the cost of comprehensiveness.

Wine (http://www.winehq.com) does not emulate the x 86 CPU. Instead, the Wine project attempts to create a Windows API on top of Linux (or BSD). The goal of Wine is not to provide an environment for arbitrary operating systems, but to provide a Windows-like environment on Linux in which native Windows applications can be executed.

Each of these alternatives provides useful functionality but not robust CPU and hardware emulation needed to run virtual machines without error. Nevertheless, they are community projects that will only benefit from use, bug reports , and more developers. If a commercial emulator is not an option, one of these may solve your virtual machine problems.



Anti-Hacker Tool Kit
Anti-Hacker Tool Kit, Third Edition
ISBN: 0072262877
EAN: 2147483647
Year: 2006
Pages: 175

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