How to install and use the Microsoft Azure Virtual Machine Optimization Assessment tool

January 20, 2017 at 2:41 pm in AD Assessment, Azure, Microsoft Azure Virtual Machine Optimization Assessment, PowerShell, SharePoint, SQL Assessment, SQL Server by Wim Matthyssen

Hi all,

In my first blog post of this year, I will show you how you can install and use the free optimization tool, Microsoft’s Azure Virtual Machine Optimization Assessment. This tool (current version 2.0.61228.1 – released 1/16/2017) can help you optimize performance for your Azure virtual machines (VMs) running AD, SQL or SharePoint workloads. The tool focuses on 6 key areas, including security, compliance, availability, business continuity, performance and scalability. When the tool is first started, it will present a short questionnaire about your cloud deployment, followed by an automated data collection and inspection which will analyze the selected workload running on Azure. After finishing this assessment, which could take upon an hour, a custom report is generated which contains useful advice and key recommendations on how to secure and protect this workload following Microsoft best practices.

I myself mostly use the tool when migrating VMs from on premise to the cloud or after setting up a new Azure cloud environment for a customer.

The tool has the following requirements:

  • It can be installed on any workstation or server (on premise or Azure VM) running at least Windows 7 (or later) or Windows Server 2008 (or later)
  • The server or workstation running the tool should at least have 4GB RAM, a 2 GHz dual-core processor and 5 GB of free disk space
  • The server or workstation should be joined to one of the domains of the AD forest in which the target VMs are part of
  • Microsoft .NET Framework 4.0 should be installed
  • Windows PowerShell 2.0 is also needed
  • Full Administrative access to the Microsoft Azure target environment
  • Access to the Microsoft Azure target environment via WMI
  • Full network connectivity to the Microsoft Azure target environment

Installation of the Microsoft Azure Virtual Machine Optimization Assessment tool

To get started, first download the tool (total size 70,2 MB) from here

clip_image002

clip_image004

When downloaded run MAVMOA.exe (Run as administrator) on the computer you want to run the assessment from (setup requires around 110 MB)

clip_image006

When the UAC screen pops up, click Yes

clip_image007

Agree to the License Terms and select a folder to install (I always use the default folder). Click Install

clip_image008

When the installation is completed click Close. I’ve you leave the checkmark near to Launch Microsoft Azure Virtual Machine Optimization Assessment the tool should start.

clip_image009

If the tool doesn’t start up, you can use the following PowerShell command to start it:

clip_image011

Active Directory Assessment

The user running the tool to should have read access to the target domain. When I run the AD Assessment I always use a user with enterprise admin privileges.

Open the Microsoft Azure Virtual Machine Optimization Assessment tool and select Active Directory from the drop-down menu. Optionally you can agree to upload your data to help improve this product. Click Start Assessment

clip_image012

On the next screen, you are reminded to all requirements needed for the assessment. Click Next

clip_image013

In the next part of the assessment you need to answer a set of questions regarding your environment. Click Next to start the questionnaire and answer all the questions

clip_image014

clip_image015

Once you answered all the questions, the tool will proceed to the Collect & Analyze tab where the assessing of your environment will start

clip_image017

clip_image019

When the tool is finished with the assessing, click Save and view report, and choose a location to save the Microsoft Word document (.docx)

clip_image021

clip_image023

Click Close and Yes to close the tool. You can now open the document using Microsoft Word. In my case Word is not installed on my server so I copied the document to my workstation to review it

clip_image025

If you scroll through the document when opened, you will see that each recommendation is given a percentage weighting. For example, when you resolve the problem concerning “Change your password policy to enforce a minimum password age” your Security and Compliance will improve with 5.2 %

clip_image027

clip_image029

clip_image031

SQL Assessment

Running the SQL Assessment is quite similar as running the AD Assessment, the only difference is that you have to supply the SQL Server that you want to assess.

Open the Microsoft Azure Virtual Machine Optimization Assessment tool and select SQL Server from the drop-down menu. Like before you can optionally agree to upload your data to help improve this product. Click Start Assessment

clip_image032

Click Next on the Requirements page

clip_image033

To start the questionnaire, click Next and answer all questions

clip_image034

clip_image035

On the Environment page add the SQL Server you want to get assessed. Click Next

clip_image036

clip_image037

