Tag: Docker

Last updated by at .

Hyper-V Enhanced Session Mode

10 hidden Hyper-V features you should know about!

Microsoft added some amazing new features and improvements to Hyper-V over the past few years. A lot of them you can use in Windows Server 2016 Hyper-V today, but there are also a lot of features hidden in the user interface and they are also included in Windows 10 Pro or Enterprise. I think this list should you a good idea about some of them.

Nested Virtualization

Hyper-V Nested Virtualization

Hyper-V Nested Virtualization allows you to run Hyper-V in a Hyper-V Virtual Machine. This is great for testing, demo and training scenarios and it work on Windows Server 2016 and Windows 10 Pro and Enterprise. Microsoft Azure will also offer some new Virtual Machine which will offer the Nested Virtualization feature in the Azure public cloud. Nested Virtualization is not just great if you want to run virtual machines inside a virtual machine, it is also great (and I think this will be the largest use case in the future) you can also run Hyper-V Container inside a Hyper-V or Azure Virtual Machine. Hyper-V Containers are a feature will brings the isolation of a Virtual Machine to a fast, light and small footprint container. To enable Nested Virtualization you have the following requirements:

  • At least 4 GB RAM available for the virtualized Hyper-V host.
  • To run at least Windows Server 2016 or Windows 10 build 10565 (and higher) on both the physical Hyper-V host and the virtualized host. Running the same build in both the physical and virtualized environments generally improves performance.
  • A processor with Intel VT-x (nested virtualization is available only for Intel processors at this time).
  • Other Hypervisors will not work

Configure the Virtual Machine for Nested Virtualization follow the following steps:

  • disable Dynamic Memory on Virtual Machine
  • enable Virtualization Extensions on the vCPU
  • enable MAC Address Spoofing
  • set Memory of the Virtual Machine to a minimum of 4GB RAM

To enable the Virtualization Extensions on the vCPU you can run the following PowerShell command

PowerShell Direct

PowerShell Direct Enter-PSSession

Hyper-V PowerShell Direct is also one of the great new features in Windows 10 and Windows Server 2016 Hyper-V. PowerShell Direct allows you to connect to a Virtual Machine using PowerShell without connecting over the network. Instead of the network, PowerShell Direct uses the Hyper-V VMBus to connect from the Hyper-V host to the virtual machine. This is handy if you are doing some automation or you don’t have network access to the virtual machine. In terms of security, you will still need to provide credentials to access the virtual machine.

To use PowerShell Direct you have the following requirements:

  • The virtual machine must be running locally on the Hyper-V host and must be started.
  • You must be logged into the host computer as a Hyper-V administrator.
  • You must supply valid user credentials for the virtual machine.
  • The host operating system must run Windows 10, Windows Server 2016, or a higher version.
  • The virtual machine must run Windows 10, Windows Server 2016, or a higher version.

To use PowerShell Direct just use the Enter-PSSession or Invoke-Command cmdlets with the -VMName, -VMId or VM parameter.

Hyper-V Virtual Switch using NAT

Hyper-V Virtual Switch NAT Configuration

If you are running Hyper-V on your workstation, laptop you know that networking could have been kind of a problem. With the Hyper-V Virtual Switch using NAT, you can now create an internal network for your virtual machines and still allow them to for example have internet access, like you would run your virtual machines behind a router. To use this feature you have the following requirements:

  • Windows 10 and Windows Server 2016 build 14295 or later
  • Enabled Hyper-V role

To enable you can first create an internal switch using PowerShell, the the IP Address on the Virtual NIC on the Management OS and then set the NAT configuration:

To create NAT forwarding rules you can for example use the following command:

Virtual Battery for Virtual Machines

Hyper-V VM battery

With the Windows 10 Insider Build XXXX and later with the release of the Windows 10 Fall Creators Update, Microsoft enabled a Virtual Battery feature for Hyper-V Virtual Machines. This will allow Hyper-V VMs to see the battery status of the host. This is great when you are running Hyper-V on a notebook or if you have a SUV battery on your server

Hyper-V VMConnect – Enhanced Session Mode

Hyper-V Enhanced Session Mode

Interacting with Virtual Machines can be difficult and time consuming using the default VM console, since you can not copy paste or connect devices. VMConnect lets you use a computer’s local resources in a virtual machine, like a removable USB flash drive or a printer and in addition to this, Enhanced session mode also lets you resize the VMConnect window and use copy paste. This makes it almost as if you would use the Remote Desktop Client to connect to the Virtual Machine, without a network connection, instead you will make use of the VMBus.

