install hyper-v and create a virtual machine
DESCRIPTION
Hyper VTRANSCRIPT
-
23/07/2015 InstallHyperVandcreateavirtualmachine
https://technet.microsoft.com/enus/library/hh846766.aspx#BKMK_Step2 1/5
PrintExpand All
Install HyperV and create a virtual machineUpdated: August 19, 2014
Applies To: Microsoft HyperV Server Technical Preview, Windows 10 Technical Preview, Windows 8, Windows 8.1,Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview
This content shows you how to install the HyperV role on a computer running Windows Server 2012. It alsoprovides basic instructions for creating and configuring a virtual machine after HyperV is installed. It doesntprovide configuration instructions for specific usage scenarios, such as configuring HyperV to use scaleout fileservers. Instead, it provides links to other documents that provide those instructions, when available.
In this document
Prerequisites
Step 1: Install HyperV
Step 2: Create a virtual machine
Step 3: Install the guest operating system
Step 4: Install or upgrade integration services
Note
This topic includes sample Windows PowerShell cmdlets that you can use to automate some of the proceduresdescribed. For more information, see Using Cmdlets.
Prerequisites
Before you attempt to install HyperV, 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 installationmedia for the operating system and the workload. If you want to test certain features of Windows Server2012, you can use the same installation media in the virtual machine that you used to install WindowsServer 2012 on the physical computer.
Step 1: Install HyperV
Install HyperV so you can create and run virtual machines on this computer. Select one of the installationmethods:
To add the HyperV role in Windows Server
To enable Client HyperV
To install the HyperV role using the InstallWindowsFeature cmdlet on Windows Server
To install Client HyperV using the GetWindowsOptionalFeature cmdlet
To add the HyperV role in Windows Server
United States English Sign in
Home Windows Server 2012 R2 Windows Server 2008 R2 Library Forums
TechNet LibraryWindows ServerWindows Server 2012 R2 andWindows Server 2012Server Roles and Technologies
HyperVHyperV overviewFeaturesWhats New in HyperV forWindows Server 2012 R2What's New in HyperV forWindows Server 2012Supported guest operatingsystemsInstall HyperV and create avirtual machineConfigureRemotely manage HyperVWindows PowerShellSecurity guide for WindowsServer 2012ScalabilityClusteringMicrosoft Virtual MachineConverter 3.0HyperV ReplicaPosters
-
23/07/2015 InstallHyperVandcreateavirtualmachine
https://technet.microsoft.com/enus/library/hh846766.aspx#BKMK_Step2 2/5
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 areprepared for the role and feature you want to install. Click Next.
3. On the Select installation type page, select Rolebased or featurebased installation and then clickNext.
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 HyperV.
6. To add the tools that you use to create and manage virtual machines, click Add Features. On theFeatures 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 ifrequired, 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 HyperV, and viewing the Roles and Features tile on the pagefor the selected server.
To enable Client HyperV
Warning
Because HyperV is an optional feature, the files required for installation may or may not be present onyour computer, depending on your organizations IT policy. If you are connected to the Internet, enablingthe feature will automatically download the required files. If you are not connected to the Internet, you candownload the required files and manually copy them to your computer, or otherwise provide theinstallation media.
When the HyperV role is enabled on a computer running Windows 8 or Windows 8.1 that uses the AlwaysOn/Always Connected AOAC power model, the Connected Standby power state is not available. Foradditional 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 HyperV, click OK, and then click Close.
To install the HyperV role using the InstallWindowsFeaturecmdlet on Windows Server
Warning
In Windows PowerShell, unlike in the Add Roles and Features Wizard, management tools and snapins for arole 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 thatis running the Server Core installation option of Windows Server 2012, and you add a roles managementtools to an installation, you are prompted to change the installation option to a minimalshell option thatallows the management tools to run. Otherwise, management tools and snapins cannot be installed onservers that are running the Server Core installation option of WindowsServer.
For more information, see InstallWindowsFeature.
1. Do one of the following to open a Windows PowerShell session with elevated user rights.
On the Windows desktop, rightclick Windows PowerShell on the taskbar, and then click Runas Administrator.
On the Windows Start page, type any part of the name Windows PowerShell. Rightclick theshortcut for Windows PowerShell when it is displayed on the Start page in the Apps results,click Advanced, and then click Run as Administrator. To pin the Windows PowerShell shortcutto the Start page, rightclick the shortcut, and then click Pin to Start.
-
23/07/2015 InstallHyperVandcreateavirtualmachine
https://technet.microsoft.com/enus/library/hh846766.aspx#BKMK_Step2 3/5
2. Type the following, and then press Enter, where computer_name represents a remote computer onwhich you want to install HyperV. To install HyperV directly from a console session, do not include ComputerName in the command.
3. To view a list of available and installed roles and features on the local server, type GetWindowsFeature and then press Enter. The results of the cmdlet contain the command names of rolesand features that have been added to this computer.
Note
In Windows PowerShell 3.0, there is no need to import the Server Manager cmdlet module into theWindows PowerShell session before running cmdlets that are part of the module. A module isautomatically imported the first time you run a cmdlet that is part of the module. Also, WindowsPowerShell cmdlets are not casesensitive.
4. When the installation is finished, verify installation by running the GetWindowsFeature. If youinstalled HyperV remotely, include the ComputerName parameter GetWindowsFeature ComputerName to view a list of roles and features that are installed on the server.
To install Client HyperV using the GetWindowsOptionalFeaturecmdlet
Note
For more information, see GetWindowsOptionalFeature and Using PowerShell to Set Up HyperV
1. Do one of the following to open a Windows PowerShell session with elevated user rights.
On the Windows desktop, rightclick Windows PowerShell on the taskbar, and then click Runas Administrator.
On the Windows Start page, type any part of the name Windows PowerShell. Rightclick theshortcut for Windows PowerShell when it is displayed on the Start page in the Apps results,click Advanced, and then click Run as Administrator. To pin the Windows PowerShell shortcutto the Start page, rightclick the shortcut, and then click Pin to Start.
2. Type the following, and then press Enter.
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 mostappropriate choices. Consider:
What to name the virtual machine. The name provides you with a way to identify the virtual machine. Forexample, you might use a name that identifies the type of server you want to configure on this virtualmachine, 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 tothe 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. Youalso can use a virtual hard disk on which an operating system has already been installed.
Do this step using Windows PowerShell
InstallWindowsFeatureNameHyperVComputerNameIncludeManagementToolsRestart
enableWindowsOptionalFeatureOnlineFeatureNameMicrosoftHyperVAll
-
23/07/2015 InstallHyperVandcreateavirtualmachine
https://technet.microsoft.com/enus/library/hh846766.aspx#BKMK_Step2 4/5
To create a virtual machine
1. Open HyperV Manager.
2. From the navigation pane of HyperV Manager, select the computer running HyperV.
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 youinstalled HyperV.
8. On the Connect Virtual Hard Disk and Installation Options pages, choose the option that isappropriate 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, chooseCreate a virtual hard disk. Click Next, and then click the option that describes the type ofmedia you will use. For example, to use an .iso file, click Install an operating system from aboot 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 existingvirtual hard disk and click Next. Then, choose Install an operating system later.
9. On the Summary page, verify your selections and then click Finish.
Windows 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 wordwrapped across several lines herebecause of formatting constraints.
Run the following command to create a virtual machine named web server with 1 GB of startup memory and usean existing virtual hard disk in which a guest operating system has already been installed.
Step 3: Install the guest operating system
This step assumes that you configured the boot media for the virtual machine when you created the virtualmachine.
Note
This step must be completed through the GUI. It cannot be automated or performed within a WindowsPowerShell session.
To install the guest operating system
1. From HyperV Manager, in the Virtual Machines section of the results pane, rightclick the name ofthe 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
NewVMNamewebserverMemoryStartupBytes1GBVHDPathd:\vhd\BaseImage.vhdx
-
23/07/2015 InstallHyperVandcreateavirtualmachine
https://technet.microsoft.com/enus/library/hh846766.aspx#BKMK_Step2 5/5
Was this page helpful?
Community Additions ADD
2015 Microsoft
Manage Your Profile
Newsletter | Contact Us | Privacy Statement | Terms of Use | Trademarks | Site Feedback
HyperV includes a software package for supported guest operating systems that improves integration betweenthe physical computer and the virtual machine. This package is referred to as integration services. For moreinformation, see Integration Services.
Note
This step must be completed through the GUI. It cannot be automated or performed within a WindowsPowerShell session.
To install or upgrade integration services
1. Open HyperV Manager. From the Server Manager Tools menu, click HyperV Manager.
2. Connect to the virtual machine. From the Virtual Machines section of the results pane, using one of thefollowing methods:
Rightclick 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, clickInsert 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 methodthat 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.
See also
HyperV Overview
Virtualization Fabric Design Considerations Guide
Client HyperV and Connected Standby
What's New in Windows Server
HyperV Module for Windows PowerShell
Client HyperV
Supported Windows Guest Operating Systems for HyperV in Windows Server 2012 and Windows 8
Supported Windows Guest Operating Systems for HyperV in Windows Server 2012 R2 and Windows 8.1
Linux and FreeBSD Virtual Machines on HyperV
Yes No