When the tool is finished with the assessing, click Save and view report, and choose a location to save the Microsoft Word document (.docx)

clip_image038

clip_image040

After saving the document to your preferred location, click Close. When you open the document with Word afterwards, you will also see that each recommendation is given a percentage weighting just like with the AD Assessment. For example, when you resolve the problem concerning “Ensure only essential users are added to the SQL Server sysadmin server role” your Security and Compliance will improve with 2.8 %

clip_image042

clip_image044

clip_image046

I hope this helps you to get started with this nice tool. If you have any issues or questions, feel free to contact me through my twitter handle

Wim Matthyssen (@wmatthyssen)

2016: My blog year in an overview

December 30, 2016 at 2:37 pm in Azure, Azure Backup, Azure RemoteApp, Client Hyper-V, Cloud, DC, Hyper-V, IaaS, PowerShell, Private Cloud, Public Cloud, Replica DC, SCAC 2012 R2, SCVMM 2012 R2, System Center 2016, W2K12R2, Windows 10 by Wim Matthyssen

Hi all,

As a blogger completely focused on Microsoft technologies, it was a fun year of writing about all those interesting and ever changing products and services. As we almost end the year 2016 and are preparing for 2017 to start, I wanted to make a list of all the blog posts I wrote throughout the twelve months of 2016. During the year, I’ve published 26 blog posts mostly about Azure, the System Center Suite and Hyper-V. Below you can find them all divided by technology.

 

clip_image002

Azure Compute – IaaS (ASM)

Step-by-step: Move an Azure IaaS VM between different Azure Subscriptions

Clean up Azure PowerShell when using different Azure subscriptions

Replica DCs on Azure – Removing the Azure Endpoints

Replica DCs on Azure – Transferring FSMO roles to the IaaS DCs

Replica DCs on Azure – Manage the Time Configuration settings on the DCs

Replica DCs on Azure – Domain Controller Health Check

Replica DCs on Azure – Promote the Azure IaaS VMs to a domain controller

Replica DCs on Azure – Add the Active Directory Domain Services role

Replica DCs on Azure – Adjustment of some server settings before promoting the DCs

Replica DCs on Azure – Initialize and format the additional data disk

Replica DCs on Microsoft Azure – Create the VMs with Azure PowerShell

Step by step: Change the drive letter of the Temporary Storage on an Azure IaaS v1 VM

 

Azure Networking

How to connect an Azure ARM VNet to an ASM VNet using VNet Peering

Replica DCs on Azure – Switch DNS servers for the VNet

Replica DCs on Azure – Create the Active Directory site for the Azure VNet

 

Azure Backup

Microsoft Azure Backup Server: Install a new version of the Microsoft Azure Recovery Services Agent

Microsoft Azure Backup Server: System State backup fails with WSB Event ID: 546

Microsoft Azure Backup Server: System State backup fails with the message replica is inconsistent

Step by step: How to install Microsoft Azure Backup Server (MABS)

 

Azure RemoteApp

An RDP connection to the Azure RemoteApp custom VM fails with the following error: “No Remote Desktop License Servers available”

 

Windows 10

How to deploy Windows 10 from a USB flash drive

 

System Center

System Center 2016 evaluation VHDs download links

Step by step: How to connect SCAC 2012 R2 to SCVMM 2012 R2 and Microsoft Azure

Step by step: Installing SCAC 2012 R2

 

Hyper-V

A list of tools that can be used to do a V2V from VMware to Hyper-V

Client Hyper-V – Using nested virtualization to run Client Hyper-V on a Windows 10 VM

 

Before I wrap up this blog post, I want to thank you all for reading my blog posts in 2016, and I really hope you will keep doing so in 2017. I wish you all a healthy, successful and outstanding New Year! See you all in 2017!

Wim Matthyssen (@wmatthyssen)

How to connect an Azure ARM VNet to an ASM VNet using VNet Peering

December 14, 2016 at 4:25 pm in ARM, ASM, Azure, Azure virtual network, Cloud, DC, DNS, VNet peering by Wim Matthyssen

Hi all,

In this blog post I will show you how you can connect an Azure Resource Manager (ARM) virtual network (VNet) to a classic or Azure Service Manager (ASM) VNet using VNet Peering.

