Minikube: dial unix /var/run/docker.sock: connect: permission denied

Created on 10 Apr 2020  ยท  3Comments  ยท  Source: kubernetes/minikube

Unable to Install Minikube:

$minikube start --driver=docker
minikube v1.9.2 on Ubuntu 19.10
โœจ Using the docker driver based on existing profile

โ— 'docker' driver reported an issue: exit status 1
๐Ÿ’ก Suggestion: Docker is not running or is responding too slow. Try: restarting docker desktop.

๐Ÿ‘ Starting control plane node m01 in cluster minikube
๐Ÿšœ Pulling base image ...
E0409 20:39:08.601665 24638 cache.go:114] Error downloading kic artifacts: error loading image: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/load?quiet=0: dial unix /var/run/docker.sock: connect: permission denied
๐Ÿคท docker "minikube" container is missing, will recreate.
๐Ÿ”ฅ Creating Kubernetes in docker container with (CPUs=2) (0 available), Memory=2200MB (0MB available) ...
๐Ÿคฆ StartHost failed, but will try again: recreate: creating host: create: creating: create kic node: creating volume for minikube container: output Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/volumes/create: dial unix /var/run/docker.sock: connect: permission denied
: exit status 1
๐Ÿคท docker "minikube" container is missing, will recreate.
๐Ÿ”ฅ Creating Kubernetes in docker container with (CPUs=2) (0 available), Memory=2200MB (0MB available) ...

๐Ÿ’ฃ Failed to start docker container. "minikube start" may fix it.: recreate: creating host: create: creating: create kic node: creating volume for minikube container: output Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/volumes/create: dial unix /var/run/docker.sock: connect: permission denied
: exit status 1

But when i use sudo it says:

minikube v1.9.2 on Ubuntu 19.10
โœจ Using the docker driver based on user configuration
๐Ÿ›‘ The "docker" driver should not be used with root privileges.
๐Ÿ’ก If you are running minikube within a VM, consider using --driver=none:
๐Ÿ“˜ https://minikube.sigs.k8s.io/docs/reference/drivers/none/

Need Help to install minikube for Kubenetes

cdocker-driver kinsupport needs-solution-message olinux

Most helpful comment

Hi @aslambaba

I believe you need to be in the docker group in order for the docker command-line to work. Can you confirm that docker is broken if you type:

docker ps

If so, try this to join the docker group:

newgrp docker

Otherwise, please check these instructions: https://docs.docker.com/engine/install/linux-postinstall/

Please let me know what works for you, so that we can update this error message with clearer instructions. Thank you!

All 3 comments

Hi @aslambaba

I believe you need to be in the docker group in order for the docker command-line to work. Can you confirm that docker is broken if you type:

docker ps

If so, try this to join the docker group:

newgrp docker

Otherwise, please check these instructions: https://docs.docker.com/engine/install/linux-postinstall/

Please let me know what works for you, so that we can update this error message with clearer instructions. Thank you!

Minikube requires to be able to run docker without sudo, but that is not the default installation.

We noticed this with the generic driver, and there a step was added to give the user root-access.

commit https://github.com/kubernetes/minikube/pull/6873/commits/3117473837ca0b55f6ab20f442413f8285fc4627

Note that this is a security risk, when doing it on the host - as opposed to in a dedicated VM.

As in: https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface

But the error could be improved. (Also seen in #7534)

Now it looks like:

โ—  'docker' driver reported an issue: "docker version --format {{.Server.Version}}" exit status 1: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/version: dial unix /var/run/docker.sock: connect: permission denied
๐Ÿ’ก  Suggestion: 
๐Ÿ“˜  Documentation: https://minikube.sigs.k8s.io/docs/drivers/docker/

๐Ÿ’ฃ  Failed to validate 'docker' driver

Was this page helpful?
0 / 5 - 0 ratings