Docker Community Forums

Share and learn in the Docker community.

Docker Desktop with WSL2 integration on Windows Server Core edition

I am really new to the container topic.
I have heard from my friends a lot about it and have always wanted to jump on it, but didn’t have a motivation.
Then my son started to play with Arduino and ESP modules and came with a need for Home Assistant.
And guess what, I soon realized that Home Assistant can run on Docker, so finally I found a reason.
But ever since I have read about the possibility to integrate Docker and WSL2, I couldn’t resist anymore, because WSL2 was another thing I have always wanted to try.

I am only trying for 3 weeks, but it looks like either I am missing something or I have chosen a wrong path.

I am running a Hyper-V server with few VMs and I like it so, because it allows me to be isolated from the HW layer and migrate easily to new HW. So, I have decided to create a new VM dedicated to containers, the plan was to reserve part of the resources for them.
And as I didn’t want to decide between Linux and Windows containers I was really lucky about the Docker with WSL2 option.

I have chosen to install the core edition of Windows Server to save some resources and this is where my crazy journey began.
At that time, I didn’t know yet that because of WSL2 this is the only way, at least for this moment.

However, i found out soon after deploying a VM with WS20H2, that the Docker Desktop installer crashes right at the beginning. It’s the missing GUI, I thought myself, so I started to look for other options and found out that there is a preview version of upcoming WS2022 available.

It took me one week to find a build where WSL2+Docker works to find out one day later the build expires, which of course breaks the WSL2 and thus also Docker. More information here Re: WSL 2 not working after installing 20262 - Microsoft Tech Community
Obviously bad timing :frowning:

It took me another week to give up on trying to remove the timebomb :blush:
With all the code integrity checking stuff it isn’t so easy anymore, which is by the way great, I mean that it isn’t so easy to tamper the OS.

Then I recalled that I installed the edition with GUI mainly to compare the Docker setup process with the one on the Core edition. So, I went back to the WS20H2 core edition and achieved a partial success.
The setup is not failing anymore, installing of the “ServerCore.AppCompatibility FOD” helped with the completion of the setup. :+1:

But the first start of Docker Desktop.exe after the required logoff crashes and doesn’t even begin the preparation of the docker WSL2 images. :cry:

I have traced the setup and compared it with the setup on the GUI edition and it seems to be OK.
Then I have tried to trace the first Docker startup procedure with process monitor in the GUI edition and collect all the steps to replicate them in the Core edition, but without success.

While trying to mimic the first startup steps, which the Docker Desktop.exe process starts while running for the first time I achieved a point, where all the Docker WSL2 images were created and started successfully. But even though I started all the other processes, manually in parallel cmd windows, it in the end didn’t work. Obviously there was still some piece of puzzle missing. :sob:

Maybe it isn’t that much work to fix the procedure of first start after setup completion to make it working.

I am by no means an expert in debugging, but in the procmon log I could see that soon after C:\Windows\assembly\NativeImages_v4.0.30319_64\System.Web.Services\12c6a6672b817f2b3bb5cd9551df003c\System.Web.Services.ni.dll image is loaded, another process C:\Windows\system32\WerFault.exe -pss -s 424 -p 4848 -ip 4848 is started where 4848 is the PID of the process Docker Desktop.exe

And in the event-log I could see .Net Runtime error event with following detail:

Application: Docker Desktop.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
at Docker.Systray.ThemeWatcher.NotifyTheme()
at Docker.Systray.ThemeWatcher.Start()
at Docker.App+<Initialize>d__27.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()

If I got it right it is related to the docker running in systray.
I hope there is some way around it.

I am ready to test whatever is necessary to make it working. :wink:
Because even if WSL2 will be in the end part of WS2022 LTSC (edition with GUI) I would rather want to have it working in the core edition, because of the resource saving potential.

thanks for any help

LubomirH

Today I found time to investigate a bit more and realized that not every of my assumption is right. :frowning:
For example my assumptions were, that the “docker desktop.exe” is just the program responsible for the initialization of the docker backend, frontend and other processes and hosts the tray which is the main control panel.

While looking for the differences I have found out that the docker desktop process opens a lot of named pipes which are essential for everything to work together.
I was able to open some of the pipes by starting the dockerD.exe, but not all. :sob:

Isn’t there some parameters which would allow to run the “docker desktop.exe” without a need for systray?

I have no idea what it would mean, but is there any chance for design change to separate the the main procedure from the systray part so it is possible to run it on core edition of windows?

thanks

LH

This post was flagged by the community and is temporarily hidden.