Note: LCOW support is currently experimental and under active development.

https://github.com/linuxkit/lcow

Before anything else, it is not yet ready for prime time or work out of the box…

You can check the progress status at https://github.com/moby/moby/issues/33850

Now that it is out of the way, let’s continue:

Requirements

  • Windows Server 1709 – Build 16299+
  • Hyper-V support, if running on Virtual Machine “Nested Virtualization” must be supported and enabled.

On azure, this means that you MUST use a Dv3 or Ev3 instance (this may be the most important detail you will find here 🙂 )

HowTo

Create Virtual Machine

In the case of Azure, make sure to select an instance size of the latest version (e.g. D2sV3) and Windows Server 2019.

Install Docker EE

Connect to the virtual machine using RDP and on the “DOS prompt” start powershell:

C:\Users\Felipe>powershell
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\Users\Felipe>

Install Docker EE using DockerMsftProvider:

Install-Module "DockerMsftProvider" -Force
Update-Module "DockerMsftProvider"
Install-Package Docker -ProviderName "DockerMsftProvider" -Update -Force

You may be prompted to install the NuGet Provider:

NuGet provider is required to continue
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet
provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
'C:\Users\Felipe\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by
running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install
and import the NuGet provider now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"):

Enabled Windows “Containers” Feature

PS C:\Users\Felipe> Install-WindowsFeature Containers
Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
True Yes NoChangeNeeded {}

Most likely you will get the result above indicating that you need to Restart (e.g. Restart = yes). In this case, restart the virtual machine:

Restart-Computer

Reconnect to the Virtual machine using RDP and switch to powershell.

At this point, you should be able to start the docker daemon and even run a windows container on it.

Enable Experimental features

Set-Content -Value "`{`"experimental`":true`}" -Path C:\ProgramData\docker\config\daemon.json

Start the docker service to check:

PS C:\ProgramData\docker\config> restart-service docker
PS C:\ProgramData\docker\config> docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 18.09.2
Storage Driver: windowsfilter (windows) lcow (linux)
Windows:
LCOW:
Logging Driver: json-file
Plugins:
Volume: local
Network: ics l2bridge l2tunnel nat null overlay transparent
Log: awslogs etwlogs fluentd gelf json-file local logentries splunk syslog
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 17763 (17763.1.amd64fre.rs5_release.180914-1434)
Operating System: Windows Server 2019 Datacenter Version 1809 (OS Build 17763.253)
OSType: windows
Architecture: x86_64
CPUs: 2
Total Memory: 8GiB
Name: lcow
ID: ....
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

LCOW

Create the directory C:\Program Files\Linux Containers:

PS C:\> cd 'C:\Program Files\'
PS C:\Program Files> mkdir "Linux Containers"

Download the latest release from https://github.com/linuxkit/lcow/releases

PS C:\Program Files> cd '.\Linux Containers\'
PS C:\Program Files\Linux Containers> curl -OutFile release.zip https://github.com/linuxkit/lcow/releases/download/v4.14.35-v0.3.9/release.zip

Expand archive:

PS C:\Program Files\Linux Containers> Expand-Archive -DestinationPath . .\release.zip

Delete the release.zip file after that:

PS C:\Program Files\Linux Containers> rm release.zip

Make sure Hyper-V feature is installed

Install-WindowsFeature Hyper-V –IncludeManagementTools –Restart

You may get disconnected from the virtual machine if a restart is needed. Wait a few seconds and reconnect.

Fun time:

PS C:\Users\Felipe> docker run -it --platform=linux busybox echo "LCOW on a Windows Server!" 
LCOW on a Windows Server!

Troubleshooting

Missing Hyper-V

