Category: Hyper-V

How to Manage Hyper-V VM Checkpoints with PowerShell

How to Manage Hyper-V VM Checkpoints with PowerShell

In this blog post we are going to have a look at how you can create, manage, apply, and remove VM Checkpoints in Hyper-V using PowerShell. Hyper-V virtual machine (VM) checkpoints are one of the great benefits of virtualization. Before Windows Server 2012 R2, they were known as virtual machine snapshots. VM Checkpoints in Hyper-V allow you to save the system state of a VM to a specific time and then revert back to that state if you need to. This is great if you are testing software and configuration changes, or if you have a demo environment, which you want to reset.

Hyper-V VM Checkpoint Types

Before we got on how you can manage Hyper-V VM Checkpoints with PowerShell, let me first explain the two different types. Since Windows Server 2016 and Windows 10, Hyper-V includes two types of checkpoints, Standard Checkpoints, and Production Checkpoints.

  • Standard Checkpoints: takes a snapshot of the virtual machine and virtual machine memory state at the time the checkpoint is initiated. A snapshot is not a full backup and can cause data consistency issues with systems that replicate data between different nodes such as Active Directory. Hyper-V only offered standard checkpoints (formerly called snapshots) prior to Windows 10.
  • Production Checkpoints: uses Volume Shadow Copy Service or File System Freeze on a Linux virtual machine to create a data-consistent backup of the virtual machine. No snapshot of the virtual machine memory state is taken.

You can set up these settings in Hyper-V Manager or in PowerShell.

Hyper-V VM Checkpoint Types

Hyper-V VM Checkpoint Types

If you are using PowerShell to configure Checkpoints for virtual machines these commands may help you.

Configure and set VM for Standard Checkpoints

Set-VM -Name "Windows10" -CheckpointType Standard

Set VM to Production Checkpoints, if the production checkpoint fails a Standard Checkpoint is created

 Set-VM -Name "Windows10" -CheckpointType Production

Set VM to only use Production Checkpoints

 Set-VM -Name "Windows10" -CheckpointType ProductionOnly

Disable VM Checkpoints for the Hyper-V virtual machine

 Set-VM -Name "Windows10" -CheckpointType Disabled

Managing Hyper-V VM Checkpoints using PowerShell

Create VM Checkpoints

You can create a new VM Checkpoint with PowerShell, you can round the following command:

Checkpoint-VM -Name "Windows10"

You can find more on the cmdlet on Microsoft Docs.

You can list the VM Checkpoints of a Hyper-V VM:

Get-VMCheckpoint -VMName "Windows10"
How to Manage Hyper-V VM Checkpoints with PowerShell

How to Manage Hyper-V VM Checkpoints with PowerShell

Applying Hyper-V VM checkpoints using PowerShell

If you want to revert your virtual machine state to a previous point-in-time, you can apply an existing checkpoint, using the following PowerShell command.

Restore-VMCheckpoint -Name "checkpoint name" -VMName "Windows10" -Confirm:$false

You can find more information about the cmdlet here.

Renaming checkpoints

To rename a checkpoint you can use the following command

Rename-VMCheckpoint -VMName "Windows10" -Name "Checkpointname" -NewName "MyNewCheckpointName"

Deleting checkpoints

You can also delete or remove a Hyper-V VM checkpoint with the following PowerShell command. This will merge the .avhdx files in the background.

Remove-VMCheckpoint -VMName "Windows10" -Name "Checkpointname"

Conclusion

I hope this blog post gives you a great overview on how you can manage, apply, restore, and remove Hyper-V VM Checkpoints using PowerShell. You can learn more about Hyper-V virtual machine checkpoints on Microsoft Docs. If you have any questions, feel free to leave a comment.



Intel NUC Windows Server LAB

Install Intel NUC Windows Server 2019 Network Adapter Driver

As you know, I am using an Intel NUC as my Windows Server lab machine, where I run Windows Server 2019 and Hyper-V on. Many people asked me about how you can install the Intel NUC Windows Server 2019 Network Adapter driver because there are no Windows Server 2019 drivers for it. My blog reader, Michael Williams, shared how you can install the Windows Server 2019 Network adapter drivers on the Intel NUC 8th generation.

