TechSpace Knowledgebase
Search:     Advanced search
Browse by category:
Contact Us

Install Hyper-V and create a virtual machine

Views: 352
Votes: 0
Posted: 27 Mar, 2016
by: Wonglangga S.
Updated: 28 Mar, 2016
by: Wonglangga S.

Applies To: Windows 8.1, Windows Server 2012 R2, Microsoft Hyper-V Server Technical Preview, Windows Server 2012, Windows 10 Technical Preview, Windows Server Technical Preview, Windows 8

This content shows you how to install the Hyper-V on Windows Server 2012 and Windows Server 2012 R2 as well as on Windows 8 and Windows 8.1, Professional and Enterprise editions. It also provides basic instructions for creating and configuring a virtual machine after Hyper-V is installed.

In this document

System_CAPS_noteNote

This topic includes sample Windows PowerShell cmdlets that you can use to automate some of the procedures described. For more information, see Using Cmdlets.

Prerequisites

Before you attempt to install Hyper-V, make sure that you have the following:

  • A user account with administrator permissions for the computer.

  • Enough memory to run all the virtual machines that you plan to run at the same time.

  • Software for the virtual machine. For example, to test a particular workload, you will need installation media for the operating system and the workload. If you want to test certain features of Windows Server 2012, you can use the same installation media in the virtual machine that you used to install Windows Server 2012 on the physical computer.

Step 1: Install Hyper-V

To add the Hyper-V role in Windows Server

  1. In Server Manager, on the Manage menu, click Add Roles and Features.

  2. On the Before you begin page, verify that your destination server and network environment are prepared for the role and feature you want to install. Click Next.

  3. On the Select installation type page, select Role-based or feature-based installation and then click Next.

  4. On the Select destination server page, select a server from the server pool and then click Next.

  5. On the Select server roles page, select Hyper-V.

  6. To add the tools that you use to create and manage virtual machines, click Add Features. On the Features page, click Next.

  7. On the Create Virtual Switches page, Virtual Machine Migration page, and Default Stores page, select the appropriate options.

  8. On the Confirm installation selections page, select Restart the destination server automatically if required, and then click Install.

  9. When installation is finished, verify the installation by opening the All Servers page in Server Manager, selecting a server on which you installed Hyper-V, and viewing the Roles and Features tile on the page for the selected server.

To enable Client Hyper-V

System_CAPS_warningWarning

Because Hyper-V is an optional feature, the files required for installation may or may not be present on your computer, depending on your organization’s IT policy. If you are connected to the Internet, enabling the feature will automatically download the required files. If you are not connected to the Internet, you can download the required files and manually copy them to your computer, or otherwise provide the installation media.

When the Hyper-V role is enabled on a computer running Windows 8 or Windows 8.1 that uses the Always On/Always Connected (AOAC) power model, the Connected Standby power state is not available. For additional information see http://support.microsoft.com/kb/2973536.

  1. In the Control Panel, click Programs, and then click Programs and Features.

  2. Click Turn Windows features on or off.

  3. Click Hyper-V, click OK, and then click Close.

To install the Hyper-V role using the Install-WindowsFeature cmdlet on Windows Server

System_CAPS_warningWarning

In Windows PowerShell, unlike in the Add Roles and Features Wizard, management tools and snap-ins for a role are not included by default. To include management tools as part of a role installation, add the -IncludeManagementTools parameter to the cmdlet. If you are installing roles and features on a server that is running the Server Core installation option of Windows Server 2012, and you add a role’s management tools to an installation, you are prompted to change the installation option to a minimal-shell option that allows the management tools to run. Otherwise, management tools and snap-ins cannot be installed on servers that are running the Server Core installation option of Windows Server.