The Enhanced Session Mode feature was introduced with Windows Server 2012 R2 and Windows 8.1. Enhanced session mode basically provides your Virtual Machine Connection with RDP (Remote Desktop Protocol) capabilities over the Hyper-V VMBus, including the following:

  • Display Configuration
  • Audio redirection
  • Printer redirection
  • Full clipboard support (improved over limited prior-generation clipboard support)
  • Smart Card support
  • USB Device redirection
  • Drive redirection
  • Redirection for supported Plug and Play devices

Requirements for the Enhanced Session Mode are:

  • The Hyper-V host must have Enhanced session mode policy and Enhanced session mode settings turned on
  • The computer on which you use VMConnect must run Windows 10, Windows 8.1, Windows Server 2016, or Windows Server 2012 R2 or higher
  • The virtual machine must have Remote Desktop Services enabled, and run Windows 8.1 (or higher) and Windows Server 2012 R2 (or higher) as the guest operating system.

You can simply use it, by pressing the enhanced session button (if you have all the requirementsOn the Windows 10 Client this is enabled by default on the “host”. On Windows Server you have to enable it first in the Hyper-V Manager under Hyper-V Settings

Hyper-V Manager Zoom Level

Hyper-V VMConnect Zoom Level

In the Windows 10 Creators Update, Microsoft introduced a new feature to the VMConnect Console. This feature allows you to control the zoom level of the Virtual Machine console, this is especially handy if you have a high DPI screen.

Virtual TPM Chip

Hyper-V Virtual TPM

If you are running Windows 10 or Windows Server 2016 or higher you can make use of a feature called Shielded Virtual Machines. This allows you to protect your virtual machines form being accessed from the outside. With this feature Microsoft added different levels of security enhancements. One of them is the possibility to add a Virtual TPM chip to the virtual machine. With that enabled you can use BitLocker or another encryption technology to encrypt your virtual machine disks from inside the VM.

Enable Hyper-V vTPM PowerShell

You can enable the Virtual TPM chip using the Hyper-V Manager or PowerShell. The virtual machine needs to be shut down.

Just to make sure, if you really need full protection, have a look at Shielded Virtual Machines with the Host Guardian Service (HGS).

VM Resource Metering

Hyper-V VM Resource Metering

With Windows Server 2012 Hyper-V Microsoft introduced a new feature in Hyper-V called VM Resource Metering which allows you to measure the usage of a virtual machine. This allows you to track CPU, Memory, Disk and network usage. This is a great feature especially if you need to do charge back or maybe even for trouble shooting.

You can enable VM Resource Metering using PowerShell

To measure the virtual machine, you can used the following command

Export and Share Hyper-V Virtual Machines

Export and Share Hyper-V Virtual Machine

Another feature a lot of people do not know about is that you can export Hyper-V Virtual Machines to copy them to another computer or server. The great thing about this, this can even be done while the virtual machine is running and you can even export the state of the virtual machine with it. You can use the UI to do this, or you just run PowerShell using the Export-VM cmdlet.

In the Windows 10 Fall Creators Update Microsoft also added a button to shared the Virtual Machine. This does not only export the virtual machine but it also create a compressed VM Export File (.vmcz).

Hyper-V Containers

Hyper-V Windows Containers

In Windows 10 and Windows Server 2016 you can run Windows Containers using Docker. While on Windows Server you can choose between running a Windows Container or a Hyper-V Container, you will always run a Hyper-V Container on Windows 10. While Hyper-V Containers and Windows Containers are fully compatible with each other, what means you can start a Windows Container in a Hyper-V Container runtime and the other way around, the Hyper-V Container gives you an extra layer of isolation between your containers and your operating system. This makes running containers not just much more secure but since the Windows 10 Fall Creators Update and Windows Server RS3 (Redstone 3), it will also allow you to run Linux Containers on a Windows Container Host, which will make Windows the best platform to run Windows Containers and Linux Containers side by side.

I hope this short list was helpful and showed you some features you didn’t know were there in Hyper-V. Some of these features are still in preview and are might not available in production versions of Hyper-V. Leave your favorite secret Hyper-V features in the comments!



Azure Nested Virtualization

Hyper-V Container and Nested Virtualization in Microsoft Azure Virtual Machines

Last week Microsoft announced some pretty cool new Azure Stuff, like the Azure Cloud Shell, Azure PowerShell 4.0, Azure Cosmos DB and much more.

In the session about Azure Compute, Microsoft introduced a bunch of new features, like new VM sizes, new experiences and new integration technology as well as updates to Azure Service Fabric, Azure Container Service and Azure Functions. One which really got my interest was the announcement about the new Virtual Machines sizes for Dv3 and Ev3, which will enable customers to use Virtualization inside their Windows Server Virtual Machines on Azure, enabled by Nested Virtualization from Windows Server 2016 Hyper-V. With that Dv3 and Ev3 Azure Virtual Machines are Nested Virtualization enabled.

Update: The new Azure Dv3 and Ev3 VM sizes are now available, and you can now use Nested Virtualization in Azure.

Azure Nested Virtualization and Hyper-V Containers

You can now run Hyper-V in Azure Virtual Machines and even more important you can now run Hyper-V Container inside Azure Virtual Machines. With the announcements for Windows Server 2016 supporting Hyper-V Containers running Linux and Windows Server this is great news. You will be able to create Container Hosts in Azure running Windows Server and create Windows and Linux Containers on the same Container Host.

Azure VM Sizes

By the way, if you want to run Hyper-V Container in Azure today, and you don’t want to wait until the Dv3 and Ev3 series are available you can run them inside Azure Service Fabric. So yes, Microsoft now allows you to run Hyper-V Containers in Azure Service Fabric.

Azure Nested Virtualization Demo

As you could see in the demo, they are offering quite large Virtual Machines with a lot of RAM, running on Intels Xeon E7 CPUs.



Azure Cloud Shell

Microsoft Azure Cloud Shell

Today at the Microsoft Build Conference, Microsoft announced the Azure Cloud Shell. The Azure Cloud Shell is a browser-based shell experience to manage and develop Azure resources.

Azure Cloud Shell offers a browser-accessible, pre-configured shell experience for managing Azure resources without the overhead of installing, versioning, and maintaining a machine yourself. Today it gives you a variety of different tools directly from your web browser in the Azure Portal.

Linux shell interpreter

  • Bash
  • sh

Azure tools

  • Azure CLI 2.0 and 1.0

Text editors

  • vim
  • nano
  • emacs

Source control

  • git

Build tools

  • make
  • maven
  • npm
  • pip

Containers

  • Docker
  • Kubectl
  • DC/OS CLI

Databases

  • MySQL client
  • PostgreSql client
  • sqlcmd Utility

Other

  • iPython Client

It also looks like PowerShell will be available later, hopefully it will arrive soon. Microsoft also announced Azure PowerShell 3.0.



Speaking at Microsoft TechDays 2017 Switzerland

I hope everyone had or is still having a great holiday. Today I am proud to announce that I have the opportunity to speak again at the Microsoft TechDays in Switzerland. From 30th – 31st January the Microsoft TechDays will take place in Baden. The conference will cover the latest trends and news from the industry and is a great opportunity for IT professionals and software developers to learn all about the newest developments in Microsoft technologies, products and services.

Microsoft TechDays Featured Speaker

My session will be placed under the IT Pro track and I will cover some of the new stuff coming with Windows Server 2016 and Hyper-V 2016, including:

  • Hyper-V 2016 features
  • Nano Server
  • Storage Spaces Direct
  • Storage Replica
  • Windows Server Containers
  • And more!

So if you want to learn the latest and greatest about Microsoft technology, make sure you attend this event.

TechDays 2017

From 30th – 31st January the Microsoft TechDays will take place in Baden. The conference will cover the latest trends and news from the industry and is a great opportunity for IT professionals and software developers to learn all about the newest developments in Microsoft technologies, products and services.

 

 



ExpertsLive

Speaking at ExpertsLive 2016 in Amsterdam

Last year I had the chance to speak for the first time at ExpertsLive.nl in Amsterdam. Today I am proud that I will be speaking at ExpertsLive.nl again this year. Next week I will be presenting in two session about Windows Server 2016 together with Michael Rüefli.

Also check out the Savison blog post about ExpertsLive from Isidora Katanić and me: Empower your knowledge at Experts Live 2016!

Presenting ExpertsLive

Greatest Server OS Hits; best of Server 2016

In this presentation we will guide you through the highly anticipated innovations including: •Hyper-V 2016 features •Nano Server •Storage Spaces Direct •Storage Replica •Windows Server Containers •And more

The future of your datacenter: Nano Server and Container

Nano Server is the future of Windows Server. With Nano Server Microsoft created the foundation for Windows Server for the next 20 year. In this session you will get an overview about Nano Server and see some great live demos how you can deploy, manage and operate Nano Server as well as creating applications for it. Get a better understanding of Nano Server and see how you deploy, manage and operate it.



Add Updates to Nano Server Image

Getting started with Windows Server 2016 and System Center 2016

Microsoft announced Windows Server 2016 release at Microsoft Ignite in Atlanta 2 weeks ago. Microsoft released the Evaluation version of Windows Server 2016 which allow you to start play with Windows Server 2016. And today Microsoft announced the GA (General Availability) of Windows Server 2016 and System Center 2016.

Windows Server brings some great new features and possibilities such as Hyper-V, Storage Spaces Direct, Nano Server, Storage Replica and much more.

Here are some information about deployment, upgrading and certification:

Windows Server

If you want to go to production make sure you also install the latest Cumulative Update for Windows Server 2016:

If you want to try Windows Server 2016 you can also do this on Microsoft Azure.

System Center:

 

 

 



Containers PowerShell

First steps with Windows Containers

At Microsoft Ignite 2015 back in Chicago Microsoft announced Windows Containers. With the release of the Technical Preview 3 (TP3) for Windows Server 2016 we are finally able to start using Windows Containers, and we can finally test them. But first let use check a little what containers are.

The concept of containers is nothing new, in the Linux world containers are a well known concept. If you have a look at the Wikipedia description for Linux Containers, Wikipedia describes it as follows: LXC (Linux Containers) is an operating-system-level virtualization environment for running multiple isolated Linux systems (containers) on a single Linux control host. Containers provide operating system-level virtualization through a virtual environment that has its own process and network space, instead of creating a full-fledged virtual machine. With Windows Server 2016 more or less the same concept comes the Windows world. This makes containers much more light-weight, faster and less resource consuming than Virtual Machines, which makes it perfect for some scenarios, especially dev-test scenarios or for worker roles.

Container Ecosystem

If we have a look at the concept of containers you have several things in the container ecosystem:

Container Ecosystem

First you have the Container Run-Time which builds the boundaries between the different containers and the operating system. To make deployment easier, faster and more efficient you build Container Images which Include the application frameworks as well as the applications on top of the OS used for the container. To use, store and share Container Images you can use an Image Repository.

The question most people will ask is how are containers different than Virtual Machines etc.

Physical Server

Physical Host

At the beginning what we did is, we installed an operating system on physical hardware and in that operating system we installed applications directly.

Virtual Machines

Virtual Machines

With virtual machines we created simulated some virtual hardware on top of the operating system of the physical server. We installed an operating system inside the virtual machine on top of the virtual hardware and installed application inside the VM. In this case, each virtual machine has its own operating system.

Containers

Containers

With container we use an operating-system-level virtualization environment which create boundaries between different applications. This is so efficient you can run multiple applications side by side without effecting each other. Since this is operating-system-level virtualization you cannot only directly on the operating system on the physical hardware, you can also use operating-system-level virtualization inside a virtual machine. This is by the way the way I see most of the deployments of containers.

Windows Containers vs. Hyper-V Containers

Hyper-V Containers

Microsoft will provide two different types of Container Run-Times. One is Windows Containers and the other one will be Hyper-V Containers (not Hyper-V Virtual Machines). In some cases it is maybe not compliant that some applications share the same operating system. In this case Hyper-V Containers will add an extra boundaries of security. Hyper-V Containers are basically Windows Containers running in a Hyper-V Partition, so with that you gain all the stuff you get with Windows Containers but with another layer of isolation.The great thing here, is that both Container Run-Times use the exam same image format. This means if an image is created in a Windows Container Run-Time it also works as a Hyper-V Container and vice versa.

Hyper-V Containers Nested Virtualization

The other great side effect of Hyper-V Containers is, that in order to run Hyper-V Containers inside a Virtual Machine we need nested Virtualization, which will be included in Windows Server 2016 Hyper-V. Btw. Hyper-V Containers are not part of the Technical Preview 3.

(Pictures from the Microsoft Ignite 2015 presentation of Taylor Brown and Arno Mihm (Program Managers for Containers)

Deploy Windows Containers

With the release of the Technical Preview 3 of Windows Server 2016, Microsoft made Windows Containers available to the public. To get started you can download a install Windows Server 2016 inside a Virtual Machine or even bare-metal. If the virtual machine has internet connection you can use the following command to download the configuration script, which will prepare your container host.

Install Windows Container Host

After that you can run the C:\ContainerSetup.ps1 script, which will prepare your container host. This can take some time depending on your internet connection and hardware.

The VM will restart several times and if it is finished you can start using Windows Containers inside this Virtual Machine.

Managing Windows Containers

Containers PowerShell Module

After you have logged in to the Virtual Machine you can start managing Containers using PowerShell:

Containers PowerShell

Get Container Images, by default you will get a WindowsServerCore Image. You can also create your own images, based on this image.

Create a new Container

Start the container

Connect to the Container using Enter-PSSession

Of course you an also use the docker command to make your containers.

Windows Containers Docker

Deploy a Container Host in Microsoft Azure

If you don’t want to go trough all the installation process you can also use a Template in Microsoft Azure to deploy a new Container Host Virtual Machine.

Microsoft Azure Windows Server Container Preview

If you need some more information on Windows Containers check out the Microsoft Resources on MSDN about Windows Server Containers.