Here are the simple steps you can follow to install the Intel NUC Windows Server 2019 Network Adapter Driver:

  1. Download the latest PROWinx64.exe for Windows Server 2019 from Intel including drivers for the Intel® Ethernet Connection I219-V
  2. To manually install the network drivers, extract PROWinx64.exe to a temporary folder – in this example to the C:\Drivers\Intel\ folder. Extracting the .exe file manually requires an extraction utility like WinRAR or others. You can also run the .exe and it will self-extract files to the %userprofile%\AppData\Local\Temp\RarSFX0 directory. This directory is temporary and will be deleted when the .exe terminates.
  3. The driver for the Intel I219-V network adapter can be found in the C:\Drivers\Intel\PRO1000\Winx64\NDIS68.
    Extracted Network Drivers for Windows Server 2019 - Intel NUC PROWinx64

    Extracted Network Drivers for Windows Server 2019 – Intel NUC PROWinx64

  4. Open Device Manager right click on Ethernet Controller and select Update Driver.
    Device Manager Update Driver Ethernet Controller - Intel NUC Windows Server 2019 Driver

    Device Manager Update Driver Ethernet Controller – Intel NUC Windows Server 2019 Driver

  5. Select “Browe on my computer for driver software”, and select “Let me pick from a list of available drivers on my computer”, now you can select Network Adapter.
    Update Driver

    Update Driver

  6. Click on “Have Disk…” enter the following path “C:\Drivers\Intel\PRO1000\Winx64\NDIS68.”

    Driver Location

    Driver Location

  7. Now select Intel Ethernet Connection I219-LM (The I219-V version is not shown)
    Select the Intel Ethernet Connection I219-LM

    Select the Intel Ethernet Connection I219-LM

  8. And you are done.

Huge thank you again to Michael Williams for sharing that with us. I hope this short blog post provides you a step by step guide on how you can install Windows Server 2019 Network adapter drivers on the Intel NUC. If you have any questions, feel free to leave a comment.



How to Install a Windows Server Container Host

How to Install a Windows Server Container Host

In this blog post, I want to quickly guide you through how you can install a Windows Server Container Host running Docker. This guide will help you set up, install, and run Windows Containers on Windows Server. In my example, I will install a container host on a Windows Server, version 2004, which is a Semi-Annual Channel (SAC) release. Windows Server SAC releases are released twice a year and are optimized for containers. In the Windows Server, version 2004 release, the team continued improving fundamentals for the core container platform such as performance and reliability.

If you want to learn more about the differences of Windows Server Semi-Annual Channel (SAC) vs. Long-Term Servicing Channel (LTSC), check out my blog post.

