Skip to content

Instantly share code, notes, and snippets.

@neelabhg
Last active November 13, 2022 00:13
Show Gist options
  • Save neelabhg/000d7628e2309b976f5eb7816d2f3853 to your computer and use it in GitHub Desktop.
Save neelabhg/000d7628e2309b976f5eb7816d2f3853 to your computer and use it in GitHub Desktop.
An Overview of Hyper-V (2015-09-15)

Hyper-V

Microsoft's Hyper-V is a native (bare-metal) hypervisor available on Windows Server 2008 and later, and select editions of Windows 8 and later. (From Wikipedia)

From Hyper-V overview:

The Hyper-V technology virtualizes hardware to provide an environment in which you can run multiple operating systems at the same time on one physical computer. Hyper-V enables you to create and manage virtual machines and their resources. Each virtual machine is an isolated, virtualized computer system that can run its own operating system. The operating system that runs within a virtual machine is called a guest operating system.

Versions

Microsoft provides Hyper-V through various channels:

  1. As a component (role) of the Windows Server operating system.
  2. As a free (unlimited evaluation) dedicated stand-alone product, known as Hyper-V Server. It contains the hypervisor, Windows Server driver model, virtualization capabilities, and supporting components such as failover clustering, but does not contain the robust set of features and roles as the Windows Server operating system. (From the TechNet Evaluation Center page)
  3. As an optional feature in Windows 8 and Windows 8.1, known as Client Hyper‑V.

Hyper-V in Windows Server and Hyper-V Server are available in two main versions, corresponding to the different versions of Windows Server:

  1. Windows Server 2008 and Windows Server 2008 R2
  2. Windows Server 2012 and Windows Server 2012 R2

The rest of this document and the links to sources apply to the version of Hyper-V corresponding to Windows Server 2012 and Windows Server 2012 R2, although the information here is general enough to be applicable to both versions.

Management

Hyper-V can be managed using the following tools:

  • Hyper-V Manager: A GUI tool (a Microsoft Management Console (MMC) snap-in) that is used to manage the Hyper-V role and virtual machine configurations.

  • Virtual Machine Connection: A GUI tool that provides direct remote connectivity to a virtual machine. It provides access to the video output of a virtual machine to facilitate interaction with the virtual machine.

  • Hyper-V-specific cmdlets for Windows PowerShell, which can be used to manage the Hyper-V role and virtual machines interactively or through scripts.

All these tools can be used locally (on the server running Hyper-V) or remotely (on a Windows machine connected to the Hyper-V server through a network).

Another way to manage Hyper-V remotely is by using Remote Desktop Services. In this method, a Windows machine can be used to remotely control a Hyper-V server using Remote Desktop Connection. Once the connection is established, local management tools on the server running Hyper-V can be used.

The versions of Hyper-V management tools on a remote machine and the host operating system running the Hyper-V server have to be compatible. See the "Availability and compatibility" section in the documentation here for a compatibility chart.

Management through the command-line

Windows Server 2012 includes the Hyper-V Module for Windows PowerShell, which provides command-line access to all the functionality available in the GUI tools, as well functionality not available through the GUI. The module includes more than 160 Hyper-V cmdlets. These cmdlets provide an easy way to automate Hyper-V management tasks. (Windows Server 2008 does not include any such module, but a free and open source library of PowerShell functions is available. See this TechNet Magazine tip for more information.)

This page on TechNet provides an alphabetical list of all Hyper-V cmdlets in Windows Server 2012 R2 and Windows 8.1, as well as links to reference content for each cmdlet, including examples (click on the "Other Versions" dropdown to see this list for other versions of Windows Server and Windows). This comprehensive listing provides all the possible administrative tasks for Hyper-V. The bottom of that page also shows how to view a list all the cmdlets that are available for Hyper-V ("run the Get-Command -Module Hyper-V command") and how to get more information about any of the cmdlets from the command line.

Here are some example tasks and the associated Windows PowerShell commands to perform the tasks (taken from here):

  • Create a new virtual machine named "test" New-VM –Name Test

  • Get a list of all virtual machines Get-VM

  • Create a new virtual hard disk at d:\VHDs\test.vhd New-VHD –Path D:\VHDs\test.vhd

  • Start all virtual machines whose name begins with "web" Start-VM –Name web*

  • Connect the virtual network adapter on the "test" virtual machine to the "QA" switch Connect-VMNetworkAdapter –VMName test –SwitchName QA

Getting Started

This TechNet document guides through installing Hyper-V, creating a virtual machine, and installing the guest operating system on the virtual machine. The document does not explain much about creating a virtual switch, which enables network connections for the virtual machine, so here is a great guide on doing just that (warning: non-https link).

Once Hyper-V and one or more virtual machines are set up, the management tools mentioned in the last section can be used to perform almost any administration or configuration tasks needed.

Further Reading

This TechNet document lists the topics in the Hyper-V documentation library for the Hyper-V role in Windows Server and provides links to other information resources, including downloadable content, blogs, videos and a contact link that can be used to ask questions and provide feedback. Writers update articles on a continuous basis as new information becomes available and as users provide feedback.


© 2015, Neelabh Gupta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment