Category: Hyper-V

Migrate Hyper-V VMs to Azure using Azure Migrate

Assess and Migrate Hyper-V VMs with Azure Migrate

Today, the Azure Migrate team launched an update to the Azure Migrate service, which can help you discover, assess, and migrate applications, infrastructure, and data from your on-prem environment to Microsoft Azure. This is excellent timing since we all know that Windows Server 2008 and Windows Server 2008 R2 are soon out of support and you get free extended security updates if you migrate your VMs to Azure. With Azure Migrate, you can now centrally track the progress of your migration journey across multiple thrid-party and Microsoft tools. In addition, Azure Migrate can now assess and migrate your Hyper-V virtual machines (VMs).

With the latest release of Azure Migrate you can now:

  • Extensible approach with choice across Microsoft and popular ISV assessment and migration tools
  • Integrated experience for discovery, assessment, and migration with end-to-end progress tracking for servers and databases
  • Server Assessment and Server Migration for large-scale VMware, Hyper-V, and physical server migrations
  • Database Assessment and Database Migration across various database targets including Azure SQL Database and Managed Instance

You can find more about the Azure Migrate capabilities on Microsoft Docs. For more information on Azure Migration, check out my blog post about Azure Migration on the Nigel Frank International blog. In this post, I am going to show you how you can step-by-step assess and migrate Hyper-V VMs to Azure using Azure Migrate.

Preparation

First, you need to prepare your Azure to set the right permissions and prepare the on-premises Hyper-V hosts and VMs for server assessment and migration. You can find more about the details for permissions and host preparations on Microsoft Docs.

Next, you will need to create a new Migration project for servers. Click on Asses and migrate servers.

Azure Portal Azure Migrate

Azure Portal Azure Migrate

Now you will need to add the tools you want to use for the assessment as well as for the migration, click on “add tools”.

Getting started

Getting started

You will need to create a new Azure Migrate project. Enter the details for your subscription, resource group, and a name for the project. You will also need to choose a region where your project is going to be deployed. No worries, this will only store the assessment data, you can still select another region for the migration.



PowerShell Get-WindowsImage Windows Server 2019 Editions

Add Drivers to a Windows Server 2019 ISO Image

In this blog article, I am going to show you how you can add drivers to a Windows Server 2019 ISO Image or WIM file using PowerShell and the DISM module. This will allow you to already have the latest drivers within the Windows Server installation image when you install Windows Server 2019. We will add drivers to a Windows Server 2019 WIM file (WIM stands for Windows Imaging Format), which then can be used to create a new ISO image or for example in Windows Deployment Services.

Preparation

Folder for adding drivers to Windows Server 2019

Folder for adding drivers to Windows Server 2019

First, you will need to create three new folders called Drivers, ISO, and Mount. In my example, I created these in C:\Images.

  • Drivers – This is the folder where you put all your extracted drivers, which you want to add to your Windows Server 2019 Image.
  • ISO – This is where you can extract the Windows Server 2019 ISO Image. Basically all the files on the ISO file.
  • Mount – This is an empty folder, which will be used to mount the WIM files.

You can now mount the ISO using Windows Explorer or the following PowerShell commands and copy the files to the ISO folder.

Mount ISO PowerShell

Mount ISO PowerShell

Mount-DiskImage -ImagePath C:\Temp\17763.379.190312-0539.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso
Copy-Item D:\* C:\Image\ISO\ -Recurse

In your case, the ISO may be mounted on a different drive letter instead of my D: drive.

Add drivers to the Windows Server 2019 Image

First, you can check in which Windows editions you want to add the drivers. To check that you can use the following PowerShell command:

Get-WindowsImage -ImagePath C:\Image\ISO\sources\install.wim
PowerShell Get-WindowsImage Windows Server 2019 Editions

PowerShell Get-WindowsImage Windows Server 2019 Editions

The Get-WindowsImage cmdlet will show you the different editions included in the WIM file.

After we have seen the Index numbers, we can now mount the Windows Image our Mount folder. In my example, I use Image Index 3, which is the Windows Server 2019 Datacenter Core Edition. If you want to check which editions of Windows Server 2019 you should use, check out the Microsoft Docs.

Mount-WindowsImage -Path C:\Image\Mount -ImagePath C:\Image\ISO\sources\install.wim -Index 3
Mount-WindowsImage

Mount-WindowsImage

After the image is mounted you can now add the drivers to the Windows Server 2019 Image using the following command:

Add-WindowsDriver -Path C:\Image\Mount -Driver C:\Image\Drivers -Recurse
Add Drivers to Windows Server 2019 ISO Image

