How to install the first Virtual Machine in HYPER-V - Part 3

We have install HYPER-V Role in Windows Server 2012 or Windows 8.1 and we are ready to create a new Virtual Machine.

Are you real ready ?

We must consider a few things before the creation of a Virtual Machine.

We need to think some settings to preconfigure once like Virtual Machines ,Virtual disks paths , netowrking and a few things more that i will start to explain right now.

 

Configure default paths for Virtual Machines

After create a new Virtual Machine a folder with the name of the Virtual Machine that include related files created in default path C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines.

Also the same happened for the Virtual disk that you will assign. The default path is C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks.

You don't want this for a lot of reasons.

Do you know why this isn't accepted

You are in the beginning but one of the articles that you must read is the Best Practices for Physical Servers hosting HYPER-V Roles and be sure that you will answer lot of questions that you have.

Lab or Production enviroment you want to have good perfomance and you don't want to troubleshoot your HYPER-V Host all the time. 

For this reason it's recommend from the beginnig to configure the default paths for Virtual Machines and Virtual Disks and must be separate from the disk with the Operating System.

To do this follow the steps

  • From the right side click in HYPER-V Settings.
  • Now from the left side click in Virtual Hard disks and click in Browse button to configure the default path that will save the Virtual Hard disks.
  • You can configure the default path in HYPER-V folder and every time that must save a virtual disk 
  • Open and select the Virtual machine folder as i will describe.
  • Do the same for the Virtual Machines path.
  • For example you can setup a separate partition and create a folder with name HYPERV
  • The structure can be like 
    E:\HYPERV\<Virtual Machine name>\Virtual machine\configuration files
    E:\HYPERV\<Virtual Machine name>\<virtual hard disk files>

Are you confused? 

Don't worry you will understand when proceed in next section which describe how can create a new Virtual Machine.

 

Create the first Virtual Switch 

In most of the cases you want to connect your Virtual Machines in the network.

How can this happened?

We must create a Virtual Switch that will be responsible to connect Virtual machines in the network.

  • From the left side click in Virtual Switch Manager
  • HYPERV has three types of Virtual Switches.
  • Let's explain the three difference here to know the pros and cons for every type
    • External

The external type bound in physical network adapter of the HYPER-V Host.Allow communication between virtual adapters connected to virtual machines and the management operating system

  • Internal

The internal type allow communication only between virtual adapters of virtual machines and the management operating system

  • Private

The private type allow communication only between virtual adapters of virtual machines.

  • Select External and click in Create Virtual Switch.

  • Type the name that you prefer.
  • In Connection type select the Physical Network Interface that you want to use the Virtual Switch.
  • If you have only one then it will already select.
  • But in other cases that you have multiple Network Interfaces in the Server you must select which will be use.
  • By default has a tick in Allow management operating system to share this network drive.
  • If you have only one physical Network Adapter then you can leave it as default because HYPER-V Host and Virtual Machine will share the same Network Interface
  • When you want to apply Best Practises in your HYPER-V Host one of the requirements is to isolate network traffic between HYPER-V and Virtual Machines.
  • So in the Virtual Switch we must untick the Allow management operating system to share this network drive to use the Network Interface only for the traffic of the Virtual Machines.
  • Of course this require to have minimum 2 Physical Network Interfaces in the HYPER-V Host.
  • I leave this option in your decision base on what you want to do.
  • Click OK and you will see the new Virtual Switch in the left side.

Now we are ready to create the first Virtual Machine.

Create the first Virtual Machine

We configure the default paths of HYPER-V, create the virtual switch and now is the time to create a Virtual Machine and start use it.

What are the steps ? Let's start to explain

  • From the right side of HYPER- Manager click New - - > Virtual Machine

  • In the first screen of Wizard just click Next.

  • Specify the name of the Virtual Machine and check in Store the Virtual Machine in different location if you would like to save it in other location.Click Next

  • Select Generation 2 for Windows 2012/8.1 and Generation 1 for Windows 2008/7.
  • For the scenario i select Generation 2.

  • Specify the amount of RAM that you want to give inVirtual Machine.

  • Select the Virtual Switch which create before

  • For the Virtual Hard disk you have 3 options.
    1. Create a virtual hard disk.
    2. Use an existing Virtual hard disk
    3. Attach a virtual hard disk later
  • For every new Virtual Machine i don't recommend the first choice because HYPER-V Manager by default will create a dynamic disk.
    With few words dynamic disk will grow automatic when has no free space any more and can cause serious problems in all your enviroment with free space of your Hard disk in your HYPER-V Host if you aren't monitoring the dynamic disks.
  • Except if you want a dynamic disks for specific reason click in 3rd option Attach a virtual hard disk later. Click Next.

  • Here is just a Summary of all your choices. Click finish to create the Virtual Machine.

  • Now you can see it in the middle part of the HYPER-V Manager.
  • Select the Virtual Machine. From the right side click Settings
  • From the left side click in SCSI Controller.
  • Select Hard drive from the right side . Click Add button

  • Now click New button.

  • Click Next in first screen.

  • As you can see now HYPER-V Manager give you to select between three hard disk types
  • This is the reason which not create the virtual hard disk while create the virtual machine
  • After create the virtual hard disk you can read the article that i wrote to explain How to use differencing Disks in HYPER-V
  • Select Fixed size. Click Next

  • Specify the name of the virtual hard disk and the location.
  • Click Next

  • In Size type how many GB's you want to have the disk.

  • Click Next and Finish to create the disk

  • Now click OK

We have create the new Virtual Machine and now it's time to install the OS to start and use it

After creation

  • Select the Virtual Machine
  • From the right side click Settings
  • Click in Porcessor and change it with the number of Virtual Processors that you want to have that you want to have.
  • By default HYPER-V Manager create thhe Virtual machine with 1 but change it to 2 for now.
  • In next articles i will explain in deep about Virtual Processors and how many must give in yoru Virtual Machines.

  • Select SCSI Controller
  • Select DVD Drive from the right side and click Add

  • Select Image file and click browse to specify the location of the image file with OS.
  • Click OK.

  • Now right click in the Virtual Machine and select Start.

  • Double click in the Virtual machine to open it.
  • Follow the instructions to setup the OS that you prefer.

 

With this article we finish the training of how can create a Virtual Machine with basic configuration.

It's time to start play and test to clear understand how can use HYPER-V Manager to create Virtual Machines.

Tags
Disqus Comments