SOLVED

[server 20303] Issues running containers

%3CLINGO-SUB%20id%3D%22lingo-sub-2226479%22%20slang%3D%22en-US%22%3E%5Bserver%2020303%5D%20Issues%20running%20containers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2226479%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20installed%20containers%20on%20my%20host%20(%20a%20Hyper-V%20VM%20named%20CH1.%20After%20installation%20and%20installing%20PWSH%20and%20VS%20Code%2C%20I%20used%20this%20script%20to%20configure%20the%20server%20for%20docker%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fdoctordns%2FPACKT-PS7%2Fblob%2Fmaster%2Fscripts%2FCh%252012%2520-%2520Containers%2FRecipe%252012.1%2520-%2520Setting%2520up%2520a%2520container%2520host.ps1%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fdoctordns%2FPACKT-PS7%2Fblob%2Fmaster%2Fscripts%2FCh%252012%2520-%2520Containers%2FRecipe%252012.1%2520-%2520Setting%2520up%2520a%2520container%2520host.ps1%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20installation%20and%20reboot%2C%20all%20looks%20well%20-%20I%20can%20docker%20pull%2C%20docker%20search%20etc.%20However%20if%20I%20attempt%20to%20run%20the%20hello-world%20container%2C%20I%20see%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EPS%20C%3A%5CFoo%26gt%3B%20docker%20run%20hello-world%0Adocker%3A%20Error%20response%20from%20daemon%3A%20hcsshim%3A%3ACreateComputeSystem%2090142433e8cebe0abaa7e2e99b026a835008d93f4c9dfd28d83b53184bd01431%3A%20The%20container%20operating%20system%20does%20not%20match%20the%20host%20operating%20system.%0A(extra%20info%3A%20%7B%22SystemType%22%3A%22Container%22%2C%22Name%22%3A%2290142433e8cebe0abaa7e2e99b026a835008d93f4c9dfd28d83b53184bd01431%22%2C%22Owner%22%3A%22docker%22%2C%22VolumePath%22%3A%22%5C%5C%5C%5C%3F%5C%5CVolume%7Bd7ea90db-8134-45c0-9ccf-15b742c39627%7D%22%2C%22IgnoreFlushesDuringBoot%22%3Atrue%2C%22LayerFolderPath%22%3A%22C%3A%5C%5CProgramData%5C%5Cdocker%5C%5Cwindowsfilter%5C%5C90142433e8cebe0abaa7e2e99b026a835008d93f4c9dfd28d83b53184bd01431%22%2C%22Layers%22%3A%5B%7B%22ID%22%3A%22b4536180-60ed-5a6d-86d7-a37ed5ce5b11%22%2C%22Path%22%3A%22C%3A%5C%5CProgramData%5C%5Cdocker%5C%5Cwindowsfilter%5C%5C40283115b35607b66b4d8d7695efcb7458a8d257b436b3f7a390953f43c04fbe%22%7D%2C%7B%22ID%22%3A%2242828790-7ad8-5ecf-807f-b3e273827547%22%2C%22Path%22%3A%22C%3A%5C%5CProgramData%5C%5Cdocker%5C%5Cwindowsfilter%5C%5C902d2a8dccd4e30470ae472bdad3eb46ac6e086b06fc80192081fb940c0fbb0c%22%7D%2C%7B%22ID%22%3A%22a9a80d15-dd55-508d-852d-6cf117cf34a9%22%2C%22Path%22%3A%22C%3A%5C%5CProgramData%5C%5Cdocker%5C%5Cwindowsfilter%5C%5C811d69326ffcce5cace299f3e56e2fb721528576a1bcb07106dd942e7d19dcc6%22%7D%5D%2C%22HostName%22%3A%2290142433e8ce%22%2C%22HvPartition%22%3Afalse%2C%22EndpointList%22%3A%5B%22fd49e246-152a-460c-85b5-95064b53aced%22%5D%2C%22AllowUnqualifiedDNSQuery%22%3Atrue%7D).%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ei%20understand%20that%20this%20is%20because%20WIndows%20and%20docker%20have%20different%20versions.%20But%20if%20I%20attempt%20to%20run%20this%20with%20hyper-v%2C%20it%20fails%20too%20-%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3ES%20C%3A%5CFoo%26gt%3B%20docker%20run%20hello-world%20--isolation-hyperv%0A%0Adocker%3A%20Error%20response%20from%20daemon%3A%20hcsshim%3A%3ACreateComputeSystem%20112d3c21fa74f58019e3cea40302a17b4775c454515468e1531d05b14d61b86c%3A%20The%20container%20operating%20system%20does%20not%20match%20the%20host%20operating%20system.%0A(extra%20info%3A%20%7B%22SystemType%22%3A%22Container%22%2C%22Name%22%3A%22112d3c21fa74f58019e3cea40302a17b4775c454515468e1531d05b14d61b86c%22%2C%22Owner%22%3A%22docker%22%2C%22VolumePath%22%3A%22%5C%5C%5C%5C%3F%5C%5CVolume%7B7005aac7-0fc8-4f1c-a498-7bd5a777ce70%7D%22%2C%22IgnoreFlushesDuringBoot%22%3Atrue%2C%22LayerFolderPath%22%3A%22C%3A%5C%5CProgramData%5C%5Cdocker%5C%5Cwindowsfilter%5C%5C112d3c21fa74f58019e3cea40302a17b4775c454515468e1531d05b14d61b86c%22%2C%22Layers%22%3A%5B%7B%22ID%22%3A%22b4536180-60ed-5a6d-86d7-a37ed5ce5b11%22%2C%22Path%22%3A%22C%3A%5C%5CProgramData%5C%5Cdocker%5C%5Cwindowsfilter%5C%5C40283115b35607b66b4d8d7695efcb7458a8d257b436b3f7a390953f43c04fbe%22%7D%2C%7B%22ID%22%3A%2242828790-7ad8-5ecf-807f-b3e273827547%22%2C%22Path%22%3A%22C%3A%5C%5CProgramData%5C%5Cdocker%5C%5Cwindowsfilter%5C%5C902d2a8dccd4e30470ae472bdad3eb46ac6e086b06fc80192081fb940c0fbb0c%22%7D%2C%7B%22ID%22%3A%22a9a80d15-dd55-508d-852d-6cf117cf34a9%22%2C%22Path%22%3A%22C%3A%5C%5CProgramData%5C%5Cdocker%5C%5Cwindowsfilter%5C%5C811d69326ffcce5cace299f3e56e2fb721528576a1bcb07106dd942e7d19dcc6%22%7D%5D%2C%22HostName%22%3A%22112d3c21fa74%22%2C%22HvPartition%22%3Afalse%2C%22EndpointList%22%3A%5B%224fff9c4f-d11d-4307-acd2-6111c9ed7bef%22%5D%2C%22AllowUnqualifiedDNSQuery%22%3Atrue%7D).%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ei%20know%20I%20am%20probably%20missing%20something%20trivial%26nbsp%3B%20-%20but%20would%20app%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2226479%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EContainers%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2227722%22%20slang%3D%22en-US%22%3ERe%3A%20%5Bserver%2020303%5D%20Issues%20running%20containers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2227722%22%20slang%3D%22en-US%22%3E%3CP%3ESo%20with%20the%20latest%20build%20of%20Server%202022%2C%20I%20simply%20can%20not%20run%20any%20container%20either%20natively%20or%20via%20isolation.%3CBR%20%2F%3EI%20have%20a%20set%20of%20scripts%20at%3A%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fdoctordns%2FPACKT-PS7%2Ftree%2Fmaster%2Fscripts%2FCh%252012%2520-%2520Containers%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fdoctordns%2FPACKT-PS7%2Ftree%2Fmaster%2Fscripts%2FCh%252012%2520-%2520Containers%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EALL%20of%20them%20fail%20to%20run%20the%20container.%3CBR%20%2F%3EEach%20of%20these%20scripts%20worked%20with%20Server%202019%20-%20and%20am%20happy%20to%20retest%20that%20if%20needed.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2228384%22%20slang%3D%22en-US%22%3ERe%3A%20%5Bserver%2020303%5D%20Issues%20running%20containers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2228384%22%20slang%3D%22en-US%22%3EThe%20version%20issue%20is%20not%20related%20to%20docker%20and%20Windows%2C%20but%20to%20the%20container%20host%20version%20and%20the%20container%20image.%20First%2C%20see%20that%20Windows%20container%20hosts%20can%20only%20run%20Windows%20images.%20Also%2C%20the%20host%20and%20container%20image%20versions%20must%20match.%20See%20more%20details%20at%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fvirtualization%2Fwindowscontainers%2Fdeploy-containers%2Fversion-compatibility%3Ftabs%3Dwindows-server-20H2%252Cwindows-10-20H2%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fvirtualization%2Fwindowscontainers%2Fdeploy-containers%2Fversion-compatibility%3Ftabs%3Dwindows-server-20H2%252Cwindows-10-20H2%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EAs%20for%20the%20hyper-v%20isolation%2C%20since%20you're%20using%20a%20VM%2C%20you'll%20need%20to%20enable%20nested%20virtualization%20on%20that%20VM%20so%20the%20container%20can%20run%20with%20hypervisor%20isolation.%3CBR%20%2F%3ERegards%2C%3CBR%20%2F%3EVinicius%3CBR%20%2F%3ETwitter.com%2Fvrapolinario%3C%2FLINGO-BODY%3E
Contributor

I have installed containers on my host ( a Hyper-V VM named CH1. After installation and installing PWSH and VS Code, I used this script to configure the server for docker: 

https://github.com/doctordns/PACKT-PS7/blob/master/scripts/Ch%2012%20-%20Containers/Recipe%2012.1%20...

 

After installation and reboot, all looks well - I can docker pull, docker search etc. However if I attempt to run the hello-world container, I see this:

 

 

PS C:\Foo> docker run hello-world
docker: Error response from daemon: hcsshim::CreateComputeSystem 90142433e8cebe0abaa7e2e99b026a835008d93f4c9dfd28d83b53184bd01431: The container operating system does not match the host operating system.
(extra info: {"SystemType":"Container","Name":"90142433e8cebe0abaa7e2e99b026a835008d93f4c9dfd28d83b53184bd01431","Owner":"docker","VolumePath":"\\\\?\\Volume{d7ea90db-8134-45c0-9ccf-15b742c39627}","IgnoreFlushesDuringBoot":true,"LayerFolderPath":"C:\\ProgramData\\docker\\windowsfilter\\90142433e8cebe0abaa7e2e99b026a835008d93f4c9dfd28d83b53184bd01431","Layers":[{"ID":"b4536180-60ed-5a6d-86d7-a37ed5ce5b11","Path":"C:\\ProgramData\\docker\\windowsfilter\\40283115b35607b66b4d8d7695efcb7458a8d257b436b3f7a390953f43c04fbe"},{"ID":"42828790-7ad8-5ecf-807f-b3e273827547","Path":"C:\\ProgramData\\docker\\windowsfilter\\902d2a8dccd4e30470ae472bdad3eb46ac6e086b06fc80192081fb940c0fbb0c"},{"ID":"a9a80d15-dd55-508d-852d-6cf117cf34a9","Path":"C:\\ProgramData\\docker\\windowsfilter\\811d69326ffcce5cace299f3e56e2fb721528576a1bcb07106dd942e7d19dcc6"}],"HostName":"90142433e8ce","HvPartition":false,"EndpointList":["fd49e246-152a-460c-85b5-95064b53aced"],"AllowUnqualifiedDNSQuery":true}).

 

 

i understand that this is because WIndows and docker have different versions. But if I attempt to run this with hyper-v, it fails too - like this:

 

 

S C:\Foo> docker run hello-world --isolation-hyperv

docker: Error response from daemon: hcsshim::CreateComputeSystem 112d3c21fa74f58019e3cea40302a17b4775c454515468e1531d05b14d61b86c: The container operating system does not match the host operating system.
(extra info: {"SystemType":"Container","Name":"112d3c21fa74f58019e3cea40302a17b4775c454515468e1531d05b14d61b86c","Owner":"docker","VolumePath":"\\\\?\\Volume{7005aac7-0fc8-4f1c-a498-7bd5a777ce70}","IgnoreFlushesDuringBoot":true,"LayerFolderPath":"C:\\ProgramData\\docker\\windowsfilter\\112d3c21fa74f58019e3cea40302a17b4775c454515468e1531d05b14d61b86c","Layers":[{"ID":"b4536180-60ed-5a6d-86d7-a37ed5ce5b11","Path":"C:\\ProgramData\\docker\\windowsfilter\\40283115b35607b66b4d8d7695efcb7458a8d257b436b3f7a390953f43c04fbe"},{"ID":"42828790-7ad8-5ecf-807f-b3e273827547","Path":"C:\\ProgramData\\docker\\windowsfilter\\902d2a8dccd4e30470ae472bdad3eb46ac6e086b06fc80192081fb940c0fbb0c"},{"ID":"a9a80d15-dd55-508d-852d-6cf117cf34a9","Path":"C:\\ProgramData\\docker\\windowsfilter\\811d69326ffcce5cace299f3e56e2fb721528576a1bcb07106dd942e7d19dcc6"}],"HostName":"112d3c21fa74","HvPartition":false,"EndpointList":["4fff9c4f-d11d-4307-acd2-6111c9ed7bef"],"AllowUnqualifiedDNSQuery":true}).

 

 

i know I am probably missing something trivial  - but would appreciate any clues!

 

4 Replies

So with the latest build of Server 2022, I simply can not run any container either natively or via isolation.
I have a set of scripts at: https://github.com/doctordns/PACKT-PS7/tree/master/scripts/Ch%2012%20-%20Containers

ALL of them fail to run the container.
Each of these scripts worked with Server 2019 - and am happy to retest that if needed.

The version issue is not related to docker and Windows, but to the container host version and the container image. First, see that Windows container hosts can only run Windows images. Also, the host and container image versions must match. See more details at: https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatib...

As for the hyper-v isolation, since you're using a VM, you'll need to enable nested virtualization on that VM so the container can run with hypervisor isolation.
Regards,
Vinicius
Twitter.com/vrapolinario

Thsanks for your reply

1. Regarding enabling virtualization - I have already set nested virtualization:

PS C:\Foo> Get-VM -VMName ch1
Name State CPUUsage(%) MemoryAssigned(M) Uptime   Status             Version
---- ----- ----------- ----------------- ------   ------             -------
CH1  Off   0           0                 00:00:00 Operating normally 10.0

PS C:\Foo> Get-VMProcessor -vmname  ch1 | fl *virt*
ExposeVirtualizationExtensions : True

So that is not a solution. :(

 

I do understand that the issue is between the container host version and the container image, but so far, I can find actually ZERO containers that can run with Windows Server 2022, with or without virtualization. 

 

If you look at the scripts I have tested, none of them works, whereas these all worked to a degree with 

Windows Server 2019. This feels like a regression in 2022.

 

Are containers actually tested prior to Insiders released? If so, can you share the tests so I can see how to get containers to run successfully??

 

best response confirmed by doctordns (Contributor)
Solution

@doctordns 

 

docker run hello-world --isolation-hyperv

 

should be

 

 

docker run --isolation=hyperv hello-world

 

 

 

Things after the container name are taken as parameters to the container execution, and so docker isn't seeing the "--isolation-hyperv" parameter when you add it, or it would have told you that it was an unknown parameter, as it needs to be "--isolation=hyperv" or "--isolation hyperv".

 

The hello-world container will need to run with Hyper-V isolation for you, because it's based on nanoserver:1809, i.e. Windows Server LTSC 2019. If you're following a guide for Windows 10, note that on Windows 10, Hyper-V isolation is the default for Docker, so they won't use --isolation=hyperv in examples like this.

 

To use process isolation, you'll need to use an insider container image base matching the installed build, e.g. mcr.microsoft.com/windows/nanoserver/insider:10.0.20303.1 . Sadly, I don't think many (or any) image sources in the wild produce builds based on the insider versions, so if you're not building your own containers, you'll need to use Hyper-V isolation until this version of Windows Server is shipped, and container builders add it to their CI pipelines.