Add Drivers to Windows Server 2019 ISO Image

After you have added all the drivers to the image, you need to dismount the image and save it.

Dismount-WindowsImage -Path C:\Image\Mount -Save

We have now added the drivers to the Install image, and you should also add the drivers to your boot image if it is, for example, a network or storage controller driver you might need to install the server. To do this do the same steps to the C:\Image\ISO\sources\boot.wim.

Now you can use these WIM files with Windows Deployment services or create a USB drive to install Windows Server 2019. If you want to create an ISO file, you can use the oscdimg command-line tool. The oscdimg tool comes with the Windows Assessment and Deployment Kit (Windows ADK), which you can get here.

oscdimg -n -m -bc:\temp\ISO\boot\etfsboot.com C:\temp\ISO C:\temp\mynew.iso

I hope this post helps you to add drivers to your Windows Server image. If you have any questions, feel free to leave a comment.



Nigel Frank Migrating and extending with Microsoft Azure

Article about Azure Migration on Nigel Frank International

This week my blog post on Azure Migration and Hybrid Cloud on the Nigel Frank International blog went live. The title of the article is, Migrating and extending your on-premises environment with Microsoft Azure. In that blog post, I what your advantages are by using the cloud and some of the different approaches to use Microsoft Azure. Before I then go deeper on different Azure scenarios and topics.

I cover a lot of different Azure options like:

Nigel Frank International

The public cloud is becoming more and more important for companies that want to stay agile and flexible to meet their business demands. But if a company decides to move to the public cloud, what are the best ways to migrate to Microsoft Azure? In this blog post, we’ll take a quick look at what services Microsoft offers to make your cloud migration easier.

It was fun to work with the team at Nigel Frank International and I hope you like the article.



Ubuntu VM on Windows 10

How to create an Ubuntu VM on Windows 10

Windows 10 is not just a modern desktop operating system, and it also has some great IT Pro and Developer related features build in. One of them is client Hyper-V. This is the same hypervisor which powers virtualization in Windows Server and the Microsoft Azure datacenters. With Hyper-V, you can create virtual machines running on Windows 10, without the need for third-party software. You can not just run Windows virtual machines, and you can also run Linux virtual machines. In this blog post, I am going to show you how you can create an Ubuntu VM on Windows 10 using Hyper-V.

If you want to know more about Hyper-V on Windows 10, check out the Microsoft Docs.

Install Hyper-V

First, you will need to install Hyper-V on your Windows 10 computer. Hyper-V on Windows 10 has the following requirements:

  • Windows 10 Enterprise, Professional, or Education (Home does not have the Hyper-V feature included)
  • 64-bit Processor with Second Level Address Translation (SLAT)
  • CPU support for VM Monitor Mode Extension (VT-c on Intel CPU’s)
  • Minimum of 4 GB memory

The easiest way to enable Hyper-V on Windows 10 is to run the following PowerShell command as an administrator:

Enable-WindowsOptionalFeature -Online -FeatureName:Microsoft-Hyper-V -All

After you have installed Hyper-V, you need to restart your computer.

Create an Ubuntu virtual machine on Windows 10

To create an Ubuntu virtual machine on Windows 10 Hyper-V, you could download the Ubuntu ISO file and install it like any operating system. However, there is a much easier way, using the Hyper-V Quick Create feature. In the Hyper-V VM Gallery, you will find not just two Windows 10 virtual machines; you will also currently find Ubuntu 18.04 LTS and Ubuntu 19.04. These are prepared Hyper-V virtual machines images, ready for you to download and install.

Ubuntu Hyper-V VM Images

Select the Ubuntu version you want to install and click on Create Virtual Machine. This will start downloading the virtual machine image.

Downloading Ubuntu Hyper-V VM Image

After the image is downloaded, you can either connect to the virtual machine and start it, or you can first modify the virtual machine settings.

Ubuntu 18.04 LTS Hyper-V VM

Optional: If you click on Edit settings, you will be able to configure the virtual machine hardware settings like vCPU or vRAM. You can also enable Secure Boot. If you enable Secure Boot for a Linux virtual machine, make sure you change the Secure Boot template to Microsoft UEFI Certificate Authority.

Ubuntu Hyper-V UEFI Secure Boot Settings

You can now start the Ubuntu VM.

Start Ubuntu hyper-V VM

 

This will boot you in the Ubuntu installation, where you can set up your Ubuntu operating system.

Install Ubuntu VM