For more information, see Install-WindowsFeature.

  1. Do one of the following to open a Windows PowerShell session with elevated user rights.

    • On the Windows desktop, right-click Windows PowerShell on the taskbar, and then click Run as Administrator.

    • On the Windows Start page, type any part of the name Windows PowerShell. Right-click the shortcut for Windows PowerShell when it is displayed on the Start page in the Apps results, clickAdvanced, and then click Run as Administrator. To pin the Windows PowerShell shortcut to the Start page, right-click the shortcut, and then click Pin to Start.

  2. Type the following, and then press Enter, where computer_name represents a remote computer on which you want to install Hyper-V. To install Hyper-V directly from a console session, do not include -ComputerName <computer_name> in the command.

    Install-WindowsFeature –Name Hyper-V -ComputerName <computer_name> -IncludeManagementTools -Restart
    
  3. To view a list of available and installed roles and features on the local server, type Get-WindowsFeature and then press Enter. The results of the cmdlet contain the command names of roles and features that have been added to this computer.

    System_CAPS_noteNote

    In Windows PowerShell 3.0, there is no need to import the Server Manager cmdlet module into the Windows PowerShell session before running cmdlets that are part of the module. A module is automatically imported the first time you run a cmdlet that is part of the module. Also, Windows PowerShell cmdlets are not case-sensitive.

  4. When the installation is finished, verify installation by running the Get-WindowsFeature. If you installed Hyper-V remotely, include the ComputerName parameter (Get-WindowsFeature -ComputerName <computer_name>) to view a list of roles and features that are installed on the server.

To install Client Hyper-V using the Get-WindowsOptionalFeature cmdlet

System_CAPS_noteNote

For more information, see Get-WindowsOptionalFeature and Using PowerShell to Set Up Hyper-V

  1. Do one of the following to open a Windows PowerShell session with elevated user rights.

    • On the Windows desktop, right-click Windows PowerShell on the taskbar, and then click Run as Administrator.

    • On the Windows Start page, type any part of the name Windows PowerShell. Right-click the shortcut for Windows PowerShell when it is displayed on the Start page in the Apps results, clickAdvanced, and then click Run as Administrator. To pin the Windows PowerShell shortcut to the Start page, right-click the shortcut, and then click Pin to Start.

  2. Type the following, and then press Enter.

    enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All 
    
  3. When the installation is finished, reboot the computer.

Step 2: Create a virtual machine

Before beginning, review the following considerations. These are not required, but can help you make the most appropriate choices. Consider:

  • What to name the virtual machine. The name provides you with a way to identify the virtual machine. For example, you might use a name that identifies the type of server you want to configure on this virtual machine, such as a web server. Or, you might use a name that identifies the guest operating system.

  • What kind of network connections with the virtual machine need? Will the virtual machine need access to the internet? For more information, see Create a virtual switch.

  • How you will install the operating system. You can install from a physical media or an image (.iso) file. You also can use a virtual hard disk on which an operating system has already been installed.

To do this step using Windows PowerShell, see the commands following the section, To create a virtual machine.

To create a virtual machine

  1. Open Hyper-V Manager.

  2. From the navigation pane of Hyper-V Manager, select the computer running Hyper-V.

  3. From the Actions pane, click New and then click Virtual Machine.

  4. The New Virtual Machine wizard opens. Click Next.

  5. On the Specify Name and Location page, type an appropriate name.

  6. On the Assign Memory page, specify enough memory to start the guest operating system.

  7. On the Configure Networking page, connect the virtual machine to the switch you created when you installed Hyper-V.

  8. On the Connect Virtual Hard Disk and Installation Options pages, choose the option that is appropriate for how you plan to install the guest operating system:

    • If you will install the guest operating system from a DVD or an image file (an .ISO file), choose Create a virtual hard disk. Click Next, and then click the option that describes the type of media you will use. For example, to use an .iso file, click Install an operating system from a boot CD/DVD and then specify the path to the .iso file.

    • If the guest operating system is already installed in a virtual hard disk, choose Use an existing virtual hard disk and click Next. Then, choose Install an operating system later.

  9. On the Summary page, verify your selections and then click Finish.

PowerShell LogoWindows PowerShell equivalent commands

The following Windows PowerShell cmdlet or cmdlets perform the same function as the preceding procedure. Enter each cmdlet on a single line, even though they may appear word-wrapped across several lines here because of formatting constraints.

Run the following command to create a virtual machine named web server with 1 GB of startup memory and use an existing virtual hard disk in which a guest operating system has already been installed.

New-VM –Name “web server” –MemoryStartupBytes 1GB –VHDPath d:\vhd\BaseImage.vhdx

Step 3: Install the guest operating system

This step assumes that you configured the boot media for the virtual machine when you created the virtual machine.

System_CAPS_noteNote

This step must be completed through the GUI. It cannot be automated or performed within a Windows PowerShell session.