VNet Peering, which was made generally available (GA) on September 28th, is a mechanism that allows you to connect two VNets in the same region through the Azure backbone network as they were a single network. This means that you don’t need a VNet gateway anymore, like when you setup a VNet-to-VNet VPN connection. It will allow full connectivity between the entire address space of the peered VNets. So, for example when VNet peering is setup, all virtual machines in the peered VNets will be able to communicate with each other. If you’re interested you can read more about VNet Peering via following link: https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-peering-overview

Before we start setting things up, first some things to keep in mind:

  • VNet Peering requires that both VNets are located the same Azure region
  • The VNets must be in the same Azure Subscription (only for ARM – ASM VNet Peering)
  • The IP address space of both VNets must not overlap
  • Using your peer’s VNet gateway (UseRemoteGateways and AllowGatewayTransit settings) is not supported when peering with an ASM VNet
  • There is a small charge for data transferred between VNets using VNet Peering (inbound and outbound data transfer $ 0,01 per GB)
  • To be clear, you can find below a drawing of my ARM – ASM VNet Peering setup

clip_image002

After all this is said and shown, we can start

1) First of all login to the Azure portal and sign in with your Azure account

2) Select Virtual Networks

clip_image004

3) Select your ARM VNet (in my case AZU-Vnet-ARM)

clip_image006

4) Click Peerings (like you can see there is one connected device AZU-APP-01)

clip_image008

5) Click Add

clip_image010

6) In the Add Peering blade, name your link (in my case LinkToVNetASM). Under Peer details select Classic. Choose the correct Subscription and the ASM Virtual Network you want to peer with. Leave Allow virtual network access Enabled, this will allow communication between the two virtual networks. Then click OK

clip_image011

7) After clicking OK the peering link will be created

clip_image012

8) When done, the two virtual networks are peered and you will see the PEERING STATUS between the two virtual networks is in a Connected state

clip_image014

9) Like you can see, both VMs can ping each other. Don’t forget to allow ping through the Windows Firewall

clip_image016

clip_image018

10) After adding AZU-DC-01 (10.0.1.36) as DNS server to the AZU-Vnet-ARM VNet, I was able to add AZU-APP-01 to the azuvlab.local domain which was created an AZU-DC-01

clip_image020

clip_image022

clip_image024

This concludes this blog post. If you have any questions don’t hesitate to contact me via twitter.

Wim Matthyssen (@wmatthyssen)

How to deploy Windows 10 from a USB flash drive

December 9, 2016 at 1:21 pm in Microsoft, PowerShell, USB, Windows, Windows 10 by Wim Matthyssen

Hi all,

In this blog post, I will show you how you can create your own bootable USB flash drive for Windows 10 installations. And like you will see, it’s pretty easy these days.

Before we start whit the installation a list of some things to keep in mind:

  • An internet connection is needed to download the tool
  • You will need 8 GB of free disk available on the C: drive
  • The minimum capacity of the USB flash drive needs to be at least 4 GB
  • Be aware that all the files on the USB flash drive will be erased
  • Windows 10 Enterprise isn’t available in the media creation tool
  • A Windows 10 product key (for the Windows 10 Edition that will be installed) is needed when you are installing a clean Windows 10
  • To manually download the MediaCreationTool go to the following website: https://www.microsoft.com/en-us/software-download/windows10/

After this short list with things to keep in mind, it’s time start. To do so follow the steps described below:

1) First, make sure your USB flash drive is plugged in

clip_image002

2) Open Windows PowerShell ISE or PowerShell (as administrator) and run the below commands to download the media creation tool to the C:\Temp folder and start it up when downloaded

clip_image004

3) On the License terms page, select Accept to accept the license terms

clip_image006

4) On the What do you want to do? page, select Create installation media for another pc and then select Next

clip_image008

5) Select the proper Windows 10 Edition, Architecture (x86, x64 or both) and Language to install. Click Next

clip_image010

6) Select USB flash drive on the next page and click Next

clip_image012

7) Select the correct USB flash drive and click Next

clip_image014

8) The tool will start Downloading Windows 10

clip_image016

9) After downloaded the necessary files the tool will start Creating Windows 10 media

clip_image018

10) When done click Finish. Your USB flash drive is now ready for use

clip_image020

11) If you select the USB flash drive (E: in my example) you will see all necessary files are in place to start a clean Windows 10 installation

clip_image022