All the specific Hyper-V drivers for Ubuntu, are already included in the image. This allows you to use features like Hyper-V Enhanced Session Mode, which enables you also to use copy-paste, and others.

Ubuntu VM on Windows 10

I hope this gives you a step-by-step guide, how you can create an Ubuntu VM on Windows 10 using Hyper-V. If you have any questions, please let me know in the comments.



Microsoft Hyper-V Server 2019

Download Hyper-V Server 2019 now

A lot of people have been waiting for this. After the release of Windows Server 2019 back in October 2018, you were able to download Windows Server 2019 Standard, Datacenter and Essentials. Today you can also download Microsoft Hyper-V Server 2019. This is the free version of the Hyper-V role which you can find in Windows Server 2019. It includes all the great Hyper-V virtualization features like the Datacenter Edition. This is especially interesting if you don’t need to license Windows Server VMs, and is ideal when you run Linux Virtual Machines or VDI VMs.

This version of Hyper-V also comes with a lower footprint, since it is only available as Server Core and doesn’t include any other roles and features, which are not related to virtualization. That said, it does not come with other Software Defined Datacenter features like Storage Spaces Direct (S2D). These features are only included in the Windows Server Datacenter edition.

Microsoft Hyper-V Server is a free product that delivers enterprise-class virtualization for your datacenter and hybrid cloud. Microsoft Hyper-V Server 2019 provides new and enhanced features that can help you deliver the scale and performance needs of your mission-critical workloads.

The Windows hypervisor technology is the same as what’s in the Hyper-V role on Windows Server 2019. It is a stand-alone product that contains only the Windows hypervisor, a Windows Server driver model, and virtualization components. It provides a simple and reliable virtualization solution to help you improve your server utilization and reduce costs.

You can download Microsoft Hyper-V Server 2019 ISO from the Microsoft Evaluation Center. You should also have a look at the Windows Admin Center, which is a locally deployed, browser-based app for managing servers, clusters, hyper-converged infrastructure, and Windows 10 PCs

If you want to learn more about the new Hyper-V and Windows Server 2019 features, check out my blog: Windows Server 2019 – What’s coming next



Install WSL 2 on Windows 10

With the Windows 10 Insider Preview Build 18917, the team also ships the first version of the Windows Subsystem for Linux 2 (WSL 2), which was announced at the Microsoft Build 2019 conference. In this post, I am going to show you how you can install WSL 2 on your Windows 10 machine.

The Windows Subsystem for Linux (WSL 1) was in Windows 10 for a while now and allowed you to use different Linux distros directly from your Windows 10 machine. With WSL 2, the architecture will change drastically and will bring increased file system performance and full system call compatibility. WSL 2 is now using virtualization technology (based on Hyper-V) and uses a lightweight utility VM on a real Linux kernel. You can find out more about WSL 2 in the release blog or on the Microsoft Docs Page for WSL 2.

WSL 2 Architecture

Requirements

To install WSL 2, you will need the following requirements:

Install WSL 2

To install the Windows Subsystem for Linux 2 (WSL 2), you need to follow these tasks.

  • Enable the Windows Subsystem for Linux Optional feature (WSL 1 and WSL 2)
  • Install a distro for the Windows Subsystem for Linux
  • Enable the ‘Virtual Machine Platform’ optional feature (WSL 2)
  • Configure the distro to use WSL 2

Enable the Windows Subsystem for Linux

To run the WSL on Windows 10 you will need to install the optional feature:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Install a Linux distro for the Windows Subsystem for Linux

If you don’t already have installed a WSL distro, you can download and install it from the Windows 10 store. You can find more here: Crazy times – You can now run Linux on Windows 10 from the Windows Store

Enable the Virtual Machine Platform feature

WSL 2 Enable Virtual Machine Platform

WSL 2 Enable Virtual Machine Platform

To make use of the virtualization feature for WSL 2, you will need to enable the optional Windows feature. You can run the following PowerShell command to do this. You will need to start PowerShell as an Administrator. After you run this command, you might need a restart of your computer.

Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform

Set WSL distro to use version 2

After you completed the first two steps, you will need to configure the distro to use WSL 2. Run the following command to list the available distros in PowerShell:

wsl -l -v

To set a distro to WSL 2 you can run the following command:

wsl --set-version DistroName 2

You can also set WSL 2 as the default:

wsl --set-default-version 2

To find out more about installing WSL 2, check out the Microsoft Docs page.

If you are now running your distro using WSL 2, you can now see that there is a Virtual Machine worker process running and if you search a little bit more, you can also find the VHDX file of the distro.

WSL 2 VHDX file

