Docker Destop for windows in not starting - windows

when I am starting Docker either from Docker Desktop icon or from "C:\Program Files\Docker\Docker\Docker Desktop.exe" I get an error that "windows cannot find 'C:\Program Files\Docker\Docker\Docker Desktop.exe. Make sure you have typed the name correctly and try again '. I am stuck, is there anything I can do to fix this?
I tried the solutions mentioned in these two SO threads, but nothing worked for me:
How do we start the daemon?
Docker Desktop for Windows

Related

Can no longer access WSL2 files from Windows explorer or launch Windows programs from WSL2

I've been running WSL2 on Windows 10 for several months now and just recently lost these abilities. I can still open a WSL2 terminal and interact with my Ubuntu installation there.
Accessing WSL2 files from explorer
I could previously go to \\wsl$\Ubuntu and see all my WSL2 files. I can still see the Ubuntu folder at \\wsl$, but when I try to open it I get a loading bar and nothing happens (even after waiting for a long time):
Also in Powershell:
Opening Windows program from WSL2
Previously I could open Windows programs like explorer and VSCode from a WSL2 terminal with explorer.exe and code respectively. Now when I try this the terminal just hangs and nothing opens.
Note that I can still navigate to /mnt/ and see all my Windows files from the WSL2 terminal.
I'm running Windows 10 Version 1909 (OS Build 18363.1379) and Ubuntu 20.04.1.
I'm not sure I have an answer for you, but some general troubleshooting steps to try:
Exit your instances and try a wsl --shutdown.
If that works, try turning off Windows Fast Startup. Also avoid hibernation. These are known to interfere with some WSL network functionality.
Try adding the following section to your /etc/wsl.conf:
[interop]
enabled = true
This should be the default, but it wouldn't be the first time we've seen WSL not following the defaults for some reason.
Make sure your Windows temp directory is not compressed
Make sure your distribution folder under %userprofile%/Local/AppData/Packages is not compressed, especially the LocalState subdirectory where the ext4.vhdx lives.
If enabled, try turning off Windows Ransomware Protection
I had the same issue (although on Windows 11). It was very annoying. I noticed that after a restart it was ok, but after a few minutes and almost always after running VSCode, it was breaking again. Here's what worked for me:
exporting my distro (wsl --export <Distro> <FileName>)
unregistering it from WSL (wsl --unregister <Distro>)
uninstalling all WSL-related stuff, like the optional Windows feature, the WSL app from the store (I had them both). I also removed WSLg but I'm not sure if that was necessary
restarting
installing again the app from the store (no need to turn on the optional Windows feature anymore in case you are on build 22000 or higher)
finally just reimporting the distro (wsl --import <Distro> <InstallLocation> <FileName>)
After going through the above steps the issue was resolved and now my WSL2 works like a charm.

Docker for windows will not start [duplicate]

This question already has answers here:
Docker cannot start on Windows
(59 answers)
Closed yesterday.
I have installed Docker for windows as a complete noob looking to try it out.
I have ensured Hyper-V is enable, virtualisation is enabled also
any time I try and run the docker desktop the whale icon is red and it states that it could not start, and if I try to run a command like from cmd I get teh following error
error during connect: Get
http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/images/json: open
//./pipe/docker_engine: The system cannot find the file specified. In
the default daemon configuration on Windows, the docker client must be
run elevated to connect. This error may also indicate that the docker
daemon is not running.
I am at a loss as to how I can trouble shoot.
I have also noticed that the STATE when i list my WSL devices is always set as "Installing" even if I completely uninstall Docker through Add/Remove programs
I have had similar error and solved as follow;
In cmd, on admin mode run below command:
docker-machine restart default
if you see anything like: it is not exist then run: docker-machine create
Then you'll get a message something like:
open C:\User\{User_name}\.docker\machine\machines\default\config.json:
The system cannot find the file specified.
Go to the docker icon which will be on your windows tray (bottom right corner of the desktop)
Right click on the docker icon > Settings > Reset > Restart Docker
This solution worked for me. And reference for this answer:
docker cannot start on windows
Literally do as it says: launch Docker as admin.
Quit Docker, and ensure it is no longer running. You should be able to see if its running in the system tray. Right click -> Quit Docker Desktop
It may take a few seconds for it to stop. Wait for the windows notification:
Navigate to the installation directory, which for me was defaulted to C:\Program Files\Docker\Docker. Launch Docker Desktop.exe as admin
This will open the Docker UI. Wait for Docker to fully start up before attempting to consume its services
I had the same problem and here's how I solved it. Install the Docker and please follow brief instructions...
First - I enabled virtualization from BIOS.
Second - I downloaded and installed Linux kernel update package.
Third - Go to "Turn windows features on and off" window
Check whether following is checked...
* Virtual Machine Platform
* Windows Hypervisor Platform
* Windows Subsystem for Linux
You need to restart the PC and Docker will be working.
Please refer the following link and it will definitely give you more information - https://docs.docker.com/docker-for-windows/install/
Go to Powershell (run as administrator), and run this lines
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon
check if it set on Linux containers overwise switch to Linux
Have you tried running Docker using WSL2?
https://docs.docker.com/docker-for-windows/wsl/

