Windows Server Summit 2024
Mar 26 2024 08:00 AM - Mar 28 2024 04:30 PM (PDT)
Microsoft Tech Community
LIVE

WSL and Docker and Linux oh my!! (Part 2: Docker)

Copper Contributor

Okay, so I'm lost. I'm trying to configure a 17666 core build on a bare-metal install (old small box...HP MicroServer N40L 8GB). For a variety of reasons, I want it to be a docker host. Also would like it to run WSL (though this is lower priority).

 

PART 2: Docker

 

I want to run both Linux and Windows images. So I've installed LCOW per: https://github.com/linuxkit/lcow. Changed the service to start with the --experimental flag using sc config docker binPath= ...

 

Now it does not run windows containers anymore:

 

C:\>docker run --rm hello-world
docker: Error response from daemon: container 1a32b494bf18b10d78a905bc972901c0d2ab0c6f6be37fa59916f3485f916c29 encountered an error during CreateContainer: failure in a Windows system call: The operating system of the container does not match the operating system of the host. (0xc0370101) extra info: {"SystemType":"Container","Name":"1a32b494bf18b10d78a905bc972901c0d2ab0c6f6be37fa59916f3485f916c29","Owner":"docker","VolumePath":"\\\\?\\Volume{b318dbdc-6397-4513-86fb-ed332635edf0}","IgnoreFlushesDuringBoot":true,"LayerFolderPath":"C:\\ProgramData\\docker\\windowsfilter\\1a32b494bf18b10d78a905bc972901c0d2ab0c6f6be37fa59916f3485f916c29","Layers":[{"ID":"6913d93c-b181-5be4-8b0e-36b9e873f96f","Path":"C:\\ProgramData\\docker\\windowsfilter\\a00e3c10618633ce87c0e2cbc24056428a684ccbe275ea22557cbfd5ea946768"},{"ID":"d3ec5c0f-f848-52fb-b859-94595b25975a","Path":"C:\\ProgramData\\docker\\windowsfilter\\c7ec77af8b4b06edeb16680b878314fe8de371a95df309e4fa8caf2944ceb4e0"},{"ID":"67f45153-1f92-56d2-9a10-e2696149f2ff","Path":"C:\\ProgramData\\docker\\windowsfilter\\fb44165b3e34be0bd7b660dbaf1c4a96338073c9745fee5d22c54b5cc3c73dd1"},{"ID":"5e43566f-5fec-5b05-a03e-39160ddcc670","Path":"C:\\ProgramData\\docker\\windowsfilter\\1016c495f97d82e56f533775dfcb242a90f8aa5727cf61af6e19987b5b1470fb"}],"HostName":"1a32b494bf18","HvPartition":false,"EndpointList":["e242a70a-0092-4318-b6c3-e2686b7c0e10"],"AllowUnqualifiedDNSQuery":true}.

 

Results in a couple application event log errors from Docker (event ID 1, no message)

 

Running linux containers WORKS...kinda. Take forever to start. Then I get a Microsoft-Windows-Hyper-V-VmSwitch error in the event log:

 

Failed to connect NIC 3BC22E50-35B0-4AB2-BB29-3E0123F8596A--2C843790-853C-4D11-9E9C-A250495F8B22 (Friendly Name: ) to port  (Friendly Name: ) on switch  (Friendly Name: ), status = Object Name not found..

But at least the alpine image appears to function. And networking works as expected. Just really slow getting started.

 

Thoughts on this one? Can I get both Windows and Linux containers to work? At the same time?

 

4 Replies

Hi Paul,

 

Did you confirm that you were able to run the Windows container previously, before enabling LCOW? Alternatively, can you run the container if you disable LCOW again?

 

I'm wondering if your OS build matches the container build. Here is some information about using the appropriate container Image in Windows Insider Builds:

https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/using-insider-containe...

https://hub.docker.com/r/microsoft/windowsservercore-insider/

 

Would this work if you install Docker and enable LCOW similarly as described in the following blog post?

https://blog.docker.com/2017/09/docker-windows-server-1709/

Have you tried:

docker run --isolation=hyperv --platform=windows microsoft/nanoserver-insider:10.0.17666.1000

? that will force all the flags and use a container image matching 17666.

Thanks to both. SO. I did get it to work temporarily. Needed the --isolation=hyperv switch for the windows containers. After that, all worked as needed. UNTIL I decided to try to do a fresh install of docker since I was still getting warnings and errors in the event log.

 

So I did a normal Uninstall-Package to get rid of it. Rebooted. Install-Package. Reboot. Same problem. Decide see if I can do a "cleaner" uninstall. So Uninstall-Package. Reboot. rd /s ProgramData\docker. All hell breaks loose. That windowsfilter folder is a booger. Finally got rid of it using the docker-ci-zap tool. But I think I hosed something bad when I rd'd the windowsfilter folder. 'Cause after a reinstall (and a few more uninstall/reinstall attempts) the docker service crashes whenever I try to pull a windows-based container. Downloads the container, gives me an "unexpected EOF" error, and the docker service is down. And I'm still getting the same docker warnings in the Event Viewer.

 

So thanks for your help. Definitely got me moving again. But I'm thinking it's time to do a clean server install. :( Maybe it'll fix the WSL problem, as well.

 

I guess as semi-useful feedback, this was a nearly clean install of a 2016 server (most recent updates installed) upgraded to the 17666 build. Yes. The windows containers worked in server 2016. Pretty sure they were broken immediately after the in-place upgrade (i.e., before trying to manually install LCOW).

Alright let us know how it goes.

--isolation=hyperv is ALWAYS needed if you're running a container that was built using a Windows base image older than the current release. That explains why containers you had on Windows Server 2016 didn't work after the upgrade to 17666. There's more details here: https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatib...