Working with Hyper-V on Windows 10 (1607)

Posted: December 17, 2016 in Windows Server
Enable-WindowsOptionalFeature –Online -FeatureName Microsoft-Hyper-V –All -NoRestart

Creating Virtual Switch

There are 3 types of virtual switch:

External:Gives virtual machines access to a physical network to communicate with servers and clients on an external network,also it communicates connections between Hyper-V VM’s on the same Hyper-V server

Internal:Allows communication between virtual machines on the same Hyper-V server, and between the virtual machines and the management host operating system.

Private:Only allows communication between virtual machines on the same Hyper-V server.

In this exampe we’ll create external switch:

New-VMSwitch -Name External -NetAdapterName (Get-NetAdapter |?{$_.Status -eq "Up" -and $_.NdisPhysicalMedium -eq 14}).Name

Creating Virtual Machine (7 GB,HDD 50 GB)

New-VM -Name 'Hyper-V1' -MemoryStartupBytes 7gb -NewVHDPath 'C:\VM''s\Hyper-V.vhdx' -SwitchName 'external' -NewVHDSizeBytes 50GB -Generation 2

Configure VM’s processor count:

Set-VM -VMName 'Hyper-V1' -ProcessorCount 4

Adding DVD:

get-vm -VMName 'Hyper-V1' | Add-VMDvdDrive
Set-VMDvdDrive -VMName 'Hyper-V1' -Path 'F:\14393.0.160715-1616.RS1_RELEASE_SERVER_EVAL_X64FRE_EN-US.ISO'

Starting VM

Start-VM 'Hyper-V1'

Adding Additional Hard disk

New-VHD -Path 'C:\VM''s\Added.vhdx' -SizeBytes 50GB

In order to locate available Controller location we need to see current VHD properties

4

Add-VMHardDiskDrive -VMName 'Hyper-V1' -Path 'C:\VM''s\Added.vhdx' -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 2

 

If Hyper-V server is located in remote computer we can connect to it by VMConnect.exe

3

But,first,Remote Hyper-V server IP needs to be added to TrustedHosts:

set-item WSMan:\localhost\Client\TrustedHosts -value "192.168.0.42"
Advertisements
Comments
  1. jespernohr2015 says:

    thank you for sharing 🙂

    I used this Cmd-let to locate available Controller location we need to see current VHD properties:

    PS C:\> Get-VM vm001 | select HardDrives

    HardDrives
    ———-
    {Hard Drive on SCSI controller number 0 at location 0, Hard Drive on SCSI controller number 0 at location 1}

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s