I have been using VS code for several months to connect to a running Docker container on another machine. I run VS code from my local Windows machine and use the Remote SSH extension to connect to a remote Ubuntu machine which is running a docker container. As of yesterday, I am no longer able to access the container and the application seems to hang.
I have made sure that my container is running on the remote machine. My steps are:
"Open a Remote Window" > "Connect to Host..."
Connect via SSH
"Open a Remote Window" > "Attach to Running Container..."
I get a pop-up on the bottom-right of the screen saying "Setting up Remote-Containers (show log)" and when I open the log I see the following:
[11584 ms] Remote-Containers 0.251.0 in VS Code 1.71.2 (74b1f979648cc44d385a2286793c226e611f59e7).
[11584 ms] Start: Run: ssh <machine name> /bin/sh
[11593 ms] Start: Run in host: id -un
It appears to hang here indefinitely.
I am able to attach to the container in the terminal, so there doesn't seem to be an issue with the way the container is set up. Does anyone have any ideas what might be causing this?
I also created an issue at Docker for Windows GitHub for the following behaviour and I'm wondering if somebody else experiences this degression since Docker for Desktop Version >4.5.1:
Docker Desktop for Windows 4.6.0 somehow mixes independent docker-compose executions. F.e.:
Execute docker-compose file1.yml in PowerShell-01
Execute docker-compose file2.yml in PowerShell-02
Now PowerShell-01 either dies with warning "no such service: " or logs from file1.yml now appear in PowerShell-02
Switching back to Docker for Desktop 4.5.1 the mixed CLI output doesn't happen anymore.
I am new to Docker and after writing docker version in cmd I got this error,
error during connect: This error may indicate that the docker daemon is not running.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version": open //./pipe/docker_engine: The system cannot find the file specified.
The following steps solved this problem:
Open cmd as administrator
Launch command: "C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchDaemon
some times docker might be disabled from starting on boot or login so in the windows search bar or when clicking the WinKey and starting to type Dock... like showen in the picture below, Then press Enter to start the Docker Daemon
Try running dockerd in a separate terminal and then try running this command.
To avoid doing this every time you can go to services -> find Docker -> select Startup Type as Automatic (Delayed) and reboot the machine.
Simple Solution: Just open Powershell and type dockerd which will start the daemon and you shall be able to use the docker now without errors.
On Windows, reason behind this issue is that Docker is not started. I tried couple of solution provided on multiple online portal to start it. What worked for me is:
In Docker Desktop if you are already logged in as a user, logout from there
Again login to docker desktop with docker account
When we login to docker account, it internally triggers the restart. So resulting if it's not started, it will start the docker for us.
I had this, but when I used a command shell elevated to Administrator, docker version was fine.
This error may indicate that the docker daemon is not running.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json": open //./pipe/docker_engine: The system cannot find the file specified.
this error in windows 10
step 1
pls install (https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package) Download the latest package:
this link WSL2 Linux kernel update package for x64 machines
then restart then automatically running
In my case,
I download the this github repo.MaxySpark
Closed all the application related to docker.
1.Click on docker.reg file in the downloaded repo.
2.Click on yes->yes->ok to merge.
3.Again open the Docker Toolbox and run docker run hello-world
Open cmd as administrator
Launch command: C:\Program Files\Docker\Docker\DockerCli.exe -SwitchDaemon
It simply means that your docker application is not running or you have not logged in to docker application, or docker desktop service is not running .
1: Just open Docker desktop application, login with docker credentials.
2: if already logged in and still getting this error, go to windows + r ==> and type 'services.msc', and restart the docker desktop service.
All done.
It can be kernel problem:
You need to update WSL2 Linux kernel update package for x64 machines
Follow this tutorial:
https://linuxhint.com/resolve-docker-daemon-not-running/
and before execute "docker run hello-world" command, dont forget restart docker
https://learn.microsoft.com/en-us/windows/wsl/install-manual
I've been following these instructions to get Docker installed on a brand new Windows 2019 Server.
As long as I use an administrative account, I can login and run whatever I want:
C:\Windows\system32>docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
But if I try to run the same command from a non-administrator shell I get this error message:
C:\Users\sysUKNG>docker run helloworld docker: error during connect:
Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/create:
open //./pipe/docker_engine: Access is denied. 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. See 'docker run --help'.
Is Microsoft expecting Docker users to only interact with the Docker Daemon from an elevated account? I guess this kind of makes sense if you assume that the purpose of Docker is to run long-lasting servers. It's logical that you'd want only an administrator to be able to start and stop these kinds of things.
However, I'm trying to run a large number of batch processes which get triggered by a scheduler run from a non-administrative service account. I really don't want my scheduler to have to run elevated.
In Docker for Linux I can make any user I want to have access to to Docker part of the "docker-users" group. Does Windows have an equivalent way to allow any user to have this kind of access? My server has no group with a similar name, but I do have "Hyper-V Administrators", which it says gives the account "Complete and unrestricted access", which is not exactly what I want.
Ideally I want a certain group of users to be able to start and stop a process that runs on Docker for Windows inside a Windows container.
This page suggests that the solution has something to do with opening a TCP port, but I'm using the Windows Server version of Docker. It doesn't have the same control panel that you normally get with Docker Desktop for Windows.
Another page suggests that I can only run Docker commands from an elevated shell? I too want to run some Docker stuff from Jenkins jobs.
create a group "docker-users". Needs to be run after each reboot.
$account="MY-SERVER-NAME\docker-users"
$npipe = "\\.\pipe\docker_engine"
$dInfo = New-Object "System.IO.DirectoryInfo" -ArgumentList $npipe
$dSec = $dInfo.GetAccessControl()
$fullControl =[System.Security.AccessControl.FileSystemRights]::FullControl
$allow =[System.Security.AccessControl.AccessControlType]::Allow
$rule = New-Object "System.Security.AccessControl.FileSystemAccessRule" -ArgumentList $account,$fullControl,$allow
$dSec.AddAccessRule($rule)
$dInfo.SetAccessControl($dSec)
I think I grabbed this idea from here : https://dille.name/blog/2017/11/29/using-the-docker-named-pipe-as-a-non-admin-for-windowscontainers/
not sure what i did wrong here, but i installed a new docker image and ran it - then i installed 2 additional images.
when i ran a ls here - they showed up fine, and i was also able to connect to the container.
then i opened docker desktop for windows - and saw a 'switch to WSL' button, and just tried to click it to see what it did and then i ran ls again and it showed nothing in the list.
assumed that it went to my WSL2 - so i switched back to windows (stopped the WSL2 option in docker settings ).
The strange thing here now is :
1) ls shows only :
C:\Users\mtd\.docker>docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
C:\Users\mtd\.docker>
2) i am - still - able to connect to my docker container via a browser.
i tried :
docker ps - & docker ps -a
but all shows nothing.
I also tried this command :
cd "C:\Program Files\Docker\Docker"
DockerCli.exe -SwitchDaemon
to see if i could switch back and forth but nomatter what - the list of containers is blank.
Edit:
After a reboot - i now get this error :
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/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 then tried to run switchdeamon a few times but now it just keeps coming with this error above - and after a few times i can do a docker container ls again - but still all images gone.
It was working smooth from commandline until i fired up the docker desktop :/