In this chapter, you will learn how to
• Describe the concepts of virtualization
• Explain why PC and network administrators have widely adopted virtualization
• Describe how virtualization manifests in modern networks
Virtualization takes your everyday notion of computing and turns it on its head. Left becomes right. Red becomes blue. Physical computers become virtual computers. It might sound complicated—properly configuring a real computer is hard enough—but once you see it in action, it makes perfect sense. In the simplest terms, virtualization is the process of using special software—a class of programs called hypervisors or virtual machine managers—to create a complete environment in which a guest operating system can function as though it were installed on its own computer. That guest environment is called a virtual machine (VM). You learned about one very important virtual machine back in Chapter 19 called Windows XP Mode, which uses a program called Windows Virtual PC to run a virtual Windows XP operating system in Windows 7. Figure 30-1 shows another example: a system running Windows 7 using a program called VMware Workstation to host a virtual machine running Ubuntu Linux.
This chapter begins by explaining the ideas behind virtualization. The chapter then explores the motivating factors behind the widespread adoption of virtualization throughout the IT industry. The chapter concludes with an in-depth look at how modern networks implement virtualization. Some of the details presented here go beyond the CompTIA A+ 220-802 exam, but I include them to help you understand the scope and power of virtualization.
Ask 100 people what the term virtual means and you’ll get a lot of different answers. Most people define virtual with words like “fake” or “pretend,” but these terms only begin to describe it. Let’s try to zero in on virtualization using a term that you’ve likely heard: virtual reality. For most of us, the idea of virtual reality starts with someone wearing headgear and gloves, as shown in Figure 30-2.
Figure 30-1 VMware running Linux
Figure 30-2 Virtual reality training (photo courtesy of NASA)
The headgear and the gloves work together to create a simulation of a world or environment that appears to be real, even though the person wearing them is located in a room that doesn’t resemble the simulated space. Inside this virtual reality, you can see the world by turning your head, just as you do in the real world. Software works with the headset’s inputs to emulate a physical world. At the same time, the gloves enable you to touch and move objects in the virtual world.
To make virtual reality effective, the hardware and software need to work together to create an environment convincing enough for a human to work within it. Virtual reality doesn’t have to be perfect—it has limitations—but it’s pretty cool for teaching someone how to fly a plane or do a spacewalk, for example, without having to start with the real thing (see Figure 30-3).
Figure 30-3 Using virtual reality to practice spacewalking (photo courtesy of NASA)
Virtualization on a computer is virtually (sorry, can’t pass up the pun) the same as virtual reality for humans. Just as virtual reality creates an environment that convinces humans they’re in a real environment, virtualization convinces an operating system it’s running on its own hardware.
A normal operating system uses programming called a supervisor to handle very low-level interaction among hardware and software, such as task scheduling, allotment of time and resources, and so on.
Because virtualization enables one machine—called the host—to run multiple operating systems simultaneously, full virtualization requires an extra layer of sophisticated programming to manage the vastly more complex interactions. One common method calls this extra programming a hypervisor or virtual machine manager (VMM).
A hypervisor has to handle every input and output that the operating system would request of normal hardware. With a good hypervisor like VMware Workstation, you can easily add and remove virtual hard drives, virtual network cards, virtual RAM, and so on. Figure 30-4 shows the Hardware tab of the Virtual Machine Settings dialog box in VMware Workstation.
Figure 30-4 Configuring virtual hardware in VMware Workstation
Virtualization even goes so far as to provide a virtualized BIOS and system setup utility for every virtual machine. Figure 30-5 shows VMware Workstation displaying the system setup utility, just like you’d see it on a regular computer.
Figure 30-5 System setup utility in VMware Workstation
Virtualization takes the hardware of the host system and segments it into individual virtual machines. If you have an Intel system, a hypervisor creates a virtual machine that acts exactly like the host Intel system. It cannot act like any other type of computer. For example, you cannot create on an Intel system a virtual machine that acts like a Sony PlayStation 3. Hypervisors simply pass the code from the virtual machine to the actual CPU.
Emulation is very different from virtualization. An emulator is software or hardware that converts the commands to and from the host machine into an entirely different platform. Figure 30-6 shows a Super Nintendo Entertainment System emulator, Snes9X, running a game called Donkey Kong Country on a Windows system.
Figure 30-6 Super Nintendo emulator running on Windows
EXAM TIP While the CompTIA A+ 220-802 exam objectives include emulation as a part of virtualization, the concepts are not the same. For the sake of completeness, however, know that emulating another platform (using a PC to run Sony PlayStation 2 games, for example) requires hardware several times more powerful than the platform being emulated.
You can perform virtualization in a number of ways; this chapter will show you several of them. Before I go any further, though, let’s take the basic pieces you’ve learned about virtualization and put them together in one of its simpler forms. In this example, I’ll use the popular VMware Workstation on a Windows 7 system and create a virtual machine running Ubuntu Linux.
Begin by obtaining a copy of VMware Workstation. This program isn’t free, but VMware will give you a 30-day trial. Go to www.vmware.com to get a trial copy. A freshly installed copy of VMware Workstation looks like Figure 30-7.
Figure 30-7 VMware Workstation
NOTE Microsoft’s Virtual PC is a free competitor to VMware Workstation. Virtual PC works well, but it lacks some of the more interesting features included in VMware Workstation.
Clicking New Virtual Machine prompts you for a Typical or Custom setup (see Figure 30-8). These settings are only for backward-compatibility with earlier versions of VMware, so just click Next.
Figure 30-8 Selecting a Typical or Custom setup
The next dialog box is where the fun starts. Here, VMware Workstation asks for an operating system installation disc. Just because you’re creating a virtual machine, don’t think the operating system and applications aren’t real. You need to install an operating system on that virtual machine. You do this just as you would on a machine without virtualization, using some form of optical media. Would you like to use Microsoft Windows in your virtual machine? No problem, but know that every virtual machine you create on which you install Windows requires a separate, legal copy of Windows.
Because virtual machines are so flexible on hardware, VMware Workstation enables you to use either the host machine’s optical drive or an ISO file. I’m installing Ubuntu, so I downloaded the latest ISO image from the Ubuntu Web site (www.ubuntu.com), and as Figure 30-9 shows, I’ve pointed the dialog box to that image.
Compared to some other virtualization programs, VMware Workstation is a powerful, easy-to-use program. If you look closely at Figure 30-9, you’ll see that VMware reads the installation media (note the “Ubuntu 11.04 Detected”). Because VMware knows this operating system, it configures all of the virtual hardware settings automatically: amount of RAM, virtual hard drive size, and so on. You can change any of these settings, either before or after the virtual machine is created. Refer to Figure 30-4 to see these settings. Next, you need to accept the size of the virtual drive, as shown in Figure 30-10.
Figure 30-9 Selecting the installation media
Figure 30-10 Setting the virtual drive size
You also need to give the virtual machine a name (see Figure 30-11). By default, VMware Workstation uses a simple name. For this overview, accept the default name: Ubuntu. This dialog box also lets you decide where you want to store the files that comprise the virtual machine. Note that VMware uses a folder in the user’s Documents folder called Virtual Machines.
Figure 30-11 Entering a VM name and location
TIP Use descriptive names for virtual machines. This will save you a lot of confusion when you have multiple VMs on a single hypervisor.
After you’ve gone through all the configuration screens, you can start using your virtual machine. You can start, stop, pause, add, or remove virtual hardware.
VMware is very convenient; it even configures the boot order in the virtual system setup to boot first from the installation media, making the Ubuntu installation automatic (see Figure 30-12).
Figure 30-12 Ubuntu installing into the new virtual machine
After the virtual machine installs, you then treat the VM exactly as though it were a real machine. The only big difference is that VMware replaces CTRL-ALT-DELETE with CTRL-ALT-INSERT. Figure 30-13 shows VMware Workstation with the single VM installed but not running. A VM goes through a POST process just like any computer, as shown in Figure 30-14. If you wish, you can even access a complete virtual system setup utility by pressing the DELETE key just like on a real system.
Figure 30-13 VMware Workstation with a single VM
Figure 30-14 POST in a virtual machine
Congratulations! You’ve just installed a virtual desktop. Virtual desktops were the first type of popular virtual machines seen in the PC world, championed by VMware and quickly copied by other virtualization programs.
There’s a lot more to virtualization than just virtual desktops, however, but before I dive in too far, let’s step back a moment and understand a very important question: Why do we virtualize?
Virtualization has taken the computing world by storm, but for those who have never seen virtualization, the big question has got to be: Why? Let’s talk about the benefits of virtualization. While you read this section, keep in mind two important things:
• A single hypervisor on a single system will happily run as many virtual machines as its RAM, CPU, and drive space allow.
• A virtual machine that’s shut down is little more than a file (or two) sitting on a hard drive.
While you’re reading about the benefits of virtualization, don’t forget about the costs. To run one or more virtual machines, you’ll need a powerful machine—fast processor, loads of RAM (this is usually the limiting factor in how many virtual machines you can run at the same time), and a good amount of hard drive space. If you want the virtual PC to connect to a network, your physical PC needs a NIC.
EXAM TIP Virtualized operating systems use the same security features as real operating systems. For each virtual machine user account, you’ll need to keep track of user names, passwords, permissions, and so on, just like on a normal PC.
Before virtualization, each installed OS needed to be on a unique physical system. With virtualization, you can place multiple virtual PCs on a single physical system, reducing electrical power use substantially. Rather than one machine running Windows Server 2008 (or Server 2008 R2) and acting as a file server and DNS server, and a second machine running Linux for a DHCP server, for example, the same computer can handle both operating systems simultaneously. Expand this electricity savings over an enterprise network or on a data server farm and the savings—both in terms of dollars spent and electricity used—are tremendous.
Similar to power saving, why buy a high-end server, complete with multiple processors, RAID arrays, redundant power supplies, and so on, and only run a single server? With virtualization, you can easily beef up the RAM and run a number of servers on a single box.
Possibly the most popular reason for virtualizing is to keep uptime percentage as high as possible. Let’s say you have a Web server installed on a single system. If that system goes down—due to hacking, malware, or so on—you need to restore the system from a backup, which may or may not be easily at hand. With virtualization, you merely need to shut down the virtual machine and reload an alternative copy of it.
CAUTION Rebooting virtual machines is easy, but keep an eye on your physical machine. If your PC goes down, it brings all your virtual machines down with it! Be sure to back up mission-critical virtual machines to an external hard drive—remember that a virtual machine is just a file on your hard drive. You can always install the backed-up virtual machines on another physical machine if necessary.
Think of virtual machines like you would a word processing document. Virtual machines don’t have a “File | Save” equivalent, but they do have something called a snapshot that enables you to save an extra copy of the virtual machine as it is exactly at the moment the snapshot is taken. Figure 30-15 shows VMware Workstation saving a snapshot.
Figure 30-15 Saving a snapshot
Closely tied to system recovery, system duplication takes advantage of the fact that VMs are simply files, and like any file, they can be copied. Let’s say you want to teach 20 students about Ubuntu Linux. Depending on the hypervisor you choose (VMware does this extremely well), you can simply install a hypervisor on 20 machines and copy a single virtual machine to all the computers. Equally, if you have a virtualized Web server and need to add another Web server (assuming your physical box has the hardware to support it), why not just make a copy of the server and fire it up as well?
Here’s a great example that happens in my own company. I sell my popular Total Tester test banks: practice questions for you to test your skills on a broad number of certification topics. As with any distributed program, I tend to get a few support calls. Running a problem through the same OS, even down to the service pack, helps me solve the problem. In the days before virtualization, I commonly had seven to ten PCs, using dual-boot, each keeping copies of a particular Windows version. Today, a single hypervisor enables me to support a huge number of Windows versions on a single machine (see Figure 30-16).
Figure 30-16 Lots of VMs used for research
NOTE The system shown in Figure 30-16 could obviously never run all those VMs at the same time.
Clearly there are a number of good reasons to virtualize some of the computers in a network. Let’s look at implementation now.
You’ve already seen virtualization in action with the example shown using VMware Workstation earlier in this chapter. Many networks use a few virtual machines to augment and refine a traditional network closet. VMware Workstation is how I first performed virtualization on PCs, but the technology and power have grown dramatically over the past few years.
VMware Workstation requires an underlying operating system (such as Windows), so it functions essentially like a very powerful desktop application. What if you could remove the OS altogether and create a bare-metal implementation of virtualization?
VMware introduced ESX in 2001 to accomplish this goal. ESX is a hypervisor that’s powerful enough to replace the host operating system on a physical box, turning the physical machine into a machine that does nothing but support virtual machines; no Windows, no Ubuntu—just ESX.
ESX by itself isn’t much to look at; it’s a tiny operating system/hypervisor that’s usually installed on something other than a hard drive. Figure 30-17 shows how I loaded my copy of ESX: via a small USB thumb drive. Power up the server; the server loads ESX off the thumb drive; and in short order, a very rudimentary interface appears where I can input essential information, such as a master password and a static IP address.
NOTE For all you abbreviation lovers, I have some good news and some bad news about “ESX.” Officially, it means nothing. Unofficially, it stands for “Elastic Sky,” which is probably why it officially means nothing.
NOTE A free version of ESX is available. Called ESXi, it lacks a number of ESX’s features but is still quite powerful.
Don’t let ESX’s small size fool you. It’s small because it only has one job: to host virtual machines. ESX is an extremely powerful operating system/hypervisor.
NOTE Some writers will use the term virtual machine manager to describe virtual machine software that runs on top of a host operating system. They’ll use the term hypervisor to describe only software that does not need a host operating system. Using this terminology, VMware Workstation is a virtual machine manager and ESX is a hypervisor. Other writers call both the hosted and bare-metal—or native—virtualization software products hypervisors, but make a distinction in other descriptive words (such as hosted or native).
Notice the built-in USB port shown in Figure 30-17. The popularity of hypervisors on dedicated servers makes these ports extremely common in a serious server box like the Dell system shown.
Figure 30-17 USB drive on server system
Powerful hypervisors like ESX are rarely administered directly at the box. Instead you use tools such as VMware’s vSphere Client, so you can create, configure, and maintain virtual machines on the hypervisor server from the comfort of a client computer running this program. Once the VM is up and running, you can close the vSphere client, but the VM will continue to run happily on the server. For example, let’s say you create a VM and install a Web server on that VM. As long as everything is running well on the Web server, you will find yourself using the vSphere client only to check on the Web server for occasional maintenance and administration.
So you now really have two different ways to virtualize: using virtual machine managers like VMware’s Workstation to manage virtual desktops, and using powerful hypervisors like ESX to manage virtual servers. Granted, you could run a server like a Web browser in VMware Workstation, and you also could run a copy of Windows 7 Ultimate from an ESX system. Nothing is wrong with doing either of these.
Thus far, this chapter sounds like an advertisement for VMware. VMware really brought virtualization to the PC world and still holds a strong presence, but there are a number of alternatives to VMware products. Let’s see what else is available.
When it comes to the more basic virtual machine managers, you have a huge number of choices. The one you use is going to be determined by features and prices.
The granddaddy and front leader for virtualization, VMware Workstation, comes in both Windows and Linux versions. VMware Workstation runs virtually (pun!) on any operating system you’ll ever need and is incredibly stable and proven. Too bad it’s not free.
One of the more interesting features of VMware Workstation is VMTools. VMTools adds useful features such as copy/cut and paste between the virtual desktop and the real desktop.
Microsoft has offered a few different virtual machine managers over the years, with the current mainstream product being Windows Virtual PC (see Figure 30-18). Windows Virtual PC is free, but has some serious limitations. First, it only works on Windows 7 Professional, Ultimate, and Enterprise. Second, it only officially supports Windows VMs, although a few intrepid souls have managed to get Linux working.
Figure 30-18 Windows Virtual PC
NOTE Remember Windows XP Mode from Chapter 19? It uses Virtual PC and a copy of Windows XP to create a virtual machine on your PC!
Parallels is the most popular virtualization manager for Mac OS X (see Figure 30-19), although VMware Fusion is a close second. Parallels supports all popular operating systems, and even has a fair degree of 3-D graphics support; more so than even the mighty VMware. Parallels also offers Windows and Linux versions.
Figure 30-19 Parallels for Mac
Of course, the open source world has its players too. While picking a single product to represent the Linux/Unix world is hard, no one who knows virtualization would disagree that KVM from Red Hat is a dominant player. Unlike the other virtual machine managers discussed, KVM also supports a few non-x86 processors.
Don’t think for a moment that this list is complete! There are lots of other virtual machine options for your desktop, especially if your host machine runs Linux. The most fun you’ll have learning about virtualization is the playtime involved experimenting with the many options available.
While you have lots of choices when it comes to virtual machine managers, your choices for real embedded hypervisors are limited to the two biggies: VMware’s ESX and Microsoft’s HyperV. There are others, such as Oracle’s VM Server, but nothing has the market share of ESX or HyperV.
I’ve already discussed a few aspects of ESX, so instead I’ll delve into the features that make ESX so popular. When it comes to real server virtualization, VMware truly leads the pack with a host of innovations (some of which are add-on products) that make ESX almost unstoppable. Here are a few examples:
• Interface with large storage ESX virtual machines easily integrate with network attached storage (NAS) and storage area networks (SANs) to handle massive data storage.
• Transparent fault tolerance ESX can monitor and automatically recover failed VMs with little or no input.
• Transparent server transfer You can move a running VM from one machine to another. How cool is that?
• High virtual CPUs Most hypervisors support a limited number of virtual CPUs, usually two at most. ESX can support up to 32 CPUs, depending on the vSphere product version you purchase to support it.
Although HyperV can’t stand toe-to-toe with ESX, it has a few aces up its sleeve that give it some intrigue. First, it’s free. This is important in that ESX, with only a few extra add-ons, can cost thousands of dollars. Second, it comes as a stand-alone product or as part of Windows Server 2008 and even on some versions of Windows 7, making it easy for those who like to play to access it. Third, its simplicity makes it easier to learn for those new to using hypervisors. Watch HyperV. If Microsoft does one thing well, it’s taking market share away from arguably better, more powerful competitors, while slowly making its product better.
1. Upgrading which component of a host machine would most likely enable you to run more virtual machines simultaneously?
A. CPU
B. Hard drive
D. Windows
2. What is the difference between a virtual machine (VM) and an emulator?
A. A VM converts commands to and from a host machine to an entirely different platform, whereas an emulator creates an environment based on the host machine and does no converting.
B. An emulator converts commands to and from a host machine to an entirely different platform, whereas a VM creates an environment based on the host machine and does no converting.
C. An emulator requires a host OS, whereas a VM runs on bare-metal servers without an OS.
D. A VM requires a host OS whereas an emulator runs on bare-metal servers without an OS.
3. What do you make when you save a copy of a VM?
A. Replacement
B. Save
C. Snapshot
D. Zip
4. What do you need to install a legal copy of Windows 7 Professional into a virtual machine using VMware Workstation?
A. A valid VM key
B. A valid Windows 7 Professional installation media
C. A valid ESX key
D. A second NIC
5. What is one benefit of ESX over VMware Workstation?
A. ESX costs less.
B. ESX is easier to set up.
C. ESX uses less electricity.
D. You can move a running VM from one machine to another with ESX.
6. Which of the following is not a good reason for virtualization?
A. Power saving
B. Hardware consolidation
C. System recovery
D. Reduced hardware costs
7. With what does VMware Workstation replace CTRL-ALT-DELETE?
A. A mouse click
B. CTRL-ALT-INSERT
C. CTRL-ALT-TAB
D. CTRL-ALT-SHIFT
8. Powerful hypervisors like ESX are often booted from__________________.
A. Floppy diskettes
B. USB thumb drives
C. Firmware
D. Windows
9. Which of the following virtualization programs works well with Mac OS X? (Select the best answer.)
A. ESX
B. KVM
C. Parallels
D. Virtual PC
10. When a virtual machine is not running, how is it stored?
A. Firmware
B. RAM drive
C. Optical disc
D. Files
1. C. Adding more RAM will enable you to run more simultaneous VMs. Upgrading a hard drive could help, but it’s not the best answer here.
2. B. An emulator converts from one platform to another, whereas a virtual machine mirrors the host machine.
3. C. A copy or saved version of a VM is called a snapshot.
4. B. You need a copy of the Windows installation media to install Windows.
5. D. Among the many benefits of ESX over its little brother is the capability of moving a running VM from one machine to another.
6. D. Switching to virtual machines may or may not save money on hardware. A good virtual machine server can cost a lot more than a series of PCs, but operating costs are reduced.
7. B. VMware uses CTRL-ALT-INSERT for logon.
8. B. A good hypervisor can be tiny, loading from something as small as a USB thumb drive.
9. C. Parallels is the dominant virtualization program for Mac OS X.
10. D. VMs are just files, usually stored on a hard drive.