Introduction
Hyper-V is a native hypervisor developed by Microsoft, which enables platform virtualization on x86-64 systems. It allows multiple operating systems to run concurrently on a physical machine, improving efficiency and flexibility in resource usage.
Overview
This document provides a comprehensive overview of Hyper-V, covering the What, Who, Where, When, Why, How, Consequences, and Conclusion.
What
Hyper-V is a type-1 hypervisor that allows multiple virtual machines to run on a single physical server. It supports isolation of virtualized environments and is commonly used for server virtualization, desktop virtualization, and virtualized test environments.
Who
Hyper-V is designed for IT professionals, system administrators, and developers who need to run multiple operating systems on a single hardware platform. It is used by enterprises, small and medium businesses, and individuals for various virtualization needs.
Where
Hyper-V can be deployed on Windows Server operating systems and Windows 10 Pro and Enterprise editions. It is often used in data centers, cloud environments, and individual workstations.
When
Hyper-V was first introduced with Windows Server 2008 and has since been included in all subsequent versions of Windows Server and Windows 10. It continues to be updated with new features and improvements.
Why
Understanding the pros and cons of Hyper-V can help in determining its suitability for specific use cases.
Pros | Cons |
---|---|
Cost-effective | Requires Windows Server or Pro/Enterprise editions |
Improved resource utilization | Limited support for non-Windows OSes |
Integration with Microsoft ecosystem | Steep learning curve |
How
Here is a basic workflow to set up and manage Hyper-V:
Step 1 | Install Hyper-V via Windows Features or Server Manager |
Step 2 | Create and configure virtual machines through Hyper-V Manager |
Step 3 | Manage virtual machines and resources using Hyper-V Manager or PowerShell |
Consequences
The implementation of Hyper-V brings various positive and negative consequences:
Positive |
|
Negative |
|
Conclusion
Hyper-V is a powerful and versatile virtualization solution that offers numerous benefits, such as cost savings, improved resource utilization, and better disaster recovery. However, it also has some limitations, including initial setup complexity and compatibility issues. Overall, Hyper-V is a valuable tool for organizations looking to optimize their IT infrastructure through virtualization.
Install and Configure
Install Hyper-V to build Virtualization Environment. System requirements are like follows.
- x64(64bit) Computer, and CPU has Intel XD bit (Execute Disable bit) or AMD NX bit (No-Execute bit) feature.
- Possible to enable Intel XD bit or AMD NX bit on BIOS setting and it is now enabled.
Using Command Line Interface (CLI)
Step [1]Run PowerShell with Admin Privilege and Install Hyper-V.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# install Hyper-V with admin tools
PS C:\Users\Administrator> Install-WindowsFeature Hyper-V -IncludeManagementTools
Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
True Yes SuccessRest... {Hyper-V, Windows PowerShell 用 Hyper-V ...
WARNING: You must restart this server to finish the installation process.
# restart computer to apply changes
PS C:\Users\Administrator> Restart-Computer -Force
Using Graphical User Interface (GUI)
Step [2]Run [Server Manager] and click [Add roles and features].
Step [3]Click [Next] button.
Step [4]Select [Role-based or feature-based installation].
Step [5]Select a Host which you'd like to add services.
Step [6]Check a box [Hyper-V].
Step [7]Addtional features are required to add Hyper-V. Click [Add Features] button and proceed to Next.
Step [8]Click [Next] button.
Step [9]Click [Next] button.
Step [10]This is the section to create Virtual Switches. Select a Network adapter for it.
Step [11]This is the section for Migration for Virtula Machines. On this example, keep default and proceed Next.
Step [12]This is the section to specify the location of Virtual Machines' configuration. On this example, keep default and proceed Next.
Step [13]Click [Install] button to begin installation.
Step [14]After finishing installation, Click [Close] button and restart Computer.
Create Virtual Machine (Windows)
On this example, Create a Virtual Machine with installing Windows Server 2019.
Using Command Line Interface (CLI)
Step [1]Run PowerShell with Admin Privilege and configure.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# confirm network adapter names
PS C:\Users\Administrator> Get-NetAdapter
Name InterfaceDescription ifIndex Status MacAddress LinkSpeed
---- -------------------- ------- ------ ---------- ---------
Ethernet0 Intel(R) 82574L Gigabit Network Conn... 6 Up 00-0C-29-C7-54-1A 1 Gbps
# create a virtul switch
PS C:\Users\Administrator> New-VMSwitch -Name "Bridge01" -AllowManagementOS $True -NetAdapterName "Ethernet0"
# confirm
PS C:\Users\Administrator> Get-VMSwitch
Name SwitchType NetAdapterInterfaceDescription
---- ---------- ------------------------------
Bridge01 External Intel(R) 82574L Gigabit Network Connection
# create a directory for virtual machines
PS C:\Users\Administrator> mkdir E:\Virtual_Machine
# set VM name and others
PS C:\Users\Administrator> $ParentDir = 'E:\Virtual_Machine'
PS C:\Users\Administrator> $VMName = 'Win2k19'
PS C:\Users\Administrator> $Switch = 'Bridge01'
# create a virtual machine
PS C:\Users\Administrator> New-VM -Name $VMName `
-MemoryStartupBytes 8GB `
-Generation 2 `
-NewVHDPath "$ParentDir\$VMName\$VMName.vhdx" `
-NewVHDSizeBytes 50GB `
-Path "$ParentDir\$VMName" `
-SwitchName $Switch
Name State CPUUsage(%) MemoryAssigned(M) Uptime Status Version
---- ----- ----------- ----------------- ------ ------ -------
Win2k19 Off 0 0 00:00:00 Operating normally 9.0
# change vCPU count
PS C:\Users\Administrator> Set-VMProcessor $VMName -Count 4
# add SCSI controler
PS C:\Users\Administrator> Add-VMScsiController -VMName $VMName
# set install image
PS C:\Users\Administrator> Add-VMDvdDrive -VMName $VMName `
-ControllerNumber 1 `
-ControllerLocation 0 `
-Path 'C:\Users\Administrator\Documents\Win2019_EN-US_190906-2324.rs5.iso'
PS C:\Users\Administrator> $DVDDrive = Get-VMDvdDrive -VMName $VMName
# set virtual DVD first boot device
PS C:\Users\Administrator> Set-VMFirmware -VMName $VMName -FirstBootDevice $DVDDrive
# start the virtual machine
PS C:\Users\Administrator> Start-VM -Name $VMName
# after this, refer to [13] to install OS
Using Graphical User Interface (GUI)
Step [2]Run [Server Manager] and Open [Tools] - [Hyper-V Manager].
Step [3]Select Hostname on the left pane and right-click it to open the menu, and then select [New] - [Virtual Machine].
Step [4]Click [Next] button.
Step [5]Input name of Virtual Machine. Any name is OK.
Step [6]Specify generation of Virtual Machine. On this example, select [Generation 2].
Step [7]Assign Memory for Virtual Machine.
Step [8]Select Virtual Switch to use networking of Virtual Machine.
Step [9]Configure Virtual Hard Disk. Set parameters you like.
Step [10]Select installation source of GuestOS.
Step [11]Click [Finish] button if that's OK.
Step [12]Virtual machine has been just created. To start it, right-click it and select [Start].
Step [13]To connect the console of Virtual Machine, right-click it and select [Connect].
Step [14]Install GuestOS with common procedure.
Step [15]Installation has finished and Virtual Machine Windows Server is running now.
Create Virtual Machine (Linux)
On this example, Create a Virtual Machine with installing CentOS Linux.
Using Command Line Interface (CLI)
Step [1]Run PowerShell with Admin Privilege and configure.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# confirm network adapter names
PS C:\Users\Administrator> Get-NetAdapter
Name InterfaceDescription ifIndex Status MacAddress LinkSpeed
---- -------------------- ------- ------ ---------- ---------
Ethernet0 Intel(R) 82574L Gigabit Network Conn... 6 Up 00-0C-29-C7-54-1A 1 Gbps
# create a virtul switch
PS C:\Users\Administrator> New-VMSwitch -Name "Bridge01" -AllowManagementOS $True -NetAdapterName "Ethernet0"
# confirm
PS C:\Users\Administrator> Get-VMSwitch
Name SwitchType NetAdapterInterfaceDescription
---- ---------- ------------------------------
Bridge01 External Intel(R) 82574L Gigabit Network Connection
# create a directory for virtual machines
PS C:\Users\Administrator> mkdir E:\Virtual_Machine
# set VM name and others
PS C:\Users\Administrator> $ParentDir = 'E:\Virtual_Machine'
PS C:\Users\Administrator> $VMName = 'CentOS8'
PS C:\Users\Administrator> $Switch = 'Bridge01'
# create a virtual machine
PS C:\Users\Administrator> New-VM -Name $VMName `
-MemoryStartupBytes 4GB `
-Generation 1 `
-NewVHDPath "$ParentDir\$VMName\$VMName.vhdx" `
-NewVHDSizeBytes 20GB `
-Path "$ParentDir\$VMName" `
-SwitchName $Switch
Name State CPUUsage(%) MemoryAssigned(M) Uptime Status Version
---- ----- ----------- ----------------- ------ ------ -------
CentOS8 Off 0 0 00:00:00 Operating normally 9.0
# change vCPU count
PS C:\Users\Administrator> Set-VMProcessor $VMName -Count 2
# confirm virtual DVD drive
PS C:\Users\Administrator> Get-VMDvdDrive -VMName $VMName
VMName ControllerType ControllerNumber ControllerLocation DvdMediaType Path
------ -------------- ---------------- ------------------ ------------ ----
CentOS8 IDE 1 0 None
# set install image to virtual DVD drive
PS C:\Users\Administrator> Set-VMDvdDrive -VMName $VMName `
-Path 'C:\Users\Administrator\Documents\CentOS-8.2.2004-x86_64-dvd1.iso'
PS C:\Users\Administrator> Get-VMDvdDrive -VMName $VMName
VMName ControllerType ControllerNumber ControllerLocation DvdMediaType Path
------ -------------- ---------------- ------------------ ------------ ----
CentOS8 IDE 1 0 ISO C:\Users\Administrator\Documents\CentOS-8.2.2004-x86...
# start the virtual machine
PS C:\Users\Administrator> Start-VM -Name $VMName
# after this, refer to [13] to install OS
Using Graphical User Interface (GUI)
Step [2]Run [Server Manager] and Open [Tools] - [Hyper-V Manager].
Step [3]Select Hostname on the left pane and right-click it to open the menu, and then select [New] - [Virtual Machine].
Step [4]Click [Next] button.
Step [5] Input name of Virtual Machine. Any name is OK.
Step [6]Specify generation of Virtual Machine. On this example, select [Generation 1].
Step [7]Assign Memory for Virtual Machine.
Step [8]Select Virtual Switch to use networking of Virtual Machine.
Step [9]Configure Virtual Hard Disk. Set parameters you like.
Step [10]Select installation source of GuestOS.
Step [11]Click [Finish] button if that's OK.
Step [12]Virtual machine has been just created. To start it, right-click it and select [Start].
Step [13]To connect the console of Virtual Machine, right-click it and select [Connect].
Step [14]Install GuestOS with common procedure.
Step [15]Installation has finished and Virtual Machine CentOS Linux is running now.
- Get link
- X
- Other Apps
Comments
Post a Comment
Thank you for your comment! We appreciate your feedback, feel free to check out more of our articles.
Best regards, Bizantum Blog Team.