Hello again everyone! This article will serve as part 5 of our “Definitive Guide to Containers for MSPs” series. Once again, this series is focusing on the new containerization technologies entering the industry today and looking at them through the lens of an MSP.

Thus far we’ve done quite a bit of how-to, and we’re going to continue to work on the how-to question for the next few segments. The reason being, when we start talking about things like pricing, service delivery, and on-going support, you need to have a strong grasp of what’s involved in the platform, so you can make informed decisions at that point. With that in mind we’re going to look at docker itself for another segment or two, and then we’ll start getting into container orchestrators like Kubernetes.

Let’s see what we’ve talked about thus far.

The Definitive Guide to Containers for MSPs

Part 1 – What are Containers?

Part 2 – Platforms for Running Containerized Workloads

Part 3 – Introduction to Docker

Part 4 – 4 Pro Tips when Working with Docker

For this segment specifically, I wanted to cover how to run Linux containers on Windows Server 2019. I came up with this idea as I was prepping for our latest webinar that centered around demos with Windows Server 2019. While it’s easy enough to run containers on Windows 10Β as we did in Part 3, it’s more difficult to do it on a VM where there is no GUI, and you can’t simply install docker for Windows.

So, let’s take a look at how the installation process works, and then we’ll proceed with running a container on top of it. Once this is complete, you’ll have everything you need to run Linux and Windows containers on Windows Server (assuming you’ve read the previous segments. Let’s get Started.

How to Install Docker Enterprise Edition Preview on Windows Server 2019

In prepping for this article, I started with a freshly installed Windows Server 2019 box. I used the GA Evaluation media to install the OS, then I upgraded to the latest Nov. build using Windows Update. In our previous segments we installed the Community edition of Docker. For this particular feature, we need to install Docker Enterprise Edition and the preview release at that.

First off, if you’re using the same box as you did in previous segments you’ll want to remove the version of Docker we installed with the DockerMSFTProvider in PowerShell.

NOTE: If you’re starting with a fresh server you can skip this step.

To Remove the previous version of Docker run the below command in an elevated PowerShell window:

Uninstall-Package -Name docker -ProviderName DockerMSFTProvider

Then reboot the box.

Now that we have a clean slate we can install the needed version of Docker to run Linux Containers.Β You can walk through the how-to below, or scroll down to watch the video.

NOTE: We’re going to be installing a testing build of the docker engine. While it’s fine for testing and learning, I would highly suggest waiting until a stable version is released prior to using it in production.

NOTE: It is required to have the Hyper-V Role installed in order to install the Docker Enterprise Edition preview. If this is a testing VM, make sure you enable nested virtualization.

To install the current preview build of Docker Enterprise Edition we need to run the below:

Install-Module DockerProvider


Install-Package Docker -ProviderName DockerProvider -RequiredVersion preview

Reboot your machine once again.

See it in action!

How to Install Docker Enterprise Edition Preview on Windows Server 2019

How to Configure Docker Enterprise Edition to Run Linux Containers

Out of the box, this install of Docker will run Windows Containers. In order to switch back and forth between Windows and Linux containers you need to run the below commands:

To switch to Linux Containers

[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", "1", "Machine")
Restart-Service docker

To switch back to Windows Containers

[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", $null, "Machine")
Restart-Service docker

Simply switch to whichever mode meets your needs at the given time.

Running Linux Containers on Windows Server 2019

After installing the Docker Enterprise Edition Preview and configuring it to run Linux containers we can use some of the syntax that we covered in previous sections to pull and run a container

Assuming you’ve switch to Linux mode, the below should work. Let’s first pull the latest Debian Linux container image:

NOTE: You can walk through the how to below, or scroll down to watch the video

Docker pull Debian

Then let’s run it in interactive mode and run a text-based app really quick just to make sure it works.

Docker run -it --name Debian_test Debian

Once in the prompt running the below will show us which version of the linux kernel is in use

Uname -r

Finally let’s install elinks, a text based web browser, using Debian’s packaging utility Apt

Apt-get update

Apt-get install elinks

Then let’s open google in elinks:

Elinks https://www.google.com

Hopefully, it should be working!

See it in Action!

Running Linux Containers on Windows Server 2019


There you have it! You’ve successfully run a Linux container on top of Windows Server 2019. Pairing this with what we’ve done in the previous segments should have you prepared to run both Windows and Linux containers with docker. Knowing this, we’ll cover just a few more advanced docker items in the next post before getting into container orchestrators.

If you had troubles with this or have questions on use-case, or just have a general comment, be sure to let me know in the comments section below!

Until next time!

Get a 30-day trial of Altaro VM Backup for MSPs

Manage all your customer VM backups from a single cloud console, on a monthly subscription. Try Altaro VM Backup for MSPs for 30 days - no strings attached!

Share this post

Not a DOJO Member yet?

Join thousands of other IT pros and receive a weekly roundup email with the latest content & updates!

24 thoughts on "How to Run 🐧 Linux Containers on Windows Server 2019"

  • Frank says:

    Hi Andy,

    What is version of Docker installed when requesting the preview version?


    • Andy says:

      Hi Frank! It will be whatever the current version flagged as preview is in the docker repo. So the command listed here will grab the latest version

  • Thanks a lot for the how-to and I would like just to point out there might be a missing step for the fresh install: adding the LCOW image.

    In the LCOW github page (https://github.com/linuxkit/lcow), it’s referenced under the “Setup” section how to download the LCOW image and where to put it.

    Without this image, the Linux based images will throw an error (or at least that’s what I faced).

    Hope this helps and keep the excellent work!


    • Andy says:

      Very Strange…. I didn’t run into this particular issue. I suspect the image exists by default in the Enterprise Edition Preview of Docker, which is what I used for this howto, but I don’t know that for sure. I’ll research some more and I’ll be sure to post back on that either here, or in a future segment of the series. Thanks for the info!

      • Hung says:

        Hi Andy,

        it is great instructions. I followed them exactly and it is ok to pull the windows’ images. However, when I pull the linux’s images, it gave me and error

        This is the error:

        docker pull centos
        Using default tag: latest
        latest: Pulling from library/centos
        8ba884070f61: Pulling fs layer
        8ba884070f61: Verifying Checksum
        8ba884070f61: Download complete
        docker : failed to register layer: failed to start service utility VM (applydiff dbdb990abb6f3892f0e8df339aeaac7f9da8448f971af86ee1a5de7a7b781e65): container
        dbdb990abb6f3892f0e8df339aeaac7f9da8448f971af86ee1a5de7a7b781e65_svm encountered an error during CreateContainer: failure in a Windows system call: A connection could not be established with the container or virtual
        machine. (0xc0370108) extra info: {“SystemType”:”container”,”Name”:”dbdb990abb6f3892f0e8df339aeaac7f9da8448f971af86ee1a5de7a7b781e65_svm”,”Layers”:null,”HvPartition”:true,”HvRuntime”:{“ImagePath”:”C:\\Program Files\\Linux
        + CategoryInfo : NotSpecified: (failed to regis…leClosed”:true}:String) [], RemoteException
        + FullyQualifiedErrorId : NativeCommandError

        I did run the command to switch to linux container

        [Environment]::SetEnvironmentVariable(“LCOW_SUPPORTED”, “1”, “Machine”)

        Why? Please assist me in this

        • Andy says:

          Hi Hung!

          Can you verify you installed the experimental version of docker? Can you run a docker –version and let me know the build and version number?

  • imran says:

    i did exactly as you have done over here for running linux containers on windows server 2016, but after restarting docker service or restarting computer, changes are not getting reflected if use docker version, it still says experimental feature “false” which needs to be true in order to linux containers, following are actions and there errors (these actions and errors are coming even after following steps describe over here and i am using AWS cloud windows server 2016 with Full containers image)
    command: docker run –rm –platform linux busybox echo hello_world
    error: “–platform” is only supported on a Docker daemon with experimental
    features enabled

    command: docker pull ubuntu
    error: Using default tag: latest
    latest: Pulling from library/ubuntu
    no matching manifest for unknown in the manifest list entries
    command: docker pull fxlabs/bot:latest
    error: latest: Pulling from fxlabs/bot
    image operating system “linux” cannot be used on this platform

    what needs to be done to make it run linux containers, basically make experimental feature “true” in aws cloud windows server 2016 docker (EE).
    Is there something needs to be done in security group on aws side or in windows server 2016 group policy, firewall

    • Andy says:

      Hi Imran!

      Sounds like you may not have installed Docker using the -RequiredVersion Parameter

      You’ll have to remove your existing version of Docker and reinstall the experimental version

      When you install docker make sure you use the below commands

      Install-Module DockerProvider

      Install-Package Docker -ProviderName DockerProvider -RequiredVersion preview

  • Callum says:

    Hi Andy

    Thanks for the great post!

    I’ve been following through this myself but I’m getting stuck when trying to push my Linux container to my Azure Container Repository.

    I get the following error when pushing – open \tmp\b18abd5adacb7943b685869de1480bde160857fc250f33cccb50ed958bfadcd6-mount\usr\share\dotnet\LICENSE.txt: The system cannot find the path specified.

    Have you been able to push containers to a repository?

    Any help would be greatly appreciated thanks!

    • Andy says:

      Hi Callum!

      I haven’t tried pushing containers to an Azure Repo myself yet, but I’ll be covering this in a future segment, so stay tuned!

Leave a comment

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

Related posts