12) Now that you have created the bootable Windows 10 USB flash drive, you can go to the next step: Installing Windows 10 on a pc (desktop or notebook). To do so, plug in the USB flash drive to the pc and boot from USB. In my example I will use a HP notebook. Startup and when the HP logo is shown press the ESC key to go to the Startup Menu (the sentence Press the ESC key for Startup Menu will appear in the left bottom of your screen)

clip_image024

13) Press F9 to open the Boot Device Options menu

clip_image026

14) Select USB Hard Drive 1 – USB DISK 3.0 (in my example this is my USB flash drive)

clip_image028

15) Select the Windows 10 Setup Architecture (64-bit or 32-bit) and press Enter. This will start the Windows 10 installation. Just go to the complete setup procedure and your pc will be up and running with Windows 10 in no time

clip_image030

This completes this blog post. Have fun with it and if you have any questions feel free to contact me.

Wim Matthyssen (@wmatthyssen)

System Center 2016 evaluation VHDs download links

October 3, 2016 at 4:04 pm in Hyper-V, SCDPM, SCOM, SCORCH, SCSM, scvmm, System Center 2016, VHD by Wim Matthyssen

 

Hi all,

Just a short blog post today. Like you probably already know System Center 2016 is officially launched on the 26th of September during Microsoft Ignite.

 

clip_image002

For all you guys running Hyper-V 2012 R2, and I hope that are a lot of you, Microsoft recently also released the System Center Evaluation VHDs (RTM version). The different download links, which you can find below, each consists of files that you extract into a single pre-configured VHD file. There are VHDs for several different System Center components like SCVMM, SCOM and SCDPM, but also for SCSM and SCORCH. When each VHD is downloaded it will enable you to create a VM (Generation 1) which you can use to evaluate and test each different System Center component. Be aware that most of these VMs ran in a Workgroup. It’s best to already have a DC configured and setup in your test environment, so you can join them into your test domain before you start playing around with them.

Hereby the list for are all the System Center 2016 Evaluation VHDs available for download:

Hope this helps you getting familiar with these new releases.

Wim Matthyssen (@wmatthyssen)

Step-by-step: Move an Azure IaaS VM between different Azure Subscriptions

September 12, 2016 at 11:22 am in Azure, Azure subscription, Cloud, IaaS, Microsoft Azure Storage Explorer, Public Cloud by Wim Matthyssen

From time to time, customers ask me to migrate Azure IaaS virtual machines (VMs) between Azure Subscriptions (for example moving a VM between the Dev subscription and the Prod subscription). There are several ways to accomplish this move, you can use Azure PowerShell or Azure Site Recovery (ASR), but mostly I do it the way that I will describe below.

1) First of all, you need to download an Azure Storage Explorer which enables you to move the VHD (page blob) which is used by the IaaS VM from one storage account (Azure Subscription 1) to another (Azure Subscription 2). Mostly I use the Microsoft Azure Storage Explorer which you can download for free via following link: http://storageexplorer.com/

clip_image002

2) When downloaded and installed you’ll need to add the two Azure Blob Storage Accounts, the one you want to move the VHD from and the one you want to move the VHD to. Open up the Microsoft Azure Storage Explorer, right click Storage Accounts and select Connect to Azure storage…

clip_image004

3) To find the Storage Account name and the Account key, just logon to the Classic Azure portal (https://manage.windowsazure.com/). Go to STORAGE select the correct Storage Account and click MANAGE ACCESS KEYS.

clip_image006

clip_image007

4) Fill in the correct Account name (STORAGE ACCOUNT NAME) and the Account key (PRIMARY ACCESS KEY)

clip_image009

clip_image011

5) Repeat steps 3 to 5 also for the Storage Account in the other Azure Subscription. At the end two Storage Accounts should be available to use in the Microsoft Azure Storage Explorer

clip_image013

6) Now stop the VM (logon trough RDP and choose shutdown) and you are good to copy/paste your VM’s VHD from one Storage Account to another

clip_image015

7) Open up Microsoft Azure Storage Explorer, right click the VHD for the VM you just stopped and select Copy

clip_image017

8) Open the other Storage Account’s Blob container (in my example azureos01 – Blob Containers – vhds) and select Paste. Be aware that this copy can take some time depending on the size of the VHD

clip_image019

clip_image021

clip_image023