trouble debugging error with exit code 3221225781 (missing libraries) in windows docker container

i'm trying to run a docker container on Windows 10 which should execute a windows executable (myprogram.exe). Below you find my dockerfile:
FROM microsoft/windowsservercore
COPY mydir/myprogram.exe /mydir/
CMD ["/mydir/myprogram.exe","someparameter"]
So i build the image with:
docker image build --tag myimage .
and run the container with:
docker run myimage
Unfortunately if I check the status of the container with:
docker ps -a I can see that the container has exited with
exit code 3221225781
, which seems to point to a missing dll.
To debug the problem I run the command:
docker run -it --name debug microsoft/windowsservercore cmd, stopped the container and copied the windows executable in the container file system :
docker cp myprogram.exe debug:c:/myprogram.exe
Now I start the container again using docker start -i debug and enter myprogram.exe myparameter. Unfortunately the program exits immediately (usually it runs about 30 sec) without any output, error code ...
My only explanation for this behavior is that if some cmd program is missing some dll's the corresponding error message is not included in the STDERR but rather in a message dialog. Apparently docker doesn't support this feature???
So what is the best was to solve this problem. Using dependency walker to go through all dll's needed is possible but would take some time and I'm looking for some more elegant solution.
You need to install Visual C++ redistributable.
Download the appropriate version of vc_redist.x64.exe and place it in the folder containing your Dockerfile
Edit your Dockerfile so you preinstall VC++ redistributables when you build your image by adding:
FROM mcr.microsoft.com/windows/sservercore
WORKDIR c:\mydir
COPY "vc_redist.x64.exe" .
RUN vc_redist.x64.exe /install /passive /norestart /log out.txt
COPY mydir/myprogram.exe c:\mydir
CMD ["c:\mydir\myprogram.exe","someparameter"]
Your application should run now.
Note: you need 64-bit build of VC++ redistributable and the appropriate version. You can find some download urls here
This is quite an open-ended question, so it is not possible to give precise answer. Here are a few thoughts:
This is your program that is missing a dependency. Presumably, you as the program author should be aware of what dependencies are required. You need to make sure to include them in your docker image, when you build it.
You are creating your image based on Windows Core, which does not have the whole slew of UI components. This looks like the most obvious thing that could go wrong, given the symptoms. So what I would do is try and make sure that your program can run on Windows Core in principle. Which brings me to the next point.
The most practical way to troubleshoot, in my opinion, is to remove Docker from the equation. You want to run your program on Windows Core. So setup a machine (physical or VM) with Windows Core inside and try to run your program there. There is a good chance that it won't run with the same symptoms. If that's the case, you now have reduced complexity, because you know that your problem has nothing to do with docker (or not).
Finally, when you have your Windows Core machine up and running, you might be able to see a message box pop up with the error immediately (even on Core you can run some programs with UI can run, and message boxes are not an uncommon site), and failing that you can run sysinternals procmon/procexp even on Windows Core, so using those to locate missing dependencies could help. There is also Dependencies.
Note: by "Windows Core" in this answer I mean Core option of Windows Server

Docker whale icon is not appearing in system tray

I want to switch my container from Linux to Windows. The documentation says go to docker whale icon in system tray and switch it. But it is not appearing in my system tray and I have my docker running. Is there any alternative way to switch to windows container
My OS - Windows 10 Home Edition
The following finally worked for me:
Type "Docker" in the Windows search bar
Right click -> Run as administrator
Credits: Unable to see the Docker white whale Icon in system tray..
icon could be hidden by windows in some cases.
windows 10 settings > taskbar >
"select which icons appear on the taskbar" >
change 'docker desktop' to on.
For me it helped to uninstall and install docker for windows, I had a version 2.1.0.4, November 2019, running it as the admin mentioned here and not positively elsewhere did not help me
I had similar issue after the initial installation of Docker Desktop 4.7.1 running with WSL 2 backend from the start. I fixed it like this.

How to start Boot2Docker in PowerShell in Windows?

Windows 7/8 has a more advanced command-prompt called PowerShell. This has easy copy paste and scrolling support. Boot2Docker is a simple application for Windows to launch a Docker environment.
Problem is: the Docker environment is launched on the old command prompt, and no advanced options are available. Is there any small technique where we can use PowerShell + Boot2Docker?
Edit: You can refer the latest document reference from Docker. They gave simple guidelines to access Docker shell from Putty and Powershell.
https://docs.docker.com/installation/windows/
I solved this problem in few steps. There can be better solutions as well.
Boot2Docker uses Git shell to launch virtual machine for Virtualbox.
Step 1: Append following to your System PATH (Environment Variables)
C:\Program Files (x86)\Git\cmd;
Step 2: Open Powershell (Run+powershell)
Step 3: Go to your Docker installation folder in powershell and execute following command
sh.exe .\start.sh
Please find out simple shortcut approach to avoid hard copy.

Resources