kris_IV
kris_IV

Reputation: 2444

Wirtual Machine with Windows Server from Azure doesnt run Linux based Docker Container

I try to run a Docker container based on Linux on Virtual Machine from Azure with Windows Server 2019.

I work with a lot of tutorials for that, I enabled experimental flags, so docker version show:

 PS C:\Users\azure> docker version
Client: Docker Engine - Enterprise
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        2ee0c57608
 Built:             11/13/2019 08:00:16
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Enterprise
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.24)
  Go version:       go1.12.12
  Git commit:       2ee0c57608
  Built:            11/13/2019 07:58:51
  OS/Arch:          windows/amd64
  Experimental:     true

And docker info:

docker info
Client:
 Debug Mode: false
 Plugins:
  cluster: Manage Docker clusters (Docker Inc., v1.2.0)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 4
 Server Version: 19.03.5
 Storage Driver: lcow (linux) windowsfilter (windows)
  LCOW:
  Windows:
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs 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.1098)
 OSType: windows
 Architecture: x86_64
 CPUs: 1
 Total Memory: 2GiB
 Name: xxx-yyy
 ID: R2TB:P4GZ:MRU4:IU4A:BPTU:DPYY:GV7C:VNL3:JW6F:IRKJ:BTKW:BVNE
 Docker Root Dir: C:\ProgramData\docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: true
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

But finally, when I run any Linux container I got this error:

PS C:\Users\azure> docker run --platform=linux hello-world:linux
docker : C:\Program Files\Docker\docker.exe: Error response from daemon: failed to start 
service utility VM (createreadwrite): hcsshim::CreateComputeSystem 
2410bb8b9e431b1068750d0c79376b1fdc196eef97c0a48ec8571775349acde7_svm: The virtual machine 
could not be started because a required feature is not installed.
At line:1 char:1
+ docker run --platform=linux hello-world:linux
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (C:\Program File... not installed.:String) [], 
    RemoteException
    + FullyQualifiedErrorId : NativeCommandError

(extra info: {"SystemType":"container","Name":"2410bb8b9e431b1068750d0c79376b1fdc196eef97c0
a48ec8571775349acde7_svm","Layers":null,"HvPartition":true,"HvRuntime":{"ImagePath":"C:\\Pr
ogram Files\\Linux Containers","LinuxInitrdFile":"initrd.img","LinuxKernelFile":"kernel"},"
ContainerType":"linux","TerminateOnLastHandleClosed":true}).
See 'C:\Program Files\Docker\docker.exe run --help'. 

I miss something in Azure? In VM config?

Upvotes: -1

Views: 232

Answers (2)

Tore Nestenius
Tore Nestenius

Reputation: 19961

This is how I got Docker to install Properly in an Azure Virtual Machine:

  1. Ensure that the VM SKU size supports virtualization, and I usually use Standard_D2s_v3 or Standard_D2s_v4.

  2. Ensure you do not enable Trusted Launch Virtual Machines because this feature disables virtualization inside the VM.

I blogged about the details about how to get Docker to run in Azure here: Running Docker in an Azure Windows Virtual Machine – Not so fast!

Upvotes: 0

kris_IV
kris_IV

Reputation: 2444

I solve my problem and it wasn't a problem with config, docker, or with Windows Server.

The problem was hardware - when you select Azure processor you should use a processor with nested virtualization. The solution is described here: https://blog.darrenjrobinson.com/azure-vm-docker-createcontainer-error-0xc0370102/

Upvotes: 0

Related Questions