9) When the VHD is completely copied, open the Azure classic portal and logon to the second Azure Subscription. Go to VIRTUAL MACHINES, then DISKS and select CREATE A DISK

clip_image025

10) Fill in a NAME (for example AZ-VM-SUB2) and select the correct VHD URL from the storage you just moved your VHD file to. Mark “The VHD contains an operating system.” and select Windows. Click the check mark to finish

clip_image026

clip_image028

clip_image030

clip_image032

11) As the next step create a new VM. Click NEW – COMPUTE – VIRTUAL MACHINE – FROM GALLERY

clip_image034

12) Select MY DISKS and select the newly created disk (in my example AZ-VM-SUB2)

clip_image036

13) In the next screen choose a proper VIRTUAL MACHINE NAME, the TIER and the VM SIZE

clip_image038

14) Create a new CLOUD SERVICE or select an existing one, choose the correct VNET and SUBNET. If an AVAILIBILITY SET is required, select or create it

clip_image040

15) Select the ENDPOINTS you require and finally press the check mark icon to start provisioning the VM

clip_image042

16) Like you can see the VM is created and starts Running. You should now able to connect to it again with RDP

clip_image044

image

17) If the VM looks and reacts like it should, you can delete the original VM with the attached VHD in the first Azure Subscription. Also don’t forget to delete the Cloud Service

This concludes this blog post, hope it helps!

Wim Matthyssen (@wmatthyssen)

An RDP connection to the Azure RemoteApp custom VM fails with the following error: “No Remote Desktop License Servers available”

August 30, 2016 at 3:35 pm in Azure, Azure PowerShell, Azure RemoteApp, RDP, W2K12R2 by Wim Matthyssen

A while ago I was setting up Azure RemoteApp at a client. After creating the custom image, I was unable to connect to the newly created Azure IaaS virtual machine (VM) with RDP. The below Remote Desktop Connection error popped up:

clip_image001

The error is caused because the 120-day licensing grace period for the Remote Desktop Server role has expired and you need to install licenses. Which in my opinion is really strange because it’s a new VM created from the Windows Server RDSHwO365P image available at the Azure Marketplace. This being said below you can found out how I finally was able to connect to the VM with RDP.

1) First of all, save a local copy of the RDP file from the Azure portal. I saved it under the C:\Temp folder on my laptop

clip_image003

clip_image005

clip_image007

2) Open Windows PowerShell ISE as an Administrator and run the following PowerShell command prompt to connect. This command will disable licensing for just that connection (change AZUTST by your own RDP file name):

clip_image009

Be aware that only 2 connections are possible at the same time when using /admin.

3) Like you can see below, by using /admin I was able to connect to the VM

clip_image011

clip_image012

clip_image013

clip_image015

This concludes this blog post, hope it helps!

Wim Matthyssen (@wmatthyssen)

A list of tools that can be used to do a V2V from VMware to Hyper-V

August 4, 2016 at 11:49 am in Hyper-V, MVMC, SCVMM 2012 R2, V2V, VMware by Wim Matthyssen

From time to time clients ask me to convert VMware virtual machines (VM) to Hyper-V VMs. Briefly said to do a virtual-to-virtual (V2V) migration.

clip_image002

Most of the times those clients have System Center Virtual Machine Manager 2012 R2 (SCVMM) in place, which can perform those migrations with ease. You can find how you can do this by using SCVMM via following Microsoft TechNet article: https://technet.microsoft.com/en-us/library/gg610672(v=sc.12).aspx

But there are also clients who don’t make use of the System Center Suite, mostly because of the price or because they have a small environment. Therefore, other tools need to be used for these V2V migrations. In this blog post I will list up some of those tools (Microsoft and third party), all with their pros and cons.

Before I start listing them up, I would like to draw your attention to some things you should keep in mind:

  • Always check the current VMware ESX version -> not all tools migrate all versions of ESX
  • Check the guest OS version -> not all tools migrate all versions of the guest OS installed
  • Be aware that almost every migration process will introduce downtime -> no “warm migration”, VMware VM down, Hyper-V VM up
  • Hyper-V GEN 1 VMs -> Only an IDE disk can be used to boot a VM, no SCSI boot from VHD
  • Hyper-V GEN 1 VMs -> Never configure a paging file on a VHD connected to a SCSI Controller
  • Hyper-V GEN 2 VMs -> Only supports the following Windows guest operating systems (OSs): Windows Server 2012 R2, Windows Server 2012, 64-bit versions of Windows 8.1 and 64-bit versions of Windows 8