To install the guest operating system

  1. From Hyper-V Manager, in the Virtual Machines section of the results pane, right-click the name of the virtual machine and click Connect.

  2. The Virtual Machine Connection tool opens.

  3. From the Action menu in the Virtual Machine Connection window, click Start.

  4. The virtual machine starts, searches the startup devices, and loads the installation package.

  5. Proceed through the installation.

Step 4: Install or upgrade integration services

Hyper-V includes a software package for supported guest operating systems that improves integration between the physical computer and the virtual machine. This package is referred to as integration services. For more information, see Integration Services.

System_CAPS_noteNote

This step must be completed through the GUI. It cannot be automated or performed within a Windows PowerShell session.

To install or upgrade integration services

  1. Open Hyper-V Manager. From the Server Manager Tools menu, click Hyper-V Manager.

  2. Connect to the virtual machine. From the Virtual Machines section of the results pane, using one of the following methods:

    • Right-click the name of the virtual machine and click Connect.

    • Select the name of the virtual machine. In the Action pane, click Connect.

  3. The Virtual Machine Connection tool opens. From the Action menu of Virtual Machine Connection, click Insert Integration Services Setup Disk. This action loads the setup disk in the virtual DVD drive.

  4. Depending on the operating system being installed, you may need to start the installation manually. Click anywhere in the guest operating system window and navigate to the CD drive. Use the method that is appropriate for the guest operating system to start the installation package from the CD drive.

  5. After the installation finishes, all integration services are available for use.

