Hyper-V on Client – Windows 8 Pro
My Top-4: Hyper-V on Client
For this new release of Microsoft® Windows®, Microsoft is making available a virtualization technology known as Hyper-V™. With Hyper-V on Windows 8 Pro, you will be able to run Windows in a virtual machine just using the software that is included in the box. Windows Virtual PC and XP Mode will not be supported in Windows 8.
This section provides an overview of Hyper-V in Windows 8 and provides information that you can use to answer questions about Virtual PC and XP Mode no longer being supported.
Hyper-V is the name of the virtualization technology included in Windows 8. Previously, Hyper-V was a server-only product included with operating systems like Windows Server® 2008 R2, and was used primarily as the Microsoft solution for virtualizing servers in a datacenter. Because of its roots as a server virtualization product, Hyper-V is an extraordinarily robust VM solution, and supports a broad number of server and datacenter specific scenarios.
Much work was done to bring Hyper-V to client computers to enable Hyper-V to run on them without compromising the client experience. This included things like adding support for the host going into standby and supporting wireless networking.
The management interface that is provided on Windows 8 is the same as what you will see in our server operating systems. While this exposes a broad array of functionality for creating VMs, it also has the potential to make building and running VMs in Windows 8 a more complicated experience. In this section, we will discuss the most important aspects of Hyper-V and the basics of what you need to do in order to get up and running.
Hardware Requirements for Hyper-V
In order to use Hyper-V, your system will need to meet the following requirements.
Windows 8 Pro or Windows 8 Enterprise
- Must be using a 64-bit operating system
- Hyper-V supports both 32-bit and 64-bit VMs
- Minimum of 4GB of RAM
Your CPU must support the following features, and if applicable they must be enabled in theBIOS
- Hardware Assisted Virtualization (HAV) – This may appear as Intel VT in the BIOS
- Dynamic Execution Prevention or No Execute (DEP/NX)
- Second Level Address Translation (SLAT)
- You can use MSINFO32 to determine if your CPU supports everything that is required to run Hyper-V: all of the items in the screenshot below should say Yes in order to support Hyper-V
Figure 1: Hyper-V requirements in MSinfo32
Hyper-V is not enabled by default. It must be enabled through the Turn Windows Features On or Off interface in the Programs Control Panel. After checking Hyper-V and finishing the installation, you will need to reboot your computer.
- In the desktop Control Panel, click Programs, and then Programs and Features.
- Click Turn Windows features on or off.
Click Hyper-V, and then click OK, and then click Close. The computer will then restart.
Figure 2: Turn Windows features on or off
After restarting, you will see two new tiles at the end of your Start Screen.
Figure 3: Hyper-V tiles
Once you’ve installed Hyper-V, the work of configuring, building, and running Virtual Machines happens through the Hyper-V Manager. We will use this interface to configure and use Hyper-V in the next sections.
Figure 4: Hyper-V Manager
Creating a Virtual Switch
Before we create a virtual machine with Hyper-V, we first need to create a network for it to attach to. We do this by creating a Virtual Switch in the Hyper-V Manager.
Note: Creating a virtual switch prior to creating your VM is not strictly necessary, but having it created before you create your VM makes the process of creating the VM much easier. This is why we recommend creating the virtual switch first.
- First, select Virtual Switch Manager in the Actions pane on the right.
Figure 5: Actions pane
In the Virtual Switch Manager, select which type of network you would like to create.
- External – Creates a virtual switch that binds to the physical network adapter so that VMs can access the same network as the host computer. This is the default selection and the most commonly used.
- Internal – Creates a virtual switch that can be used only by the VMs that run on this computer, and between the VMs and the host computer. This type of switch does not allow access to the home network or the Internet.
- Private – Creates a virtual switch that can be used only by the VMs running on the host computer. These VMs will not be able to connect to the host computer over the network, or to the home network or the Internet.
Figure 6: Virtual Switch Manager
- Next, you will need to name the Virtual Switch and specify which physical network connection to attach it to. You can select both Ethernet and WiFi network connections here. In the screenshot below, we have named the switch “Internet Connection” and selected our Gigabit Ethernet connection.
Figure 7: Select external network
- It is possible to create multiple virtual switches, with each connected to a different network adapter. You can use this to attach different VMs to different networks, or to connect one VM to multiple networks. This allows for very flexible network configurations for reproducing a variety of scenarios.
- After you click OK, you will be notified that you may lose network connectivity for a moment while the network configuration is changed.
Figure 8: Applying Networking Changes
Creating a VM
Now that we’ve created the virtual switch, we can create a VM. Before beginning, it would be a good idea to make sure that you have access to the DVD or ISO that you will be using as your installation source.
- From the Actions pane in the Hyper-V Manager, select New > Virtual Machine.
Figure 9: New Virtual Machine
- The New Virtual Machine Wizard appears and provides an overview of the task. Click Next to continue.
Figure 10: Wizard opening screen
- Next you are asked to provide a name for the VM, and if you wish to you can also change the location that the VM will be stored.
Figure 11: Select location for the virtual machine
- The location that you see in the screenshot is the default location where VM configuration files will be stored. You can change this default to another location by opening Hyper-V settings and browsing to Server > Virtual Machines and changing the path. This is useful if you wish to store your VM configuration files on a secondary disk. If you do this, you will likely also want to change the storage location for virtual hard disks, since that is configured separately. We will talk about that in the next few steps.
Note: From here on, you can click the Finish button to automatically create the VM with the defaults defined in Hyper-V.
- Next you are asked to define the amount of memory you want to allocate to the VM. Be sure to allocate enough memory to the VM so that the performance of the VM will be acceptable to you while still leaving enough RAM for the host computer and any other VMs that you would like to run at the same time.
Figure 12: Specify amount of memory
Note: Any memory that you allocate to a VM will no longer be available for use by the host computer when the VM is running.
- Now you are asked to select the virtual switch you would like to connect the VM to. The default state is “Not Connected”, but here I have selected the Virtual Switch that we created previously.
Figure 13: Select virtual switch
- If you want to connect this VM to multiple networks, or change the network that the VM is connected to, we can do this later in the settings for the VM.
- On this step you will create or attach a virtual hard disk for use by the VM. The default configuration is to create a 127GB VHDX in the Public user profile on the computer. From here you can:
- Change the virtual disk size or the location where the VHDX will be stored.
- Browse to an existing VHD or VHDX that you had created previously.
- Skip this step entirely so that you can attach the virtual disk later.
Figure 14: Create or attach a hard disk
- Similar to the VM storage location from step 2 above, the default storage location for virtual disks can be changed in Hyper-V settings. This is useful if you want to store your virtual disks on a secondary disk that is faster or has more storage.
- Hyper-V supports both VHD and VHDX virtual disk files. VHDX is new for Windows 8 and increases the maximum size from 2TB (the maximum for VHD) to 64TB, while also adding additional resiliency features.
- You can attach additional virtual disks to your VM in the settings for the VM.
- You are now asked to choose a method for installing an operating system in the VM.
- If you leave the default option selected, which is to install an operating system later, you can access these same options in the settings for the VM after it is created.
- The most commonly used option will be to install an operating system from a boot CD/DVD-ROM. After selecting this option, you will need to either browse to the ISO file that you will be using for the installation or select the DVD drive that your Windows setup disk is inserted.
Figure 15: Installation options
- Finally a summary of the choices you’ve made is shown, and clicking Finish at this point will complete the wizard and build the VM for you.
Figure 16: Summary of actions
After the VM has been created, you will see it in the list of available Virtual Machines in the Hyper-V Manager.
Figure 17: List of available virtual machines
Modifying a VM
After you have created your VM, you can modify the properties of that VM by selecting Settings from the Actions pane on the right.
Figure 18: Settings window
From this window you can make a wide variety of changes to your VM to alter its startup behavior or hardware configuration, including some of the following:
- Change the BIOS boot order for the VM.
Modify the amount of RAM or number of virtual CPUs allocated to the VM.
- By default, the number of virtual CPUs assigned to a VM is 1, though you can increase this to the same number of physical CPU sockets X CPU cores in your computer. Unlike RAM, these CPUs are shared with the host computer once allocated.
- Add additional hardware like storage controllers, network adapters, virtual hard disks, and DVD drives.
- Attach physical DVD/CDs, ISO DVD images, or virtual floppy disks to the VM.
- Change the behavior of the VM in the event the host computer is started or shut down.
Start a VM
Once you have created and configured your VM, starting it is relatively easy. The VM will be accessed through the Hyper-V Virtual Machine Connection software that is installed as part of Hyper-V, and you can launch this software either directly from the Start Screen or by opening the VM from the Hyper-V Manager.
Figure 19: Connecting to a VM
If you open the Virtual Machine Connection software from the Start Screen, you will see a Windows like the one shown below with an option to connect to a remote Hyper-V host and a list of all the VMs running on that host. Selecting a host and VM will open that VM in the Virtual Machine Connection software.
Note: You will need to run this software as an administrator if you open it from the Start Screen.
Figure 20: VM Connection
Many of the options that were exposed in the settings for the VM are also shown in the menu bar for the Virtual Machine Connection software. You can use this bar to do things like take screenshots, change the DVD that is mounted to the VM, or restart or suspend the VM.
Figure 21: VM Connection menu bar
There is an important distinction that should be made between VMs running in Hyper-V and VMs running in Virtual PC or any other client virtualization software. In Virtual PC, running a VM would open that VM on the user’s desktop and within the context of their user account. Signing out of that user account would stop and close the VM as part of that process.
With Hyper-V, VMs run as part of the Hyper-V service, and not within the context of any particular user account. Closing the Virtual Machine Connection software does not close, suspend, or shut down the VM; it continues to run in the background. Signing out of Windows 8 while a VM is running will allow the VM to continue running in the background. If you reboot the computer while the VM is running, but don’t sign in after the restart, the VM will start on its own and continue to provide services like Remote Desktop or file sharing.
Snapshots provide a way to capture the exact state of a particular VM as it existed at one specific point in time. Unlike a backup or system restore snapshot, this is a complete snapshot of the VM as it exists at the time the snapshot it taken. This means the state of the disk and the contents of memory are saved as well, and you can take these snapshots at any point in time, such as partway through Windows Setup or at beginning of Windows Welcome, should you need to test or repeatedly access these interfaces.
You can quickly take a snapshot of the VM by selecting Action > Snapshot from the menu bar. This will begin taking the snapshot and prompt you to name it.
Figure 22: Snapshot
You can take multiple snapshots of the same VM so that you can just back and forth between different configurations or states of the same VM. All of these snapshots are displayed in the Snapshots section of the Hyper-V Manager.
Figure 23: Snapshots listings
You can apply any snapshot by right-clicking that snapshot in the Hyper-V Manager and selecting Apply. You can also quickly revert back the previously taken snapshot by using the Revert option in the menu bar.
- Any configuration changes you make to a particular snapshot will only apply to that snapshot.
- You can select a snapshot and use the settings for the VM to change things like the hardware configuration or startup behavior, and those changes will only apply to the specific snapshot you have modified.
All of this works together to make Hyper-V a very useful tool for recreating and reproducing customer issues.
There are a lot more specific details here, if anyone wants to go deeper:
For more information about Hyper-V on Windows 8, please read the following resources.
Bringing Hyper-V to Windows 8
Client Hyper-V Survival Guide
Client Hyper-V on Technet
User Interface: Hyper-V Manager