Requirements

  • A virtual or physical server running Windows Server 2016 or higher (Also including Semi-Annual Channel (SAC) releases. In my blog post, I will use the latest available releases and run the latest Windows Server SAC release, which offers the latest enhancements on the container host.
  • You can also use the Windows Server 2019 LTSC version

Set up and install the Windows Server Container Host

Since I am using the latest SAC release of Windows Server, the server is available as Windows Server Core only. This means I am going to use a tool called “sconfig” to set up my server for the first time. Of course, you can also use existing methods like unattend.xml files or PowerShell scripts to set up your server.

Windows Server Core

Windows Server Core

With sconfig, you can run all the simple configuration tasks to configure your Windows Server.

Windows Server SCONFIG

Windows Server SCONFIG

After the Windows Server is configured and patched, we can now install Docker, which is required to work with Windows containers. Docker consists of the Docker Engine and the Docker client. You can simply install Docker on Windows Server using the following commands.

Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
Install-Package -Name docker -ProviderName DockerMsftProvider
Install Docker on Windows Server

Install Docker on Windows Server

After these commands, you will need to restart the server.

Restart-Computer -Force

If you want to learn more about installing Docker on Windows Server, check out Microsoft Docs.

Run Windows Container Docker Images on Windows Server

Run Windows Container Docker Images on Windows Server

Now you can start pulling your docker container images to your Windows Server. I will use the latest Windows Container images, which came with Windows Server, version 2004. You can read more about the improved container images here.

docker pull mcr.microsoft.com/windows/servercore:2004 
docker pull mcr.microsoft.com/windows/nanoserver:2004 
docker pull mcr.microsoft.com/windows:2004

You can now use the docker client to manage your containers on your Windows Server, or you can also use the new Windows Admin Center Container extension, which was released a couple of weeks ago.

Manage Windows Server Containers with Windows Admin Center

Manage Windows Server Containers with Windows Admin Center

And yes, if you have a standalone Windows Server Core, you can also directly install Windows Admin Center on your Windows Server Core.

Conclusion

I hope this blog post gives you a great overview of how to install and set up a Windows Server container host. If you have any questions, feel free to leave a comment.



Run Hyper-V on Windows 10 on ARM and the Surface Pro X

Run Hyper-V on Windows 10 on ARM and the Surface Pro X

Here is a quick blog post on how you can run Hyper-V virtual machines (VM) on Windows 10 on ARM and the Surface Pro X.

I am running the Surface Pro X as my daily driver for a couple of months. It is a fantastic device and combines a light designed and the Surface Pro form factor with a 13-inch screen. But the most significant difference to the other Surface devices like the Surface Pro 7, is that the Surface Pro X is running Windows 10 on ARM. It has a custom Microsoft SQ1 chip. This limits it to run native ARM64 or emulated 32-bit x86 applications, and it can’t run classic 64-bit x64 applications at the moment. Another limitation was that I wasn’t able to run Hyper-V virtual machines (VMs) on my Surface Pro X.

With the Windows 10 Insider Preview build 19559, you were able to install Hyper-V. However, you didn’t have a compatible image to run inside the virtual machine (VM). With the Windows 10 Insider Preview Build 19631, Microsoft is now also providing an ARM64 VHDX file, which you can download and run as a guest OS in Hyper-V.

How to enable Hyper-V on Windows 10 on ARM

You need a Windows 10 ARM-based PC with a Microsoft SQ1, Qualcomm Snapdragon 8cx, or Qualcomm Snapdragon 850 processor. To enable the Hyper-V feature on Windows 10 on ARM and the Surface Pro X, you will also need to have installed the Windows 10 Insider Preview build 19559 or higher and have Windows 10 Pro or Windows 10 Enterprise.

  1. Join the Windows Insider Program and update to the latest Windows 10 Insider Fast Ring build 19559 or newer
  2. Upgrade your Windows edition from Home to Windows 10 Pro or Windows 10 Enterprise
  3. Install the Hyper-V feature on Windows 10You can run the following PowerShell command to install the Hyper-V feature.
    Enable-WindowsOptionalFeature -Online -FeatureName:Microsoft-Hyper-V -All
  4. Download the Windows 10 on ARM VHDX file from here.
  5. After that, you can create a Hyper-V virtual machine (VM) with an existing VHDX file on your Surface Pro X.
  6. Visit Windows 10 on ARM developer center for more details and documentation.

Conclusion

I hope this gives an overview of how to run Hyper-V VMs on Windows 10 on ARM. This is still in preview, but if you are like me and want to give it a try, you can. Let me know if you have any questions.



HCSDiag.exe - Hyper-V Host Compute Service Diagnostics Tool

HCSDiag.exe – Hyper-V Host Compute Service Diagnostics Tool

As you know, Hyper-V is not just a server virtualization software anymore. Today, you can find Hyper-V technology across different operating systems, products, and services, like Windows Defender Application Guard, Windows Sandbox, Hyper-V Containers, or many more. Thanks to Ben Armstrong from the Hyper-V team, I found out that there is a tool in Windows to troubleshoot these Hyper-V containers called hcsdiag.exe or Hyper-V Host Compute Service Diagnostics Tool. The Hyper-V Host Compute Service Diagnostics Tool (HCSDiag.exe) is available in Windows 10 and Windows Server 2019 if you have the Hyper-V roles or virtualization features enabled, and can be helpful to troubleshoot Hyper-V containers, virtual machines (VMs), Windows Sandbox, Windows Defender Application Guard, Windows Subsystem for Linux 2 and more.

HCSDiag.exe - Hyper-V Host Compute Service Diagnostics Tool

HCSDiag.exe – Hyper-V Host Compute Service Diagnostics Tool

Let’s have a look at the HCSDiag.exe, which you can find in C:\Windows\System32. It provides you with a couple of different commands and options. However, keep in mind that not all features work with every type of container. Some features are limited to scenarios where the VM is being used under the same user context as the host, where it is all about protecting the host from the guest and not the guest from the host like in the server version of Hyper-V.

To install Hyper-V, check out the following posts:

HCSDiag.exe

hcsdiag <command> [options…]

  • list
    Lists running containers and VMs.
  • exec [-uvm] <id> <command line>
    Executes a process inside the container.
  • console [-uvm] <id> [command line]
    Launches an interactive console inside the container.
  • read [-uvm] <id> <container file> [host file]
    Reads a file from the container and outputs it to standard output or a file.
  • write [-uvm] <id> [host file] <container file>
    Writes from standard input or a host file to a file in the container.
  • kill <id>
    Terminates a running container.
  • share [-uvm] [-readonly] [-asuser] [-port <portnumber>] <id> <host folder> <container folder>
    Shares a host folder into the container.
  • vhd [-uvm] <id> <host vhdx file> <container folder>
    Shares a virtual hard disk file into the container.
  • crash <id>
    Forces a crash of the virtual machine hosting the container (only works for containers hosted in a virtual machine).

I will give you some examples of how you can use hcsdiag.exe to interact with some of the Hyper-V containers. Now again, this focuses mostly on technologies like Windows Sandbox, Docker Hyper-V Containers, WSL 2, and similar features.

You can find more documentation on Hyper-V on Windows Server or Hyper-V on Windows 10 on Microsoft Docs.

List all containers and Hyper-V VMs

With the hcsdiag list command, you can create a list of containers and Hyper-V virtual machines running on the host. Including Windows Sandbox, Windows Subsystem for Linux 2, and Application Guard.

hcsdiag.exe list

hcsdiag.exe list

Connect Console to Hyper-V containers and Windows Sandbox

You can also directly connect to the console of containers or the Windows Sandbox. Remember that it only works for Hyper-V containers where the guest is not protected from the host. Not for containers like Hyper-V VMs, where the guest is also protected from the host. If you need to remote into want console access or run commands against a Hyper-V VM from the host, check out PowerShell Direct for Windows VMs and hvc.exe for Linux VMs.

hcsdiag console connect

hcsdiag console connect

Here is an example where I am connected to a Windows Sandbox container using hcsdiag.exe.

hcsdiag Windows Sandbox

hcsdiag Windows Sandbox

But that also works with Dockers container (Hyper-V containers) running Windows and Linux.

hcsdiag Linux Container

hcsdiag Linux Container

HCSDiag console provides you with an interactive connection to interact with the container.

Additional HCSDiag.exe features and commands

The HCSDiag.exe also provides you with a couple of additional commands you can use. For example, the read command to read a file from the container and output it to the host or as a file to the host.

hcsdiag read

hcsdiag read

You can use the “share” command to share a host folder into the container or use “vhd” to mount a virtual disk file (VHD) file to a container. The hcsdiag kill command terminates a running container.

Conclusion

HCSDiag.exe – Hyper-V Host Compute Service Diagnostics Tool is excellent if you need to troubleshoot these Hyper-V containers, virtual machines (VMs), Windows Sandbox, Windows Defender Application Guard, Windows Subsystem for Linux 2 and more. If you have any questions, feel free to leave a comment.



Azure Unblogged - Azure Stack HCI and the Future

Azure Unblogged – Azure Stack HCI and the Future

You might have seen last week’s Azure Unblogged video with Holly Lehman where we talked about Microsoft feedback and customer engagement programs. This week, I had the honor to publish an Azure Unblogged video with Carmen Crincoli (Senior Program Manager) to talk about the Azure Stack HCI solution program, why it was created, the value it provides to customers, and some of the work we’re doing to engage with customers to improve future versions of the product.

You can watch the video on Microsoft Channel 9.

Azure Stack HCI is a hyper-converged Windows Server 2019 cluster that uses validated hardware to run virtualized workloads on-premises. And allows you to optionally connect to Azure Hybrid services for cloud-based backup, Site Recovery, and more. This allows you to take advantage of the Microsoft Hybrid Cloud services to make your on-premises environment even better.

If you want to learn more about Azure Stack HCI, check out the following links:

You can also watch other episodes of Azure Unblogged on Microsoft Channel 9 and check out my blog at ITOpsTalk.com.

Let me know if you enjoyed the Azure Unblogged – Azure Stack HCI and the Future video and if you have any questions, feel free to leave a comment. You can also subscribe to my YouTube channel here.



Veeam Vanguard 2020

Veeam Vanguard 2020

Last night I had some great news in my inbox. I got informed that my nomination for Veeam Vanguard 2020 was approved, and I just got awarded with my fourth Veeam Vanguard award. After being a Veeam Vanguard in 2015, 2016 and again in 2019, I am proud to be part of the Veeam Vanguard community in 2020 again.

The Veeam Vanguard Program is Veeam’s top-level influencer community. This group shares points of view, provides feedback and is committed to mutual success. Experts in the Vanguard program are a combination of many different disciplines, contribution types and advocacy mechanisms yet are each the best in space regarding technical thought leadership for the technical communities in which Veeam exist.

These individuals have been nominated as Veeam Vanguards. A Veeam Vanguard represents our brand to the highest level in many of the different technology communities in which we engage. These individuals are chosen for their acumen, engagement and style in their activities on and offline.

I am looking forward to being part of this community in this virtualization and cloud journey. I also want to thank Veeam, it is an honor to be part of the Veeam Vanguard community again.