The Virtual Machine Approach


If you need access to multiple operating systems primarily for testing purposes, rather than for long periods of work, there's a way to enjoy the use of multiple operating systems without any of the hassle of multiboot setups. In fact, you can even use multiple operating systems simultaneously on the same computer. It's done with a setup called a virtual machine. It's an old conceptIBM has used it on its mainframes since the 1970smaking a big comeback thanks to today's fast processors and huge hard disks.

A virtual machine program emulates (simulates) in software all of the hardware functions of a PC. It lets an entire operating system (called a guest operating system) run as an ordinary application program on a host operating system like Windows XP. Since all of the hardware functions are emulated, the guest OS doesn't "know" it's not in complete control of a computer. When it attempts to physically access a hard disk, display card, network adapter or serial port, the virtual machine program calls upon the host operating system to actually carry out the operation.

Even though the software may need to execute several hundred instructions to emulate one hardware operation, the speed penalty is only 5 to 10 percent. And if a guest OS crashes, it doesn't take down your system. You can simply click a Reset menu choice and "reboot" the virtual machine. Check out Figure 31.6, where I have DOS, Linux, and Windows Me running in separate virtual machines.

Figure 31.6. Virtual PC running Windows Me, Linux, and DOS on three virtual machines.


Another advantage of the virtual machine programs currently on the market is that they don't allow the guest OS unfettered access to your real disk drives. Instead, you create a virtual disk, a single large file on your host operating system that contains the contents of what the virtual machine sees as a hard drive. With today's large hard drives, it's no big deal to create a 1 or 2GB file to serve as a virtual hard drive to host Windows 95, and another for Windows NT, and another for Linux…you get the picture.

If you make a backup copy of the file after installing a guest operating system on one of these virtual disk drives, you can return the guest OS to its original, pristine state just by copying the backup over the virtual disk file. You can even boot up a guest OS, start a bunch of applications, and save the virtual machine in this exact state. When you want to use it again, you can just fire up the whole system starting right from this point. If you're a tester or experimenter, a virtual computer can save you hours of time installing, reinstalling, and rebooting.

Of course, you still need separate licenses for all of the extra operating systems you install, but the virtual machine can let you run as many OSes and as many configurations of these OSes as you like, separately or simultaneously. And all of this comes without the need to hassle with BOOT.INI or worry about partitions.

NOTE

Have you wondered how operating system book authors get screen pictures of the bootup and installation process? In the old days, we had to use film cameras or video recorders. Now, we just use virtual PC programs, and use screen capture software to get images off of the desktop. It's a walk in the proverbial park.


If this sounds interesting, there are two products you should check into:

  • VMWare, sold by VMWare. Check out www.vmware.com. VMWare was the first commercial system to emulate a PC on a PC. (Previous PC emulators ran on other computing platforms.) It's the most "industrial-strength" PC emulator available.

  • Microsoft Virtual PC. Microsoft bought this program from Connectix Corporation. There are versions for Windows and for the Mac. Check out www.microsoft.com/virtualpc. The Windows version comes for free as part of some Microsoft Developers Network subscriptions. Unfortunately, Microsoft has, shall we say, degraded Virtual PC somewhat. The original developers are still involved with and proud of the product, and directly communicate with users via the microsoft.public.virtualpc newsgroup, but I think that marketing decisions have negatively impacted the product. In my experience, it's now slower, buggier, and it doesn't support alternative operating systems like Linux as well as it used to (no big surprise there). Still, it works well enough, and I use it frequently.

Both vendors have trial versions that you can download and test before buying. Both also support networking, device and file sharing, and cut-and-paste capability between the host OS and several selected guest OSes.

Finally, if DOS compatibility is all you're after, and the MS-DOS subsystem built into Windows XP doesn't do an adequate job for you, check out DOSBOX, a free, open-source program available at dosbox.sourceforge.net. It's another "work-in-progress" program developed by a group of volunteers. DOSBOX lets you install a copy of DOS and run old games and DOS programs in an emulated environment. Since the source code for DOSBOX is freely available, there's even the potential to add support for specialized hardware devices so that old DOS programs could continue to use them, or use their modern replacements.



Special Edition Using Microsoft Windows XP Professional
Special Edition Using Microsoft Windows XP Professional (3rd Edition)
ISBN: 0789732807
EAN: 2147483647
Year: 2003
Pages: 450

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