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.
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.
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.
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.
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
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)