Others in this Category
document How to Clear Your Computer’s CMOS to Reset BIOS Settings
document Configure DHCP Using Policy-based Assignment
document What Are Domains and Forests?
document Phoenix ISA/MCA/EISA BIOS Beep Codes
document How to make a self extracting archive that runs your setup.exe with 7zip -sfx switch
document Configuring a Syslog Agent in Windows Server 2012
document Configuring PHP Development Environment in Windows
document Installing and Configuring target iSCSI server on Windows Server 2012
document How To Make UEFI Bootable USB Flash Drive to Install Windows 8
document TCP/IP Command-line
document How to set up an Internet email account in Outlook 2013 or 2016
document Enable Hyper-V on Windows 8.1
document Quickly Turn ON/OFF Windows Firewall Using Command Line
document How to List All of the Windows and Software Updates Applied to a Computer
document How to Repair a Windows 7 System with an Installation Disc
document How to Create Bootable USB from a Windows ISO
document How to Create Bootable USB from an IMG File
document 20 Terminal shortcuts developers need to know
document How to Update Your BIOS
document Getting Started With Lync Mobile 2010 For Android Devices
document "Attachment size exceeds the allowable limit" error when you add a large attachment to an email message in Outlook
document How do I renew the IP address for my computer ?
document Is your Windows 10 PC slowing you down, and the SFC utility is unable to fix the problem? Then use DISM to repair the Windows image to enable SFC to do its job.
document How to make a full backup of a Windows 10 or Windows 8.1 PC
document How to create a System Restore Point in Windows 10 with a simple double-click
document How to properly remove the Windows.old folder on Windows 10
document How control your Windows 10 PC or phone with another computer with the Connect app
document How to use Bing images within Office and Edge on Windows 10 PC.
document How to fix taskbar search not working in Windows 10
document How to disable or uninstall OneDrive on Windows 10 PC
document How to re-activate Windows 10 after a hardware change
document How to change the system language across your whole Windows 10 PC
document Use Windows Defender Offline to remove tough viruses from your Windows 10 PC
document 16 Essential keyboard shortcuts everyone should know using Continuum for phones
document How to disable Action Center in Windows 10
document How to use Storage Spaces in Windows 10
document How to generate a Battery Report in Windows 10.
document HOW TO CONTROL YOUR PRIVACY IN CHROMEBOOKS VS. WINDOWS 10
document Create Fake File in Window PC in Any Size and Any Format
document INCREASE BATTERY LIFE OF LAPTOP EASILY
document How to perform an image backup in Windows 8.1 or 10
document Block Windows 10 Upgrade
document Chrome reset for adware issues
document Revert from Windows 10 back to previous operating system
document Windows 7 Guide to using Microsoft Security Essentials
document Force Dragon Naturally Speaking to load a particular user profile
document Texthelp Read and Write Gold Prediction returns strange results or receives double letters
document Connect Powershell to your Windows Azure subscription
document How to set up desktop background image rotation in Windows 8
document How to adjust your Laptops screen brightness in Windows 8/8.1
document Microsoft Security Essential Install, Windows 7
document Set the default Microsoft Word template back to a blank document
document Schedule Windows to shutdown or restart after a time limit
document 20 Windows 8 and 8.1 shortcuts
document Bypass Windows 8 and 8.1 login screen
document All the Ways You Can Still Get Windows 10 for Free
document The Complete Guide to Giving Better Family Tech Support
document How to Stop Skype from Running in the Background on Windows 10
document How to Upgrade to a Larger Hard Drive Without Reinstalling Windows
document How to Find and Remove Duplicate Files on Windows
document Scammers Are Using a Fake Version of AdwCleaner to Trick People
document How to Use OneDrive as Your Default Save Location on Windows 8.1
document How To Fix a Blue Screen of Death
document How To Fix Comdlg32.dll Not Found or Missing Errors
document How to Fix Fm20.dll Not Found or Missing Errors
document How to Fix Gdi32.dll Not Found or Missing Errors
document How To Fix Libxml2.dll Not Found or Missing Errors
document How to Fix Mfc42.dll Not Found or Missing Errors
document How to Fix Mfc90.dll Not Found or Missing Errors
document How To Fix Msvcp71.dll Not Found or Missing Errors
document How To Fix Msvcp80.dll Not Found or Missing Errors
document How To Fix Msvcr70.dll Not Found or Missing Errors
document How To Fix Msxml6.dll Errors
document How to Fix Ole32.dll Not Found or Missing Errors
document How To Fix Oleaut32.dll Not Found or Missing Errors
document How To Fix Shell32.dll Not Found or Missing Errors
document How To Fix Sqlite3.dll Not Found or Missing Errors
document How To Fix Ssleay32.dll Not Found or Missing Errors
document How To Fix STOP 0x00000005 Errors
document How To Fix STOP 0x0000007B Errors
document Keep the Windows 10 Taskbar Visible While Using the On-Screen Keyboard
document EdgeDeflector Forces Cortana to Use Your Default Web Browser
document How to Move the Clock to Right-Most Corner on the Taskbar in Windows 10
document Add Control Panel (Or Any Program) To Your Right-Click Menu With a Registry Tweak
document Six Keyboard Shortcuts Every Computer User Should Know
document How to Upgrade Your Computer's Login Screen
document How to Use Windows 8's New File History Backup (aka Time Machine for Windows)
document What Kind of Maintenance Do I Need to Do on My Windows PC?
document How to Do a Clean Install of Windows Without Losing Your Files, Settings, and Tweaks
document How to disable Microsoft Windows 10 keylogger (enabled by default)
document How to Use the Cortana Voice Assistant in Windows 10
document How to Map a Network Drive in Windows 10
document How to Sync Your iPhone with Windows 10
document How to turn Off Windows Update in Windows 10
document How to Change a NetBIOS Name
document How to turn off Windows Automatic Updates in Windows 8/8.1
document How To Disable Updates in Windows 7
document How to Run Disk Cleanup on a Windows 7 Computer
document How to Check If Windows 10 Is Activated or Not
document How to Check CPU Speed
document How to Create a Shortcut to Windows Update in Windows 10
document How to Enter the BIOS Setup Utility or Boot Menu with windows
document How to Install Drivers
document How to Check the Application Event Log for Errors
document How to Optimize Windows 10 Performance by tweaking Visual Effects
document How to Setting Password Protected Print Jobs
document How to Change User Account Name in Windows 10
document How to Set Up and Use Remote Desktop for Windows 10
document How to Find Drivers for Devices Using a Hardware ID
document How to Changing BIOS mode from UEFI to Legacy
document How to Speed Up Windows 10
document How to Outlook 2010 - Rebuild the index file
document How To Fix Outlook 2016 Search Problems
document How to Release and renew IP address
document How to HP Printers - USB Printer Setup (Windows)
document How to disable Windows Defender in Windows 7
document How to Turn On or Off Windows Defender in Windows 8 and 8.1
document How to Use Simple IF Statements in Excel
document Why Does 64-Bit Windows Need Two Program Files Folders?



RSS