WSL Distro Terminated abruptly

I need to run applications on windows machines to control audio and lights in restaurants. Because of the inconsistencies in windows and to be able to automatically distribute updates I decided to go with docker. I was hoping to get some reliability from docker but I am having some issues.

image
The windows machines restart at night. The issue in the screenshot above happens. I am not sure what could be causing this. Everything usually works fine.

Figuring out the cause of this issue seems impossible to me at this point. But if there are any logs I can look into to see when this crash happened that would be great. 1. Are there any logs I can look in to see when this happened, and why.

2. Is there a way I can check if docker desktop and wsl are running correctly from a Powershell script? I can then set up a task in windows task scheduler which can check if everything is running correctly before the restaurants open.

Diagnostics ID: DAFC983F-2DDC-4113-A187-8B1A069C529A/20240314080351

Good decision to use Docker, but Docker Desktop is for developers. Better to run a virtual machine on Windows and install Docker in it. See:

Maybe there are events or errors in the Windows Event Viewer

You can check if wsl works well with the command below in powershell

wsl -l -v

2 Likes

You either run Docker in your own virtual machine without the desktop as @bluenobly wrote, or use Windows server and you can install Docker CE. As far as I know there is no official guide to install it on Windows 10 or Windows 11. Maybe you could also try Moby directly, which is the base of Docker.

Here is the documentation from Microsoft

UPDATE

I realized we are talking about Linux containers here. So the solution is indeed what @bluenobly recommended. A virtual machine.

1 Like

Better to run a virtual machine on Windows and install Docker in it.

My clients use the computers through teamviewer and I want to give them easy access to the logs, restarting etc. without having to run commands. The docker containers also need access to the C:/ file system. If both of those are possible while running in a VM I am all for it.

You can check if wsl works well with the command below in powershell

Wsl works well, just not sometimes at random moments I guess.

Could you explain the difference between WSL and a VM? I thought wsl is a VM.

I kinda feel like installing a seperate VM is going to be another dependency and another point of failure, and another day of figuring out how to install it on windows machines that have been broken by debloaters and have windows update disabled.

You used Docker Desktop which is based on WSL2. It runs two different WSL2 distributions. A distribution is basically a container in the WSL2 virtual machine. Then Docker desktop runs containers to run modules. So There is a containerd container in which the Docker daemon runs.

When I say you need a VM, I mean you could use WSL2 if you want to, but since Docker Desktop is for development, and not for using it as a server, you would need to install Docker CE in a WSL2 distribution. If you can start the WSL2 distribution automatically, then Docker CE starts automatically (if you enable systemd in the WSL distro) and your containers can also start automatically if the restart policy is correct. I use Windows only for testing some scenarios, so I canā€™t tell you the exact solutions when it comes to choosing the best way to automatically start a virtual machine on Windows.

1 Like

Alright, Iā€™ll keep my eyes open on if this issue persists. Weā€™re swapping out some old NUCs for new ones and this issue seems to be happening only on some NUCs anyway.

If I go with this solution Iā€™ll have to give my client the commands for checking logs. But itā€™s no rocket science luckily.

Today I learned Docker desktop is not for production. Thanks @bluenobly and @rimelek

You can always install Loki in the VM and give your client access to the web-based dashboard

Or install Portainer and they will have a web-based dashboard for restarting containers as well.

2 Likes

See the error below when I launch Docker Desktop:

error spotted in wslbootstrap log: ā€œ[2024-07-19T22:40:28.673993400Z][wsl-bootstrap][F] exec: "mount": executable file not found in $PATHā€

WSL and Ubuntu-22.04 are installed correctly

However, when launching Ubuntu-22.04 (or Ubuntu) for the very first time, $PATH is not correct, and commands do not work (like mount, grep, lesspipe, etc)

This error only appeared once when launching Ubuntu* console. Afterwards, $PATH is correct and all the commands work.

  1. Any idea how Ubuntu* can recognize the correct $PATH for the very first time?
  2. If above 1, is resolved, I imagine Docker Desktop error about $PATH would be resolved too.

Please advise

shuyih, did you ever solve your issue, I am having a very similar issue. WSL is working just fine, I think the issue is something
DockerNotStarting
with PATH since thatā€™s the error message, but I donā€™t know what it is.