Cannot connect to the docker daemon at unix:///var/run/docker .sock

HI

I have Windows 10 Home, and heard about docker. I am very much a beginner in docker.

I cannot install on Windows 10 Home. so installed Ubuntu 18.04 LTS app.

I followed the instructions here
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04 and
https://askubuntu.com/questions/1030179/package-docker-ce-has-no-installation-candidate-in-18-04
to install Docker.

When I run docker --version, I get:

Docker version 19.03.2, build 6a30dfc

This makes me think that it is successfully installed, so I wanted to run hello-world

I run:
sudo docker run hello-world

and get:
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.

Can anyone offer any suggestions.

Reading through other questions, I found that other issues were similar but different than what I have currently.

Thanks

Docker can work in windows 10 home, check my answer on: Unable to install docker desktop on windows 10 home

But in this case, is docker running?
sudo service docker status

sudo service docker start

Thanks for the suggestion. I had hoped that I could run everything through the ubuntu terminal, but if I need hyper V no matter what then I will upgrade.

Following your suggestion:

I assume I will need to upgrade to windows10 pro, is that correct?

Try running “dockerd” as root, to see why it crashes

1 Like

running sudo dockerd returns:
failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables v1.6.1: can’t initialize iptables table `nat’: Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

There seems to be some confusion in this discussion. Let’s try to get things clearer.
Your screenshot shows you are in a WSL console. If you enter docker service commands you address a Docker service that runs inside your Linux app. You can’t use such a service (if we omit some new experimental versions).
@terpz gives you a link to another thread where you find a link to the instructions to install Docker Toolbox. Docker Toolbox is “is for older Mac and Windows systems that do not meet the requirements of … Docker Desktop for Windows”*. Toolbox runs on Virtualbox, not on Hyper-V.
You ask if you should upgrade to Windows 10 Pro. If you want to use Docker Desktop (and you probably want), then you should. In the docs for Toolbox we read: “We recommend updating to the newer applications, if possible.”
If you have installed Toolbox or Desktop, you have a Docker service running in Windows. Then you can open WSL and connect to this service with docker run..., docker-compose....

1 Like

Well since I experienced some problems on win10 pro with docker on ubuntu 18 wsl here is some help about those who want to make it work. Really great step by step how to