Docker for windows will not start [duplicate] - windows

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/

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 Destop for windows in not starting

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

windows . how to automatic satrt apache2 in ubuntu windows

I want to automatic start apache2 in ubuntu windows. So when startUp my laptop no longer running comment
service apache2 start
My OS is windows but i run apache in ubuntu windows.
You can make any program run at startup (even bash on windows) by going to Run, entering shell:common startup and adding a shortcut of the program in that folder.
Or simply place a shortcut of bash in the following location C:\Users\<YOURUSERNAME>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
But you cannot startup apache2 as a service, only as daemons:
Background tasks, daemons are now supported starting Insider build 17046. See theĀ blogĀ for more details. But, auto start of services is still not available.
https://github.com/Microsoft/WSL/issues/511

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.

DockerToolbox1.11.2.exe Not running on 64bit Win7

Unable to run DockerToolbox1.11.2.exe in Windows7.
Tried running the installer using admin privileges, wont run. Task manager status shows not responding.
Could it be corporate proxy settings?
I have 64bit Windows7 laptop.
Verified Hardware assisted
virtualization is enabled on this computer
Try the alternative: docker machine v0.8.0-rc2
All you need to do is:
download docker-machine-Windows-x86_64.exe,
rename it in docker-machine.exe somewhere on your %PATH%,
type doskey dm=docker-machine.exe $*
then type 'dm' (that will display the help)
From there you can start creating docker machines.

Resources