Below you can find the list of the different V2V migration tools:

1) Microsoft Virtual Machine Converter (MVMC) 3.0

Download link: https://www.microsoft.com/en-us/download/details.aspx?id=42497

Microsoft TechNet article: https://technet.microsoft.com/en-us/library/dn873998(v=ws.11).aspx

Pros:

  • Free
  • Automation via PowerShell
  • Can integrate with System Center Orchestrator (SCORCH) 2012 R2
  • VM and physical server (online) conversion
  • Not only Hyper-V but also Microsoft Azure is available as migration destination
  • Uninstalls VMware tools before an online conversion (VMware tools will not be uninstalled when an offline conversion is used)

Cons:

  • No GEN 2 VM support

2) 5nine V2V Easy Converter 6.5 free version

Download link: http://www.5nine.com/vmware-hyper-v-v2v-conversion-free.aspx

Pros:

  • Free
  • GEN 2 VM support
  • Ability to override the number of vCPUs and the available vMemory
  • Remap the vNetwork
  • Ability to override the VM start/stop/delay actions
  • Automatic conversion into a Highly Available Hyper-V VM is available
  • Faster than MVMC

Cons:

  • No automation trough PowerShell for the migration process in the free edition (only in the payed edition)
  • Does not remove VMware tools automatically

3) StarWind V2V Converter

Download link: https://www.starwindsoftware.com/converter

Pros:

  • Free
  • Converts VMs from any format (VMDK, VHD, VHDX, …) to another

Cons:

  • Requires registration in order to download it
  • Does not remove VMware tools automatically

Before ending this post, I also want to mention the Disk2vhd tool which enables you to do a physical-to-virtual (P2V) migration. You can dowload it via following link: https://technet.microsoft.com/en-us/sysinternals/ee656415.aspx

You can also read all about how to use this tool in a blog post I wrote some time ago: http://scug.be/wim/2015/01/22/how-to-perform-a-p2v-with-disk2vhd/

Like you can see you have several tools you can use, all with their advantages and possible disadvantages. Newer versions of those tools mostly include new features and add support for more OSs. I mostly prefer to use MVMC if SCVMM is not available to do the migration, but off course the choice is all yours. Hopefully this list helps, till next time!

Wim Matthyssen (@wmatthyssen)

Clean up Azure PowerShell when using different Azure subscriptions

July 27, 2016 at 12:34 pm in Azure, Azure PowerShell, Azure subscription, Cloud, PowerShell by Wim Matthyssen

Hi all,

These days I’m working on several Azure projects for different clients. As a result, my default subscription data file which is used by Azure PowerShell is completely filled up with settings from those different subscriptions. Frequently, I notice that Azure PowerShell mixes up all this information and does not perform as expected. I strongly assume this is caused by the cached credentials and other elements. In order to fix this, I regulary clean up my Azure PowerShell to have a better overview and to accomplish a better working scripting environment. Below you can find the Azure PowerShell cmdlets to clear a specific customer’s Azure subscription from Azure PowerShell. I will also show you how you can clear your complete Azure profile.

Delete a specific Azure subscription from PowerShell

1) Open up PowerShell ISE as an Administrator and run the following PowerShell cmdlets to list all Azure subscriptions available in the default subscription data file on the computer in use, which can be found under the following location C:\Users\%username%\AppData\Roaming\Windows Azure PowerShell and is named AzureProfile.json

clip_image002

2) To delete a specific subscription from the date file run the below cmdlet (adjust for your own purpose). You may be sure that this cmdlet will not delete the subscription from Azure in any way. You can use this cmdlet with the -Force parameter to suppress the confirmation prompt

clip_image004

3) If the above cmdlet ran without any errors the specific subscription will not be shown anymore when you’re re run the Get-AzureSubscription cmdlet and it should also be cleared from the subscription data file

Clear your complete Azure Profile

1) Open up PowerShell ISE as an Administrator and run the following PowerShell cmdlets to completely clear your Azure Profile on the computer in use

clip_image006

2) If the cmdlet ran without any errors your Azure Profile should be cleared.

