5 excellent uses of Windows 8 Hyper-V
Buried under all of the clamor and kvetching about Windows 8's most obvious features—Metro! Metro apps!—is a new addition that hasn't made a lot of headlines: Windows 8's new Hyper-V-powered virtualization functionality. Oddly, most people don't seem to know Hyper-V even exists in Windows 8, let alone what it's good for. But it's one of the hidden pearls inside the Windows 8 oyster.
The exact technical name for Hyper-V in Windows 8 is Client Hyper-V. Microsoft picked this name to distinguish Windows 8's implementation of Hyper-V from the full-blown Windows Server incarnation, which is aimed at the server market and designed for more upscale, industrial-strength virtualization scenarios. Client Hyper-V is for end-users on the desktop who want to make virtualization work for them directly.
People may disagree about Windows 8's new surface, pun intended, but there's little arguing that many great things have happened under the hood. Client Hyper-V has started to open up a range of possibilities—not just for experimentation, but for everyday tasks—that make Windows 8 a little more appealing to the power user.
An inevitable question is how Client Hyper-V shapes up against stand-alone virtualization platforms such as VMware Workstation and VirtualBox. If you've used either of those apps (or another third-party virtualization product), you'll note that Client Hyper-V offers many of the features they do: support for a broad range of virtualized hardware, snapshotting, dynamic allocation of memory, support for multiple virtual processors, and so on. Plus, Hyper-V should give better performance thanks to its architecture, especially when working with Microsoft operating systems as the guests—but don't count on it. Your usage scenario and hardware, and thus your mileage, will vary.
The biggest reasons to continue using VMware Workstation or VirtualBox would be your existing investment in expertise and familiarity with them. But it's well worth trying out Client Hyper-V with your existing virtualization projects to see if there's a major boost in performance or if you simply like the Client Hyper-V interface better.
Getting started with Client Hyper-V
What exactly can be done with Client Hyper-V? In fact, there are several ways you put Client Hyper-V to work, ranging from reproducing functionality found in earlier versions of Windows to running operating systems that aren't Windows at all. I'll explore five of the most useful options in this article.
Before we dive in and start provisioning VHDs, Client Hyper-V has a few system requirements and behavioral restrictions you should be aware of. First, Client Hyper-V has stringent hardware requirements. Not every PC will be able to run it. You need a 64-bit processor that can support Second Level Address Translation (SLAT). You also need at least 4GB of RAM. If you're in doubt about your PC, you can run a utility like Coreinfo to find out if SLAT is supported on your machine. Many notebook-edition CPUs do not support SLAT, but most desktop processors do. If you're running the most recent generation of Intel or AMD processors, then you're golden.
Second, Client Hyper-V is not installed by default in Windows 8. In fact, the setup process for Client Hyper-V is a convenient way to determine if the computer you're using can support it in the first place. Search for "features" in the Settings section of Windows 8 Search, and launch "Turn Windows features on or off." There, under Hyper-V, select Hyper-V Platform (and enable all the other management tools). If you don't have the right kind of hardware or if the hardware properties you need are disabled in BIOS, you'll get a warning to that effect.
Finally, when running any instance of an operating system, always make sure you have the right to do so, per the licensing agreements for the software. Copies of Windows must be licensed for use in virtual machines as well as physical ones. The host instance of Windows 8 doesn't automatically give you the right to run guest instances of any version of Windows.
Use Windows 8 Hyper-V to virtualize Windows XP (or another earlier version of Windows)
Much to Microsoft's ongoing chagrin, Windows XP has become The OS That Just Won't Die. Many cling to it because it runs with minimal resources. Others stick with it because they have applications or hardware that work with it and nothing else—all this in the face of a ticking clock to discontinue its support forever!
As of Windows 7, Microsoft's approach to prolonging backward compatibility with XP was XP Mode. This add-on to Windows 7 used one of the spiritual predecessors to Hyper-V, Microsoft Virtual PC, to run an instance of Windows XP in a virtual machine. With the advent of Windows 8, though, XP Mode has been ditched, to the distress of everyone still using it. The issues were as logistical as they were technical: Microsoft only allowed the use of XP Mode with the Professional, Enterprise, and Ultimate versions of Windows 7, because the price tags for those premium editions covered the licensing rights for the edition of XP in XP Mode as well.
Next page: Run a test machine...
If you have Windows XP installation media and the proper licensing for it, you can use that to create an installation of Windows XP under Client Hyper-V. It's also possible to transfer the VHD (the file that contains the virtual hard disk image for the OS) from a previous installation of XP Mode—again, as long as you still have a valid license for the copy of Windows that contained XP Mode. You can't just swipe a copy from any old installation of Windows 7. You also can't use a Windows XP OEM recovery/installation CD designed to restore a specific system, since that copy of Windows XP is licensed for that particular piece of hardware and no other (not even virtual machines).
Another way to virtualize Windows XP without buying a full-blown license, but only for short periods of time, is to use Microsoft's Internet Explorer Application Compatibility VPC Image. Microsoft provides downloadable system images for Windows XP, Windows Vista, and Windows 7 that contain previous editions of Internet Explorer (IE6 in XP's case) for the sake of backward compatibility and testing. The images in question time out after a certain point, typically 90 days, but they have been refreshed periodically. As of this writing, the current Windows XP image will expire as of Feb. 14, 2013.
Again, due to the licensing restrictions involved, these system images are not intended to serve as full-blown replacements for a properly licensed copy of Windows. But if you just need something running long enough for a quick test or a temporary fix, Client Hyper-V plus a compatibility image should do the trick.
Use Windows 8 Hyper-V to create an app sandbox or test machine
Virtualization makes it possible to sandbox apps—or even whole variant installations of your main OS—for the sake of testing or evaluation. If you have a program you want to try out but are leery of putting it on a production system, stick it in a Client Hyper-V VM. One of the finest analogies I've ever heard for this was that it's like a roll of paper towels: When you're done using that app, you just wipe down the VM or roll it back to a snapshot. You don't even have to uninstall the program in question.
Snapshotting lets you save the state of the system image, so you can revert to it after you're done testing, in much the same way a backup of a system lets you roll back to the point when the backup was made. That said, snapshots of Client Hyper-V VMs are by default stored in the same directory as the VHD file for the VM, so taking too many snapshots can crowd out space that might be needed by the VHD as more items are added.
This matters twice as much if you use that disk for storing other things. You don't want to take one snapshot after another, then have other programs start bombing because they don't have storage space left.
Another thing to keep in mind about snapshots: Snapshots of a VM reduce disk performance for that VM. Each additional snapshot made of a VM creates that much more of a performance bottleneck, since both the snapshot(s) and the underlying VHD have to be processed. If you're using snapshots as a way to keep a clean test machine, use only as many as you absolutely have to. This rule applies for most any use of Client Hyper-V where you're snapshotting, too.
Finally, using Client Hyper-V as a test platform doesn't change the rules about licensing. You'll still need to have a separate license for the instance of Windows you're running. An MSDN or TechNet subscription is one good way to deal with this, since you can use an OS license from the pool given to you for a testing/evaluation install. For your yearly membership fee, you get tons of other software you can evaluate in the same way.
Use Windows 8 Hyper-V to run another OS prepackaged as a VHD
XP Mode isn't the only way you can run a "prepackaged" operating system from a VHD file. Many other Microsoft operating systems are also available in VHD bundles, such as Windows Server 2012. The same goes for many of Microsoft's server-side applications, such as SQL Server and Exchange Server.
Many other vendors' products—whether OSes or products that come deployed as a virtual appliance—are also being made available in VHD editions. Various Linux distributions, for instance, and products like Citrix XenApp are offered as VHD downloads.
The beauty of this kind of prepackaging is that there's nothing to set up on the host system. You only need to download the VHD, create a virtual machine to host it in the Client Hyper-V console, and boot it.
If you've obtained a virtual disk in a format other than VHD, not to worry. Third-party programs can convert virtual disks between formats, including free ones such as StarWind V2V Converter.
Next page: Run an OS from another machine...
Use Windows 8 Hyper-V to migrate an OS from a physical machine
Another nifty use of Client Hyper-V is to run a virtual machine made from a copy of another physical machine's hard drive. This is handy if the system in question is suffering from hardware problems or otherwise needs to be retired from service, but the instance of the OS on it still needs to be running in some form.
That said, Client Hyper-V can't perform this kind of migration by itself. Microsoft engineers Mark Russinovich and Bryce Cogswell (of Sysinternals fame) created a tool called Disk2vhd to bridge the gap. When run on a given Windows system (Windows XP SP2 and later), Disk2vhd polls all the available physical drives in the system and lets you create an image from them. You can even convert a currently running system drive, since Disk2vhd uses Windows' own Volume Snapshot technology to accomplish this.
Two details are worth noting here. First, the virtual machine you create should match the hardware specifications of the original whenever possible. Otherwise, when you boot the VHD for the first time, the guest OS may detect major hardware changes and respond accordingly, including triggering the need to reactivate Windows.
Second, note that due to licensing, you can't transfer an OEM-licensed copy of Windows to a virtual machine from a physical machine for production use. You can, however, do this with systems that have a full retail Windows license or a copy of Windows courtesy of Software Assurance.
Use Windows 8 Hyper-V to boot from a VHD
Booting from a VHD is exactly what it sounds like: You can install a VHD as if it were a boot volume and boot the entire host system directly to it.
Strictly speaking, this isn't a Client Hyper-V feature, but a trick that's been possible in Windows since Windows 7. It's worth mentioning here, since working with VHDs in Client Hyper-V may give you a reason to pull this stunt as well. It comes in especially handy if you want to run the guest with as few performance issues as possible without actually installing the guest OS (although even they have their limitations). It's also handy because the whole thing can be undone just as easily, with no side effects and no dangerous mucking around with partition tables.
Setting up a VHD as a boot volume is a two-stage process. First, you need to attach the VHD through the Disk Management console's menu (Action | Attach VHD) so that it shows up as a drive in the console. Second, you need to add a system boot entry for the VHD via BCDEDIT or a similar tool. Dan Stolts of TechNet has created a handy batch file to automate the process and to make it harder to mess up your boot entries to begin with.
Again, as with an OS migration from a physical machine, any differences in the hardware setup for the VHD's VM and your physical computer will be detected by the VM.