I hope this helps you and gives you a quick overview, if you have any questions, let me know in the comments and check out the WSL 2 FAQ. The Windows Subsystem for Linux 2 Kernel is also open-source, you can follow the project on GitHub.



Azure Generation 2 Virtual machine

Generation 2 VM support on Azure – and why should I care?

A couple of days ago Microsoft announced the public preview of Generation 2 virtual machines on Azure. Generation 2 virtual machines support a bunch of new technologies like increased memory, Intel Software Guard Extensions (SGX), and virtual persistent memory (vPMEM), which are not supported on generation 1 VMs. But more on that later.

What are Hyper-V Virtual Machine Generations

Windows Server 2012 R2 Hyper-V introduced the concept of virtual machine generations. Not to be confused with Hyper-V configuration versions. The generation of a virtual machine defines the virtual hardware of a virtual machine and adds some additional and modern functionality. In Hyper-V, there are two virtual machine generations, generation 1 and generation 2. Generation 2 virtual machines support Unified Extensible Firmware Interface (UEFI) firmware instead of BIOS-based firmware. The Hyper-V team also removed a lot of the legacy devices and replaced them with a simplified virtual machine model.

On Windows Server Hyper-V Generation 2 VMs support features and improvements like

  • PXE boot by using a standard network adapter
  • Boot from a SCSI virtual hard disk
  • Boot from a SCSI virtual DVD
  • Secure Boot (enabled by default)
  • UEFI firmware support
  • OS disk > 2 TB
  • improved boot and installation times

However, an important note here, not all of these features are currently available on Azure Generation 2 virtual machines, and not all operating systems are supported in Generation 2 VMs. For example, in Windows7, Windows Server 2008 and Windows Server 2008 R2 and 32-bit Windows systems are not supported. You can find more information about Hyper-V Generation 2 VMs here.

Azure Generation 2 Virtual Machines Overview

Azure Generation 2 Virtual Machines are currently in public preview. To be honest, Generation 2 VMs in Azure aren’t that new, with the public preview of Azure Confidential Computing, we already used Generation 2 VMs. However, now we can start using it for other workloads as well. This means that you can now upload and use your local VHD (not VHDX) files based on Hyper-V Generation 2 virtual machines. Before you had to use Azure Site Recovery to replicate and convert your Hyper-V Generation 2 VMs to Azure Generation 1 VMs.

Azure Generation 1 vs. Generation 2 capabilities

Azure Generation 1 vs Generation 2 VM

Currently, Generation 2 VMs are in public preview, and that means next to not having a service level agreement (SLA), the features which are available can and are limited. If you look at features like ASR or Azure Backup, which are currently not supporting Generation 2 VMs.

CapabilityGeneration 1Generation 2
OS disk > 2 TB
Custom Disk/Image/Swap OS
Virtual machine scale set support
ASR/Backup
Shared Image Gallery
Azure Disk Encryption

You can find more information about Azure Generation 2 virtual machines with an updated list of capabilities on Microsoft Docs.

Hyper-V vs. Azure Generation 2 VMs

There are also differences between Hyper-V Generation 2 VMs and Azure Generation 2 VMs. Not all of the features provided in Hyper-V are currently present in the public preview version on Azure.

FeatureOn-prem Hyper-VAzure
Secure Boot
Shielded VM
vTPM
Virtualization-Based Security (VBS)
VHDX format

Again, you can find an up-to-date list on Microsoft Docs.

Getting started

You can get started using the Generation 2 VMs on the following VM Sizes on Azure Premium Storage and Ultra SSD:

Windows Server Azure Generation 2 Virtual Machine

In public preview, you can now also use the following Azure Marketplace images from the “windowsserver-gen2preview” offer.

  • Windows Server 2019 Datacenter (2019-datacenter-gen2)
  • Windows Server 2016 Datacenter (2016-datacenter-gen2)
  • Windows Server 2012 R2 Datacenter (2012-r2-datacenter-gen2)
  • Windows Server 2012 Datacenter (2012-datacenter-gen2)

Create a virtual machine

You can use the Azure Portal to create a new VM or the Azure CLI using the following commands:

 
az group create --name myGen2ResourceGroupVM --location eastus
az vm create \
--resource-group myGen2ResourceGroupVM \
--name myVM \
--image MicrosoftWindowsServer:windowsserver-gen2preview:2019-datacenter-gen2:latest \
--admin-username thomas \
--admin-password myPassword12

Conclusion

I hope this gives you an overview of the benefits and how you can run Generation 2 VMs on Azure. If you have any questions please let me know in the comments.