This ends this short blog post, hope it helps and till next time!

Wim Matthyssen (@wmatthyssen)

Client Hyper-V – Using nested virtualization to run Client Hyper-V on a Windows 10 VM

July 18, 2016 at 7:37 pm in Client Hyper-V, Hyper-V, Nested Virtualization, PowerShell, W2K16 TP5, Windows 10 by Wim Matthyssen

From Windows 10 build 10565, Microsoft added a long awaited feature called nested virtualization. This technology will allow you to run Hyper-V inside of a virtual machine (VM) running on a Windows 10 (Client Hyper-V) or Windows Server 2016 host. In other words, in the simplest configuration it enables you to install Hyper-V in a guest VM, whit the possibility to create and also run VMs on top of that Hyper-V host VM. Completely different than the previous situation with Windows Server 2012 R2 or Windows 8.1, were you could create the VMs, but weren’t able to actually start them. This new feature kind of creates a second virtualization layer, like shown in the detailed screenshot below.

clip_image002

This new technology is very useful when you are setting up a test/lab environment because there is no need to buy a lot of expensive hardware anymore, it simply can run on top of your notebooks OS. It also comes in handy whenever you want to train you’re failover clustering or even your System Center skills. But it’s main purpose and probably Microsoft’s main reason to finally created this feature, is to enable you to work with Hyper-V containers (operating system level virtualization). If you’re interested in reading more about this type of containers you can do so via following link: https://msdn.microsoft.com/en-us/virtualization/windowscontainers/management/hyperv_container

Now before we start playing around with this new feature, I will first list up some things you should really keep in mind:

  • The Hyper-V host must be running at least Windows 10 build 10565 or Windows Server 2016 Technical Preview (TP) 4
  • An Intel processor with Intel VT-x (AMD-V is not supported yet) and EPT technology is needed to be able to use Hyper-V
  • Currently only Hyper-V is supported, all other hypervisors like for example vSphere ESXi will fail to run
  • Be aware that some VM features are not supported or will fail: Dynamic Memory, applying checkpoints, Live Migration and save/restore, hot memory resizing
  • The VM should have more than 1 vCPU
  • At least 4 GB RAM should be attached to the VM
  • MAC address spoofing must be enabled on the NIC attached to the VM
  • If you’re using Windows 10 Enterprise as the host, you should turnoff Virtualization Based Security (VBS) because it will prevent the use of nested virtualization
  • Plenty of available RAM is needed (at least more than 4GB of RAM is preferred to get started)

After going through the theory it’s now time to get our fingers wet and get everything up and running. I will walk you through all the different steps needed to use this feature on a Windows 10 Enterprise computer. In my example I will setup a generation 1 VM (Windows 10) with a PowerShell script to test the nested virtualization scenario. So off we go.

1) First of all, you should check your windows version (should be build 10565). Click run and type winver

clip_image003

clip_image004

2) Create two internal virtual switches, one is to use your wireless card and the other one will be used in a later step as a Hyper-V vSwitch inside the VM

clip_image006

3) To install the VM, run the following PowerShell script (customize to your need).

clip_image008

clip_image010

4) Go through the Windows Setup Installation Process on the newly created VM

5) When installation is completed shutdown the VMs and run following PowerShell commands on the Windows 10 computer (host) to set the Virtualization Extension for the vCPUs and to enable MAC spoofing on both VMs. Be aware a warning message will appear that Nested Virtualization is an unsupported preview feature. When both commands ran successfully start up the Windows 10 VM

clip_image012

6) To configure the W10-TST VM and to install the Client Hyper-V role with all tools, run the following PowerShell script (customize to your need). Connect to the VM with a Virtual Machine Connection with Enhanced session enabled

7) To create an external virtual switch on W10-TST, logon to this sever with RDP and run the following PowerShell cmdlet as administrator (customize to your need)

clip_image014

8) To create a nested VM named VM1-NESTED on W10-TST, logon to this VM with RDP and run the following PowerShell script as administrator (customize to your need)

clip_image016

9) Go through the Windows Setup Installation Process on the newly created nested VM named VM1-NESTED on W10-TST

10) If the installation is successful, you should now have a nested VM running like in the screenshot below

clip_image018

This concludes this blog post. Keep tuned and I’ll be back soon.

Wim Matthyssen (@wmatthyssen)