PS C:\Users\Felipe> docker run --platform=linux busybox
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
697743189b6d: Pull complete
Digest: sha256:061ca9704a714ee3e8b80523ec720c64f6209ad3f97c0ff7cb9ec7d19f15149f
Status: Downloaded newer image for busybox:latest
C:\Program Files\Docker\docker.exe: Error response from daemon: failed to start service utility VM (createreadwrite): CreateComputeSystem 40f05208018c0913e8f8a8f2e770877b96ce64276980a3e1d432849c0d2d8d26_svm: The virtual machine could not be started because a required feature is not installed.

Use a different virtual machine with hardware support for Hyper-V Nested virtualization. In the Azure case, make sure to use a Dv3 or Ev3 instance.

PS C:\Program Files\Linux Containers> docker run --platform=linux busybox
C:\Program Files\Docker\docker.exe: Error response from daemon: failed to start service utility VM (createreadwrite): CreateComputeSystem 7e4b0e4ceb834d23bb91293f9c089d1119a6d0c3280306e1586032d1ed10278d_svm: The request is not supported.
(extra info: {"SystemType":"container","Name":"7e4b0e4ceb834d23bb91293f9c089d1119a6d0c3280306e1586032d1ed10278d_svm","Layers":null,"HvPartition":true,"HvRuntime":{"ImagePath":"C:\Program Files\Linux Containers","LinuxInitrdFile":"initrd.img","LinuxKernelFile":"kernel"},"ContainerType":"linux","TerminateOnLastHandleClosed":true}).
See 'C:\Program Files\Docker\docker.exe run --help'.

Missing Hyper-V. Install Hyper-V Windows feature (instructions above).

OS Build not supported

PS C:\Users\Felipe> docker run --platform=linux busybox
Unable to find image 'busybox:latest' locally
C:\Program Files\Docker\docker.exe: Error response from daemon: unsupported os linux.
See 'C:\Program Files\Docker\docker.exe run --help'.

Most likely the Windows Server version doesn’t support LCOW. Check it by running:

PS C:\Users\Felipe> docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 18.09.2
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: ics l2bridge l2tunnel nat null overlay transparent
Log: awslogs etwlogs fluentd gelf json-file local logentries splunk syslog
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 14393 (14393.2724.amd64fre.rs1_release.181231-1751)
Operating System: Windows Server 2016 Datacenter Version 1607 (OS Build 14393.2724)

OSType: windows
Architecture: x86_64
CPUs: 2
Total Memory: 7GiB

The first build to include support was 16299.

Containers Feature not installed

PS C:\Users\Felipe> dockerd
Error starting daemon: failed to load vmcompute.dll, ensure that the Containers feature is installed
PS C:\Users\Felipe>

You need to install docker and the Containers Windows Feature (see previous instructions on how).

Missing platform parameter

PS C:\Users\Felipe> docker run busybox
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
C:\Program Files\Docker\docker.exe: no matching manifest for unknown in the manifest list entries.
See 'C:\Program Files\Docker\docker.exe run --help'.

Assuming that you have followed all the instructions and everything else is OK, this should simply indicate that you are missing the –platform=linux parameter.

Try again adding –platform=linux after the run:

PS C:\Users\Felipe> docker run --platform=linux busybox

Experimental Features disabled

PS C:\Users\Felipe> docker run --platform=linux busybox
"--platform" is only supported on a Docker daemon with experimental features enabled

If after including the platform argument you get the result above you haven’t enabled the docker experimental features.

Missing LCOW (linuxkit)

PS C:\ProgramData\docker\config> docker run --platform=linux busybox
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
697743189b6d: Pull complete
Digest: sha256:061ca9704a714ee3e8b80523ec720c64f6209ad3f97c0ff7cb9ec7d19f15149f
Status: Downloaded newer image for busybox:latest
C:\Program Files\Docker\docker.exe: Error response from daemon: failed to start service utility VM (createreadwrite): kernel 'C:\Program Files\Linux Containers\kernel' not found.
See 'C:\Program Files\Docker\docker.exe run --help'.

Follow instructions above to download the linuxKit.

References


7 Comments

Leave a Reply

Avatar placeholder