How To Run Linux Containers On Windows Server 2016 Version 1709

With the release of Windows Server 2016 Version 1709, Today I’ll show you how to run Linux Containers on Windows Containers.

Running Linux Containers on Windows Containers was and is the number #1 requested feature since day one.

This feature is still not supported in production because it’s only available on the Docker Enterprise Preview Edition and will be available soon, so please don’t use it production.

Requirements
  • To get this to work, I’m using a Windows Container Host running on a Hyper-V machine.
  • Windows Server 2016 Version 1709 which is the only support OS for running Linux Containers
  • Docker Enterprise Edition 17.10 Preview 3
  • The Docker LinuxKit Feature – This is the feature that allows us to run Linux Containers and I’ll show you how to enable it
Install Docker Preview Edition

Below, I’ll use the two commands to Install Docker Enterprise Preview Edition

Install-Module DockerProvider
Install-Package Docker -ProviderName DockerProvider -RequiredVersion preview

Once completed, I need to restart the host using

Restart-Computer
Enable Docker Linux Containers (LinuxKit)

Below, I’ll enable the Docker Linux Containers LinuxKit feature using the cmdlets below:

Powershell
[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", "1", "Machine")

When done, I’ll restart the host using

Restart-Computer

To disable Docker Linux Containers, feature use:

[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", $null, "Machine")
Run Linux Containers on Windows Containers

And the last step in the process is to download a Linux Image using the command below.

In my case, I’m downloading Ubuntu

Docker pull ubuntu

And to run a Linux Container I run

Docker run -it ubuntu

Conclusion

Running Linux Containers is an amazing feature and I can’t wait to see going GA.

The Installation and configuration process is very smooth and it looks like Microsoft and Docker have been working very hard to make still a reality.

About Windows Server Version 1709

First announced five months ago, Windows Server 2016 version 1709 released as a Semi-Annual Channel with 18 months support.

Long and Semi-Annual Channel

As Announced a few months ago, Windows Server will be available in two release modules.

  1. Long-Term Servicing channel – This Is the current and most familiar module where a new operating system version is released every 2-3 years with 5 years support cycle.
  2. Semi-Annual Channel – This new module will offer two new releases every year with new features and roles, support will be available for 18 months.

The Semi-Annual Channel will only be available for Volume Licensing Customers with Software Assurance.

If you don’t have Software Assurance you can use Microsoft Azure where it’s available.

2 Replies to “How To Run Linux Containers On Windows Server 2016 Version 1709”

  1. After setting the global environment variable, do you really need to restart the computer, or can you just restart the docker service?
    I was hoping to be able to download and run NetCore images for both linux and sql in one session just by restarting docker in between.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.