Windows DevCenter    
 Published on Windows DevCenter (http://www.windowsdevcenter.com/)
 See this if you're having trouble printing code examples


What Is Virtualization

by Wei-Meng Lee
12/06/2005
Running Mac OS X on Windows
Virtualization
Virtualization allows you to have multiple "virtual machines," each with its own operating systems running in a sandbox, shielded from each other, all in one physical machine. Each virtual machine shares a common set of hardware, unaware that it is also being used by another virtual machine at the same time.

In This Article:

  1. Why Virtualization?
  2. Microsoft Virtual PC 2004
  3. VMware Workstation 5.0
  4. Microsoft Virtual Server 2005
  5. Performance Tips
  6. Summary

Why Virtualization?

Today, there are quite a number of choices when it comes to choosing an operating system for your computer. In the good old days, the choice was much easier -- either you got MS DOS for your PC, or you got an Apple (or Atari), and so on. Today, you have a few more choices for your PC: Windows XP, Windows Server 2003, Linux, and so on.

For those adventurous folks, you might install a multi-boot loader that lets you choose what OS to load during boot-up time. But that involves some experience and a little bit of skill, and partitioning hard disks is not for the faint-hearted. Moreover, once the operating systems are installed it is not a trivial task to add another one into your multi-boot PC.

The rich folks among you might go for the hardware solution, using a different hard disk for each operating system and swapping the required hard disk during boot time. Of course, this is the ideal solution and helps you avoid the nightmare of messing up the multi-boot loader. However, just like the multi-boot solution, only one operating system can run at a time, and switching from one to another takes some considerable delay.

With virtualization, you can have the best of both worlds. You can install new operating systems as easily as installing a new game on your PC, and you can run more than one operating system at the same time. In this article, I will take you through a tour of some of the popular virtualization software available in the market so that you have a better idea of the strengths of each.

Microsoft Virtual PC 2004

Host operating systems supported:

Microsoft Virtual PC is virtualization software designed to run on Windows and computers running Mac OS X. Originally from Connectix, Virtual PC was acquired by Microsoft in early 2003 as part of its effort to enable its customers to run their legacy Windows applications as they migrate to newer Windows operating systems. In addition, Virtual PC also allows customers to run different operating systems on the same physical machine without needing to commit to additional hardware. More importantly, Virtual PC allows developers to test their applications on different platforms easily on virtual machines, especially for technologies that are still in the beta stage and that should not be installed on production servers.

Figure 1 shows my host operating system (Windows XP Professional) with two guest operating systems: Windows Server 2003 Standard Edition and Linux Mandrake 8.0. The Virtual PC Console (on the top right corner of the screen) contains a list of virtual machines I have installed on my machine. To view each virtual machine in full-screen mode, select the window and press Alt-Enter.

Figure 1
Figure 1. Two guest operating systems in the host operating system

Virtual Machine Additions

Virtual Machine Additions is a set of features that improve integration of the host and guest operating systems. It improves performance of the guest operating system and provides functionality such as drag-and-drop copying between the host and guest operating systems.

If you are new to Virtual PC, you will realize that when you move your mouse into a virtual machine and click on it, the mouse will be "absorbed" and locked into the guest operating system. In order to release your mouse from the guest operating system, you need to press the right Alt key. This is quite an irritation if you need to constantly switch between the virtual machines. But if you install the Virtual Machine Additions, this problem will go away and the mouse will move between the virtual machines with ease.

To install the Virtual Machine Additions, go to Action -> Install or Update Virtual Machine Additions. A prompt will appear. The installation process is automatic; you do not need to do anything. However, if the Virtual Machine Additions setup does not work, you can manually run the setup by going to My Computer and double-clicking on the drive labeled as VMADDITIONS13.306(D:) (see Figure 2).

Figure 2
Figure 2. Locating the mounted drive for the Virtual Machine Additions

After the installation, you need to restart your virtual machine to enable the additional features.

One immediate change you'll see is the improved screen solution supported. Before I installed the Virtual Machine Additions, my virtual machine could only support resolutions up to 1024 by 768. But after the installation, the maximum resolution is 1600 by 1200.

More importantly, you can dynamically resize the virtual machine to whatever resolution you prefer. Figure 3 shows the virtual machine in a wide-screen mode (984 by 585). This is useful if you want to test how an application will look like in a wide-screen setting (especially for notebooks).

Figure 3
Figure 3. Dynamically resizing the resolution of the virtual machine

Also, check your date and time settings; you'll see that your virtual machine's time is now synchronized with the host machine. You can also drag-and-drop files and folders between the host and the guest operating system. Clipboard is also shared. Figure 4 shows capturing a screen shot in the host operating system (Windows XP) and then pasting the screen shot in Paint within the guest operating system (Windows Server 2003).

Figure 4
Figure 4. Sharing of clipboard

Unfortunately, Virtual Machine Additions is available for only the following guest operating systems:

If you are using other operating systems (such as Linux), Virtual Machine Additions will not work.

Mounting of ISO Images

One useful feature in Virtual PC is the ability to mount ISO images as virtual drives. As developers are probably aware, a lot of software is now available for download as ISO images (especially from MSDN). Traditionally, you need to burn these ISO images into CDs and DVDs before you can use the images (actually there is third-party software available that mounts an ISO image as a drive).

For example, you have an ISO image of an application package located in your host computer. To mount this ISO image as a drive in your virtual machine, go to CD?Capture ISO Image. and specify the location of your ISO image in your host computer. Once mounted, you will be able to see a drive mapped to the image in the virtual machine.

VMware Workstation 5.0

Host operating systems supported:

VMware Workstation is the main competitor of Microsoft's Virtual PC. The features of VMware Workstation are similar to that of Virtual PC, but its support for guest operating systems other than Windows (read: Linux) is much better than Virtual PC. As such, it is a popular choice among Linux fans.

Figure 5 shows VMware Workstation 5.0 running the Ubuntu Linux operating system on top of Windows XP Professional SP2.

Figure 5
Figure 5. VMware running Ubuntu

You can view a virtual machine in the VMware Workstation window, or switch to full screen by pressing Ctrl-Alt-Enter. To adjust the screen resolution to your own custom ratio, simply check the Autofit Guest option (View?Autofit Guest) and resize the VMware Workstation window.

VMware Tools

Like Microsoft Virtual PC's Virtual Machine Additions, VMware has the VMware Tools package that will help to improve the performance of your virtual machine. To install VMware Tools, go to VM -> Install VMware Tools. You will be prompted with an install dialog box.

Once installed, you will be able to drag-and-drop items between the host and guest operating systems. Clipboard sharing works for text, but does not seem to work for graphics.

Movie Capture

One interesting feature of VMware is the Capture Movie option (see Figure 6).

Figure 6
Figure 6. Capturing a movie

Using this option, you can record the actions taking place within the virtual machine as a movie. This is useful for recording training videos or product demos. Figure 7 shows the recorded video playing in Windows Media Player.

Figure 7
Figure 7. Playing back the recorded movie

Microsoft Virtual Server 2005

Host operating systems supported:

Microsoft Virtual Server 2005 is another virtualization software application from Microsoft. It uses the same technology as Virtual PC. In fact, virtual machines created using Virtual PC can be used in Virtual Server. While Virtual PC and VMware are more focused on individual users, Virtual Server 2005 targets corporate clients who are looking for server consolidation: running multiple servers in one physical machine.

Virtual Server 2005 is available in two versions: Standard Edition and Enterprise Edition. These two versions have the same features, the only difference being the number of processors supported:

In Virtual Server, the management and creation of virtual machines are all performed using the Virtual Server Administration website. As Figure 8 shows, I have three virtual machines running: Linux Mandrake 8.0, Windows Server 2003, and Windows XP Professional SP2. A thumbnail showing the screen of the running virtual machine is displayed, along with detailed information such as running time and CPU usage.

Figure 8
Figure 8. The Virtual Server Administration website

To configure each virtual machine, you click the Configure menu (located under the Virtual Machines section on the left of the page) and select the name of the virtual machine you want to configure. You will be able to configure all the details about the virtual machine via this menu.

To view the virtual machine that is running, simply click on the thumbnail and the Virtual Machine Remote Control will display the screen of the running virtual machine.

The Virtual Machine Remote Control uses an ActiveX control that requires Internet Explorer 5.5 or later. If the Remote Control view doesn't appear above, verify that you have enabled the "Download signed ActiveX controls" option in Internet Explorer.

Virtual Machine Additions

Like Virtual PC, Virtual Server 2005 comes with Virtual Machine Additions to improve the performance of virtual machines. To install it, click on the Virtual Machine Additions link.

Virtual Machine Remote Control

The Virtual Machine Remote Control (VMRC) client is one of the components shipped with Virtual Server 2005. It is a stand-alone application that allows you to access your virtual machines on a remote computer (this feature being the main difference between Virtual Server 2005 and Virtual PC).

Instead of using the HTTP protocol to communicate with the VMRC server, the VMRC client uses the VMRC protocol, developed by Microsoft for communication between VMRC clients and the VMRC server.

To invoke the VMRC client, go to Start -> Programs -> Microsoft Virtual Server -> Virtual Machine Remote Control client. You need to specify the path to the virtual machine, as shown in Figure 9.

Figure 9
Figure 9. Connecting to a remote server using the VMRC client

You need to open up port 5900 on the host server's firewall in order for remote VMRC clients to connect to your virtual machines. If you'd like more detailed configuration information, check out the Virtual Server 2005 Administrator's Guide.

Once connected, you should be able to see your virtual machine in the VMRC client window.

Do note that the VMRC client is not similar to Remote Desktop or Terminal Services. Unlike Terminal Services and Remote Desktop, more than one user can connect to the same server using VMRC. And the changes made by one user would be visible to another. This behavior is by design and is very useful in environments such as classroom and lab trainings.

Figure 10 shows two instances of the VMRC client connecting to the same server; the changes are updated across the clients.

Figure 10
Figure 10. Two VMRC clients connecting to the same server

You can also switch between virtual servers running on the server by going to Remote Control -> Switch to the next virtual machine. Figure 11 shows the VMRC client switching to the Linux Mandrake running on my server.

Figure 11
Figure 11. Switching between virtual servers

You can cycle through all virtual machines easily by pressing the Host key (the right Alt-key, by default) and the right (next virtual machine) or left (previous virtual machine) arrow key on your keyboard.

VMware also has its own solutions for server virtualization, just like Microsoft Virtual Server 2005. There's not enough space in this article for me to be able to test them out. For more information, check out these resources:

Performance Tips

While there are specific instructions to get the best out of the various products reviewed in this article, there are two factors that dramatically affect the performance of these products. They are memory and hard disks.

Memory

Each virtual machine running on the host computer requires a dedicated amount of memory reserved for its use. For example, if you want to run Windows XP Professional on a virtual machine, it is recommended that you allocate 256MB of memory to it. This is on top of the 256MB recommended for the host computer (assuming Windows XP is the host), making a total of 512MB. If you want to run two virtual machines at the same time, you need to have at least 768MB, and so on. In general, you should allocate as much memory as you can to your virtual machine, since that will prevent disk swapping from occurring. For a developer testing applications on different platforms, it is not unusual to have 2GB of memory on a host computer.

Hard Disks

Besides having lots of memory, it is highly recommended that you install your virtual machines on a fast hard drive. The minimum recommended RPM is 7200. Installing on a 5400RPM drive versus a 7200RPM drive makes a lot of difference, especially when the virtual machine performs lots of disk swapping. In addition, it is recommended that you install your virtual machines on separate physical hard drives (if available) and avoid installing them on your boot-up drive.

Summary

In this article, you have seen a quick overview of the three most popular virtualization software programs in the market. If you have not had a chance to try them out yet, now is the time to get your hands on them. And have fun running different operating systems.

Wei-Meng Lee (Microsoft MVP) http://weimenglee.blogspot.com is a technologist and founder of Developer Learning Solutions http://www.developerlearningsolutions.com, a technology company specializing in hands-on training on the latest Microsoft technologies.


Return to the Windows DevCenter.

Copyright © 2009 O'Reilly Media, Inc.