If you’re running Windows Server 2008, there’s a cool feature that you might not be taking advantage of yet. Microsoft’s answer to VMware’s success is it’s own hypervisor for virtual machines called Hyper-V. Hyper-V is included in Server 08, but you’ll want to run Windows Update before you install the role as there is a much improved version over the beta version that shipped with the OS.
Like most things with the trimmed down OS, features might be available but they’re not enabled by default. The first thing we’ll need to do is make use of the new terminology that Server 08 uses and we’ll install the role to enable Hyper-V in a short walk-through.
First, open up the Server Manager. There are about half a dozen ways to get into the Server Manager. You can follow the shortcut at the top of the Start Menu as pictured in the screenshot below. There’s also a shortcut in the Quick launch bar. If that fails, you can right-click on Computer and go to Manage. Ok, so that’s only half of half a dozen, but I’m sure there are more that I didn’t list.
Once inside Server Manager, click on Roles. In the pane to the right, you’ll see a link called “Add Roles”. Click on that to proceed adding roles to your Server 2008 machine.
Introductory page. Read it and click Next.
Now you’ll see a list of all the roles available to you. For this article, select the Hyper-V role and hit next, but there may be other roles you want to add to this server to increase its versatility and functionality. I’d recommend coming back later to this spot to read about and add more roles.
If you only selected Hyper-V (good job on following directions!), you’ll get an introductory screen telling you all about Hyper-V with links to more reading. Click Next whenever you’re ready to proceed.
The first step for Hyper-V is configuring the virtual network. VMs piggy-back off of your physical NIC to get to the outside network and Internet. If you want your VMs to have network access check you NIC and click Next. You can always choose later on a VM basis whether a machine has network access.
Confirm your settings in the summary window and hit Next when you’re ready.
The install will proceed fairly quickly until it comes to a point where it needs to restart your computer. Click Close and restart.
Installation of the Hyper-V role will automatically resume when it comes back up after restarting and you log in. Shortly after, you’ll get a confirmation that the installation completed successfully. Click Close and you’re ready to start adding some VMs.
That completes installing the Hyper-V role. You could now add any virtual machines that you want and have licenses for. This includes running Linux liveCDs or installing Linux in a VM.
If you have Server 2008 Enterprise, it comes with a license for installing Server 2008 on one physical machine and on four virtual machines. If you have the non-Enterprise version, you have a license for one installation on a physical machine and one install for a virtual machine. Read more about the different versions and licensing.
That being said, we could create a new VM for another instance of Server 2008. Maybe we’d use it for testing or running a dedicated task. Instead, I think we’ll use this virtual machine for the much more exciting task of getting a peak at the Windows 7 Beta.
In the Server Manager still, expand the Roles now to find your Hyper-V role and then under that the Hyper-V Manager. Click on the Hyper-V Manager to change the right-side of the window to Hyper-V related tasks. Click on Connect to Server to begin. This will pop-up a small window prompting you to choose between Local Computer and Hyper-V server. For now, we’ll build VMs on the local computer, so select that and press Ok.
Below is a screenshot of the Hyper-V manager on my local machine. As you can see, I’ve previously made some VMs using Ubuntu.
On the far-right side, under Actions you’ll see the option New. Click it and follow the arrow to select a new Virtual Machine…
Name your VM (how it will appear in the Hyper-V manager) and specify a location you want the virtual hard disk and associated files stored. A sub-folder will be created for each new VM, so it’s fairly organized but you might want to move the directory to a location of your choosing (for reasons of being backed up, not across the network, etc.). To do that, just check the box “Store the vm in a different location” and then fill out or browse to your desired locale. Hit Next to move onto configuring the other settings for the machine.
You can adjust the amount of memory that this VM has, whether it connects to the virtual network, and where to create a virtual hard disk. Be sure to be aware that the VM is pulling resources from the host machine. It can’t have more RAM than is physically available (plus some to keep the host OS and applications running). The same is true of the virtual hard disk if you keep it local. It will take a chunk of your hard disk space, so be sure to keep it manageable. After the VM is all setup, if it is shut down, you can adjust these settings to increase or decrease the RAM.
The last configuration options are shown in the screenshot below. I’m going to be installing Windows 7, so I told it to install an OS from a host CD|DVD-ROM and then chose from an image file and browsed to the .iso I downloaded earlier. This auto-mounting feature is nice because I don’t have to even burn a DVD. Hit Next and you’ll get to the summary of all the settings you’ve chosen. You can click Finish and your VM should start up.
A screen will pop-up containing your VM and you can see in the background under the Hyper-V manager the state of your VM has changed along with other status.
If it proceeds correctly, you should be soon rewarded with the shiny glow of the Windows 7 logo.
Just as if you were sitting at a physical machine installing a new OS, the Windows 7 setup will show up. Proceed through it as you would a normal OS installation.
If all works out correctly, which it should, your VM will reboot after the install completes and show up with the new Windows 7 interface.
Tips & Tricks on interacting with your VM
If you’re interacting with the VM and want to get back to the host OS but find that your mouse is “stuck” within the VM window, press Ctrl+Alt+Left Arrow key to release it.
I zoomed in on the interface a little bit just to go through the functionality. You’ll have to pardon the slight fuzziness that resulted from the zoom in. If you don’t like the buttons on your VM, you can turn them off by unchecking Toolbar under the View menu.
- Ctrl+Alt+Delete – Since if you press CAD, it will affect your physical machine you can use this handy button to send the keys to your virtual machine.
- Power button – Enabled to turn your VM on in the first place and start it up.
- Turn Off Button – Equivalent to pressing the power button or pulling the plug on your physical machine. You’re better off using the Shutdown button.
- Shutdown button – Signals the OS to shutdown the computer gracefully.
- Save button – Saves your VM exactly as it is so you can resume any task you’re in the middle of later. It turns off the VM when the Save is completed. This can make for start boot times. Instead of booting the machine it just restores the saved state of the VM which is much faster from my experience.
- Pause button – Pause your VM so that you can resume from here later. Pause/Resume button toggles for this spot when pressed.
- Reset button – Similar to the reset button on the front of your computer, this will be a hard shutdown and reboot.
- Snapshot button – Save a version of your VM in its current state so you could restore to this point in the future. This would be useful for making backups and testing major changes. A quick restore is only a few clicks away with the Revert button.
- Revert button – Restore a previously saved snapshot of your VM. This is only enabled after at least one snapshot has been made.
There are some Hyper-V settings that you can tweak and configure to your preference. You’ll see this highlighted in the screenshot below. Just click the Hyper-V Settings link in the top-right frame to get to this window.
To tweak individual settings to your VM, first select it from the list and then in the bottom-right frame choose the Settings link to get to the window below that controls a lot of the hardware, boot order, and other behaviors. This is also where you’d be able to increase or decrease the RAM available to your VM.
You may want to be cautious about using Server 08’s Hyper-V service as I have heard from friends of it causing drastic performance hits on top-of-the-line machines for video and gaming performance. These effects would occur just because the Hyper-V Role was installed on the server and not even in use. If you are seeing a decrease in performance from you computer and are running Hyper-V, you might want to try uninstalling the role to verify that it is the culprit of your problem.