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

james · April 29, 2019 at 2:46 am

how to run linux containers in AWS windows server 2019 base datacenter edition as i have followed this blog to run LCOW in AWS windows server 2019 and was through “Error response from daemon: failed to start service utility VM (createreadwrite): CreateComputeSystem 500857995b75ae7b7cb918dd32fc032f7a851004d31d60ee1b544e12b34bfc9b_svm: The virtual machine could not be started because a required feature is not installed.” Any suggestions. Thanks

    Felipe Crochik · May 1, 2019 at 6:17 am

    Hi James. I haven’t tried this on AWS. Have you checked that nested virtualization is supported on the instance you created?

SGP · December 13, 2019 at 6:44 pm

I am currently facing the same issue described by James while using Windows Server 2019 on AWS.
I was expecting this to work just fine with a recent Hyper-V AMI (AMI ID: ami-0127ee9a754557b67 – Windows_Server-2019-English-Full-HyperV-2019.11.13), but when attempting to run a Linux Docker image I am getting the same error.

C:\Users\Administrator>docker run -ti –isolation=hyperv 84120c6c3491
docker: Error response from daemon: failed to start service utility VM (createreadwrite): hcsshim::CreateComputeSystem c5185a5d19859af629d4b383a1c53b3e173748ca102430c47edcf9f11cb926c1_svm: The virtual machine could not be started because a required feature is not installed.
(extra info: {“SystemType”:”container”,”Name”:”c5185a5d19859af629d4b383a1c53b3e173748ca102430c47edcf9f11cb926c1_svm”,”Layers”:null,”HvPartition”:true,”HvRuntime”:{“ImagePath”:”C:\\Program Files\\Linux Containers”,”LinuxInitrdFile”:”initrd.img”,”LinuxKernelFile”:”kernel”},”ContainerType”:”linux”,”TerminateOnLastHandleClosed”:true}).

Any ideas would be greatly appreciated.

I have reviewed the installed Windows components, docker packages, experimental features, default platform, etc., set, re-set, rebooted, … still no joy.

    SGP · December 13, 2019 at 6:47 pm

    oops… my last example includes the “–issolation=hyperv” parameter on “docker run”… this was just another experiment. I copied the wrong example.

    This same behavior happens without this parameter included which is my expected scenario.

Indian Velumani · December 17, 2019 at 3:21 am

Hi Bud,

I tried like and I got error like this.
In Windows 2016 server std.

C:\Program Files\Docker\docker.exe: failed to register layer: failed to start service utility VM (applydiff e8e51d13ddc7
93adab0dad0972c8ccba89df623886232a4df37553c5a10248c0): container e8e51d13ddc793adab0dad0972c8ccba89df623886232a4df37553c
5a10248c0_svm encountered an error during CreateContainer: failure in a Windows system call: The data is invalid. (0xd)
extra info: {“SystemType”:”container”,”Name”:”e8e51d13ddc793adab0dad0972c8ccba89df623886232a4df37553c5a10248c0_svm”,”Lay
ers”:null,”HvPartition”:true,”HvRuntime”:{“ImagePath”:”C:\\Program Files\\Linux Containers”,”LinuxInitrdFile”:”initrd.im
g”,”LinuxKernelFile”:”bootx64.efi”},”ContainerType”:”linux”,”TerminateOnLastHandleClosed”:true}.

Indian Velumani · December 17, 2019 at 3:26 am

Hi Bud,

I tried in windows 2016 server std edition
But I got like this, Any idea to resolve this.

C:\Program Files\Docker\docker.exe: failed to register layer: failed to start service utility VM (applydiff e8e51d13ddc7
93adab0dad0972c8ccba89df623886232a4df37553c5a10248c0): container e8e51d13ddc793adab0dad0972c8ccba89df623886232a4df37553c
5a10248c0_svm encountered an error during CreateContainer: failure in a Windows system call: The data is invalid. (0xd)
extra info: {“SystemType”:”container”,”Name”:”e8e51d13ddc793adab0dad0972c8ccba89df623886232a4df37553c5a10248c0_svm”,”Lay
ers”:null,”HvPartition”:true,”HvRuntime”:{“ImagePath”:”C:\\Program Files\\Linux Containers”,”LinuxInitrdFile”:”initrd.im
g”,”LinuxKernelFile”:”bootx64.efi”},”ContainerType”:”linux”,”TerminateOnLastHandleClosed”:true}.

    nedumaran · April 21, 2020 at 5:58 am

    Hi Velumani, i am also facing the same error that you face. Just wanted to check if you were able to fix this. if so, could you please share the solution for this error?

Leave a Reply

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