12

Are there any update to date guides on how to use Linux containers in Docker EE for Windows Server 2016? All guides I have found (such as this one) are using the preview edition which from what I can tell is two major releases and 2 years out of date.

An additional problem I have is that I have to download and install docker manually as the server doesn't have a direct internet connection. Container images will be downloaded via Artifactory.

Andrew Sumner
  • 793
  • 2
  • 12
  • 29

2 Answers2

28

NOTE: WSL2

With the release of WSL 2, please be mindful that parts (if not all) off the below is very likely to be outdated.

Original post:


Update:

I previously forgot to mention that before you install, you need to have the Hyper-V Role installed. If you server is a VM, make sure that you have enabled nested virtualization.

Original answer

I don't know of any updated guides, but I have come up with the following from various sources (sources in the bottom), which is confirmed to work for running LCOW on Windows Server 2019:

Basically, you install a normal up-to-date Docker, enable experimental and fix the kernel path.

Assuming that Docker is not already installed, and never has been, running the following commands in an elevated PowerShell get you there:

PS C:\...> Install-Module DockerMsftProvider -Force

PS C:\...> Install-Package Docker -ProviderName DockerMsftProvider -Force

PS C:\...> Restart-Computer

PS C:\...> $configfile =@"
{
    "experimental":true
}
"@

PS C:\...> $configfile|Out-File -FilePath c:\ProgramData\docker\config\daemon.json -Encoding ascii -Force

PS C:\...> [Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", "1", "Machine")

PS C:\...> Restart-Service Docker

Then you need to go to https://github.com/linuxkit/lcow/releases and download the newest release and unpack it to C:\Program Files\Linux Containers.

If necessary, rename the file bootx64.efi to kernel.

Note

Please check out the last of the sources that mention some applications that will not work. I am still struggling with switching it to the old method of running the containers in a Moby VM for this specific reason.

Sources:

beruic
  • 5,517
  • 3
  • 35
  • 59
  • In the first two lines you are using two different providers, is that intentional? – Andrew Sumner Sep 02 '19 at 03:33
  • Any ideas why I'd still get this: E:\docker>docker pull selenoid/vnc:firefox_57.0 firefox_57.0: Pulling from selenoid/vnc image operating system "linux" cannot be used on this platform – Andrew Sumner Sep 02 '19 at 05:00
  • I'm also having to install docker manually (no internet access) and using artifactory as a mirror for the repo. Have installed this version of docker: https://download.docker.com/components/engine/windows-server/19.03/docker-19.03.1.zip – Andrew Sumner Sep 02 '19 at 22:21
  • Thank you for pointing it out about that provider. I guess I should have copied instead of typing it :) It is fixed now. – beruic Sep 03 '19 at 07:30
  • @AndrewSumner what OS are you on? Please take note that I only tested it on Windows Server 2019 – beruic Sep 03 '19 at 09:01
  • After all this, I still get "The virtual machine could not be started because a required feature is not installed." :( – Mike Caron Nov 21 '19 at 18:22
  • @MikeCaron Did you install the Hyper-V Role? – beruic Nov 25 '19 at 16:36
  • @beruic I did. :) – Mike Caron Dec 03 '19 at 12:56
  • 2
    The latest version of the releases.zip file as of right now contains "kernel": https://github.com/linuxkit/lcow/releases/tag/v4.14.35-v0.3.9. Btw, thanks for the post! – boggy Dec 19 '19 at 20:10
  • This was very useful. – Nore Gabbidon Dec 15 '20 at 10:40
0

I had the same issue and neither the preview version (provider: DockerProvider), nor the one from the above answer (provider: DockerMsftProvider) worked correctly.

In the end, cleaning up these versions of Docker and simply installing Docker for Windows worked perfectly.

Burhan
  • 668
  • 5
  • 27