Last week, we reported that Microsoft has been previewing Hyper-V containers, a new Windows 10 feature in the latest Insider build 14352. If you're not familiar with them, containers are an isolated place where an application can run without affecting the rest of your operating system.
Microsoft believes that they're the "next evolution in virtualization" and Windows 10 actually features two different types of containers, Windows Server containers and Hyper-V containers. The former isolates applications with process and namespace isolation technology, while the latter expands on the former and runs each container in an optimized virtual machine that also provides kernel isolation.
In a blog post on the Microsoft Developer Blog today, Microsoft Azure Technical Evangelist Julien Corioland explained how Windows Insiders can run any Hyper-V container on their Windows 10 PC. As this is an opt-in feature, you will first have to install the two types of containers to get started. To do that, go the Windows Control Panel and then click Programs, then click Turn Windows features on or off (if you're prompted for an administrator password or confirmation, type the password or provide confirmation). Once you're in, select Containers and Hyper-V in the list and click OK. Your computer will then restart to install the two components.
To be able to run Hyper-V containers, you will then have to install the ContainerImage package provider as well as the NanoServer base container image. First, open a PowerShell console in administrator mode and then change the execution policy to unrestricted using the following command:
You're now ready to install the ContainerImage package provider, wich will allow you to pull the base operating system image to run Hyper-V containers. Use the following command to do it:
Install-PackageProvider ContainerImage -Force
As we previously said, the next step is the installation of the NanoServer base container image, you can pull it with the following command (this step may take a while depending on your Internet connection):
Past this step, you will have to install Docker on your PC, which is a tool designed to manage containers. Corioland recommends running this PS script to to just install everything you need. Once it's done, you will be ready to use Hyper-V containers through the Docker commands, such as this one which can get you the list of available images on your computer:
Furthermore, you can use the following command to switch to a CMD window with administrator rights and create a new Hyper-V container:
docker run -it –isolation=hyperv nanoserver cmd
That's it, you're now ready to run any Hyper-V container on your Windows 10 PC. You can get more details about how to get started on the full blog post, and we also encourage you to check the official documentation on Hyper-V containers on the MSDN website.
If you're a developer, are you happy that Microsoft has brought native support for Hyper-V Containers into Windows 10? Let us know in the comments if you think this feature could ease your workflow.